feat(onprem): directory users instead of invitations #143

Closed
sharang wants to merge 3 commits from feat/onprem-directory-users into feat/onprem-mode
pull from: feat/onprem-directory-users
3 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 1b821baa7b fix(onprem): only directory users join a workspace
ci / shared (pull_request) Skipped
In directory mode the registry attached any Keycloak user found by
e-mail. On an installation the realm also holds our local staff accounts
(onprem keycloak/staff-account.sh): a workspace admin could add one to
their team (201 added), giving our support account workspace attributes
and membership. Found in the test install.

Now only a user with a federation link (from the AD) counts, for the
first admin and for members; a local account answers not_in_directory
like an unknown address. The cloud is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 12:00:45 +01:00
Sharang ParnerkarandClaude Opus 5.5 d8cb363d5c fix(onprem): the cloud admin keeps tenant_status trial
ci / shared (pull_request) Skipped
Only on-prem passes the workspace's status to Keycloak for its first admin;
a cloud demo workspace with an admin wrote demo instead of trial (pinned by
a test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:24:55 +01:00
Sharang ParnerkarandClaude Opus 5.5 b8206c553f feat(onprem): directory users instead of invitations
ci / shared (pull_request) Skipped
On-prem every account comes from the customer's AD through Keycloak's
federation, so an AD admin answered email_taken and invitations asked for a
new password. The Keycloak adapter gets a directory mode (DirectoryUsers,
on with APP_ENV=onprem):

- The first admin and invited members are existing directory users,
  attached to the organization with their role. No local user is created,
  no execute-actions mail is sent (invite status "added", audit user.added /
  keycloak.admin_added).
- An unknown address (or one outside the admitted AD groups) answers 404
  not_in_directory. For the workspace's admin it is checked before the
  workspace is created, and the adapter looks the user up before creating
  the organization, so nothing is left behind.
- Resend answers 409 no_invite_mail; directory members are never pending.
- Member lists read the roles from the user when Keycloak lists a federated
  member with its LDAP attributes only (seen with Keycloak 26.8).
- The admin address is normalized once for lookup, store and Keycloak.

Checked against Keycloak 26.8.1 with a Samba AD (the test install in
platform/onprem, realm with UNSYNCED federation and realm-policy.sh).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:18:22 +01:00