Bootstrap and GitOps provisioning

Ipseity's first-run bootstrap is intentionally narrow and temporary. There is no default user — an operator provisions identity objects either through the API (recommended) or directly as Kubernetes ConfigMaps (GitOps). Public console clients are server-managed and created automatically in every realm; see console access.

Bootstrap state

Bootstrap is open only while:

  • principals count is 0 and
  • externally managed clients count is 0 (the server-managed ipseity-internal client is ignored).

While open:

  • GET /api/bootstrap/status and GET /api/meta are public.
  • Unauthenticated mutations are limited to roles and groups CRUD, and the one-time POST /api/bootstrap/admin.
  • Bootstrap closes automatically as soon as a principal or an external client exists in the main realm; it never auto-creates accounts. The managed console client does not close bootstrap.

These public bootstrap operations apply only to the main realm. Tenant console routes always report bootstrap closed and cannot create an initial main admin. Authenticated requests do not inherit bootstrap bypasses. Once main bootstrap is closed, public status omits counts and returns only the two false flags bootstrap_open and can_create_initial_admin; metadata requires identity read access and reveals the realm directory only to main super administrators.

For network-exposed deployments, set IPSEITY_BOOTSTRAP_TOKEN. Clients must then send a matching X-Bootstrap-Token header for unauthenticated bootstrap writes (roles/groups CRUD and POST /api/bootstrap/admin); /api/bootstrap/status remains public, and /api/meta is public only during this main-realm bootstrap window.

Create the first administrator

With bootstrap open:

curl -sS http://localhost:8080/api/bootstrap/status
curl -sS -X POST http://localhost:8080/api/bootstrap/admin \
  -H 'Content-Type: application/json' \
  -d '{"name":"admin","password":"AStrongPass!"}'

Assign the administrator real permissions (group membership → roles) after creation. New principals always receive login by default.

Create a role and group during bootstrap

curl -sS -X POST http://localhost:8080/api/roles \
  -H 'Content-Type: application/json' -d '{"name":"viewer","permissions":["identity.read"]}'

curl -sS -X POST http://localhost:8080/api/groups \
  -H 'Content-Type: application/json' \
  -d '{"name":"platform-viewers","description":"Read-only operators","roles":["viewer"],"permissions":[]}'

GitOps-native provisioning (Kubernetes stores)

For controller-managed grants allowing a main-realm user to sign into a customer CMS, provision tenant memberships. The complete role + membership YAML contains no secrets and can be reconciled in the website namespace by the Viking CMS controller.

Ipseity persists entities as ConfigMaps when the Kubernetes backend is active, so GitOps tooling (e.g. Orbit Deploy) can apply identity objects directly.

Object conventions (see kubernetes-resources.md):

  • ConfigMap.metadata.name: ipseity-<entity-singular>-<name-lowercase> (e.g. ipseity-role-admin, ipseity-principal-alice).
  • Labels: app: ipseity, app.kubernetes.io/managed-by: ipseity, ipseity.io/entity: <entity>, ipseity.io/name: <name>.
  • Data: data.payload must be a JSON document matching the entity schema.

Caution: direct ConfigMap creation bypasses API validation. Invalid payloads can break runtime behaviour. Prefer the API when you can.

Password hashing for seeded principals

Via the API, plaintext passwords are hashed automatically. Via ConfigMaps, use a pre-hashed value (or a plaintext seed — Ipseity lazily re-encrypts it):

python3 - <<'PY'
from app.k8s_store import normalize_password_for_storage
print(normalize_password_for_storage("replace-me"))
PY

Secret fields: plaintext or pre-encrypted seeds

For password, mfa_secret, client_secret: supply either an already-encrypted value (ipseity-enc$v1$<nonce>$<ciphertext>) or plaintext. Ipseity detects plaintext seeds on first read and rewrites them in place, encrypted. Identifiers (name, client_id, groups, roles, permissions, email) are never encrypted.

Example manifests

Role

apiVersion: v1
kind: ConfigMap
metadata:
  name: ipseity-role-admin
  namespace: ipseity
  labels: { app: ipseity, app.kubernetes.io/managed-by: ipseity, ipseity.io/entity: roles, ipseity.io/name: admin }
data:
  payload: |
    { "name": "admin", "entity": "role",
      "permissions": ["identity.read", "identity.write", "identity.delete", "admin.audit.read"] }

Group

apiVersion: v1
kind: ConfigMap
metadata:
  name: ipseity-group-platform-admins
  namespace: ipseity
  labels: { app: ipseity, app.kubernetes.io/managed-by: ipseity, ipseity.io/entity: groups, ipseity.io/name: platform-admins }
data:
  payload: |
    { "name": "platform-admins", "entity": "group", "description": "Platform administrators",
      "roles": ["admin"], "permissions": [] }

Principal

apiVersion: v1
kind: ConfigMap
metadata:
  name: ipseity-principal-alice
  namespace: ipseity
  labels: { app: ipseity, app.kubernetes.io/managed-by: ipseity, ipseity.io/entity: principals, ipseity.io/name: alice }
data:
  payload: |
    { "name": "alice", "entity": "principal", "type": "user",
      "password": "pbkdf2_sha256$260000$<salt>$<digest>",
      "groups": ["platform-admins"], "roles": [], "permissions": [],
      "mfa_enabled": false, "mfa_secret": "", "disabled": false }

Client

apiVersion: v1
kind: ConfigMap
metadata:
  name: ipseity-client-web-console
  namespace: ipseity
  labels: { app: ipseity, app.kubernetes.io/managed-by: ipseity, ipseity.io/entity: clients, ipseity.io/name: web-console }
data:
  payload: |
    { "name": "web-console", "entity": "client", "client_id": "web-console",
      "public_client": true, "client_secret": "", "redirect_uris": ["https://console.example.tld/callback"],
      "allowed_scopes": ["openid", "profile", "groups", "roles"] }

Suggested GitOps rollout order

  1. roles
  2. groups
  3. principals
  4. external clients (internal UI client is server-managed)

This ensures RBAC references resolve as principals begin authenticating.