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
merge into: platform:feat/onprem-mode
platform:main
platform:feat/einstieg-plan
platform:feat/update-policy
platform:feat/telemetry-relay
platform:feat/feedback-endpoint
platform:feat/onprem
platform:feat/onprem-mail
platform:feat/onprem-mode
platform:feat/avv-autofill
platform:feat/release-avv-1.0.0
platform:fix/erpsetup-dunning-and-small
platform:feat/module-user-count
platform:feat/usage-summary
platform:feat/mahnung-ladder
platform:fix/toms-status-available
platform:feat/contractdocs-agb-tom
platform:feat/company-rules
platform:feat/staff-brand-slug
platform:fix/intake-outlives-purge
platform:fix/catalogue-labels
platform:feat/trial-offer-status
platform:feat/function-holders
platform:feat/assignable-bundles
platform:feat/contract-documents
platform:feat/erp-lb-versions
platform:feat/store-merges-unterlagen
platform:feat/product-hierarchy
platform:feat/preview-grants
platform:ci/platform-image-and-webhook
platform:ci/registry-meghsakha-orca-webhook
No Reviewers
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
cra:annex-i
cve
pruefwerk
risk:accepted
severity:critical
severity:high
severity:low
severity:medium
CRA Anhang I, wesentliche Cybersicherheitsanforderungen / CRA Annex I
Bekannte Schwachstelle in einer Abhängigkeit / known vulnerability in a dependency
Befund aus Prüfwerk / Prüfwerk finding
Risiko akzeptiert, nicht behoben / accepted risk, not fixed
Schweregrad kritisch / critical
Schweregrad hoch / high
Schweregrad niedrig / low
Schweregrad mittel / medium
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: platform/tenant-registry#143
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Stacked on #142, so the base is
feat/onprem-mode; merge #142 first. This closes on-prem gap 6.Problem. On-prem, every account comes from the customer's AD through Keycloak's federation. Keycloak finds an AD user by e-mail even before their first sign-in, so creating the workspace with an AD admin answered
email_taken, and nobody could enter it. Invitations would also have created local users and sent a set-password mail.Directory mode in the Keycloak adapter. It is on with
APP_ENV=onprem:added; the audit actions areuser.addedandkeycloak.admin_added.not_in_directory. For the workspace admin this is checked before the workspace is created, and the adapter looks the user up before it creates the organization. Nothing is left behind.no_invite_mail. Directory members are never "pending".Keycloak side (
platform/onprem,package/keycloak/):UNSYNCED, which never writes to AD.realm-policy.sh:check-local-passwords.sh, tested both ways.removeInvalidUsersEnabled=false: an account disabled in AD, or removed from the groups, can't sign in but keeps its membership.Checked against Keycloak 26.8.1 and a Samba AD (the test VM):
PurgeTenantremoves only the Keycloak copies; the AD accounts stay.Tests.
go test ./...passes, including Postgres. New:internal/keycloak/directory_test.go(each test has a cloud control where it matters) and on-prem server tests inonprem_test.go.Small cloud-side changes:
org_roles.tenant_statusstaystrialin the cloud; only on-prem passes the workspace status. A test pins this.Follow-up from the test install (
1b821ba)On an installation the realm also holds our local staff accounts (
onpremkeycloak/staff-account.sh). The directory lookup took any Keycloak user with the address, so a workspace admin could add our staff account to their team (201added, workspace attributes and membership on the staff account). Now only a user with a federation link (from the AD) joins a workspace, as first admin or member; a local account answersnot_in_directory. New testTestDirectory_localAccountIsNotADirectoryUser; checked in the VM (422not_in_directory). #144 has this merged in.🤖 Generated with Claude Code
Merged as part of #146 (the same commits on today's main; migration renumbered to 0033).
Pull request closed