Import from a file

--from config imports a realm from a FerrisKey-native description file. The format comes from the extension: .yaml, .yml, or .toml. No external system and no credentials are involved.

ferris-ctl realm import --from config --file realm.yaml

Preview without writing anything:

ferris-ctl realm import --from config --file realm.yaml --dry-run -o yaml

Format

A description carries a name, plus optional settings, roles, clients, and users sections. The repository ships a working example at cli/examples/realm.yaml.

name: acme

settings:
  access_token_lifetime: 300
  refresh_token_lifetime: 1800
  user_registration_enabled: true
  forgot_password_enabled: true

roles:
  - name: admin
    description: Realm administrators
    permissions:
      - manage_realm
      - manage_users
  - name: viewer
    description: Read-only access
    permissions:
      - view_users
      - view_clients

clients:
  - client_id: web-app
    name: Web Application
    client_type: public
    public_client: true
    redirect_uris:
      - https://app.acme.test/callback
      - https://app.acme.test/*
  - client_id: backend
    name: Backend Service
    client_type: confidential
    service_account_enabled: true
    direct_access_grants_enabled: true
    roles:
      - name: service-reader
        description: Service-scoped read role

users:
  - username: alice
    email: alice@acme.test
    firstname: Alice
    lastname: Doe
    email_verified: true
    roles:
      - admin
  - username: bob
    email: bob@acme.test
    roles:
      - viewer

Settings

Every setting is optional. Anything you leave out keeps the FerrisKey default.

FieldDescription
default_signing_algorithmToken signing algorithm
access_token_lifetimeAccess token TTL (seconds)
refresh_token_lifetimeRefresh token TTL (seconds)
id_token_lifetimeID token TTL (seconds)
temporary_token_lifetimeTemporary token TTL (seconds)
user_registration_enabledAllow self-registration
forgot_password_enabledEnable the forgot-password flow
remember_me_enabledEnable “remember me”
magic_link_enabled / magic_link_ttlMagic-link login and its TTL
passkey_enabledEnable passkeys
compass_enabledEnable the Compass module
email_verification_enabledRequire email verification
email_verification_ttl_hoursEmail verification link TTL (hours)

Roles

FieldDefaultDescription
namerequiredRole name
descriptionnoneFree-text description
permissions[]Permission names, in snake_case

Permissions use the names from the permissions reference, so manage_realm, not ManageRealm and not realm:manage. Unrecognized names are dropped silently when the role is created.

Clients

FieldDefaultDescription
client_idrequiredClient identifier
namenoneDisplay name
client_typepublicpublic, confidential, or system
protocolopenid-connectProtocol used by the client
enabledtrueWhether the client can be used
public_clientfalsePublic client, no secret
service_account_enabledfalseCreate a linked service account user
direct_access_grants_enabledfalseAllow the password grant
device_authorization_grant_enabledfalseAllow the device code grant
redirect_uris[]Allowed redirect URIs
post_logout_redirect_uris[]Allowed post-logout redirect URIs
web_origins[]Browser origins allowed on this client’s realm-scoped routes
require_pkceinheritRequire PKCE on the authorization code flow
access_token_lifetimeinheritOverride the realm access token TTL, in seconds
refresh_token_lifetimeinheritOverride the realm refresh token TTL
id_token_lifetimeinheritOverride the realm ID token TTL
temporary_token_lifetimeinheritOverride the realm temporary token TTL
roles[]Roles scoped to this client, same shape as realm roles

Users

FieldDefaultDescription
usernamerequiredUsername
emailnoneEmail address
firstnamenoneFirst name
lastnamenoneLast name
email_verifiednoneMark the email as already verified
roles[]Roles to assign

A plain name in roles refers to a realm role. Prefix it with a client id to pick a role scoped to that client:

users:
  - username: alice
    roles:
      - admin              # realm role
      - backend:service-reader   # role of the "backend" client

Passwords are not in the blueprint

Credentials are never part of an import. Users come out without a password: set one afterwards with ferris-ctl user set-password, from the admin console, or through a recovery flow.