Skip to content

feat(auth): add enterprise SSO and RBAC#418

Open
StringKe wants to merge 2 commits intomemohai:mainfrom
StringKe:codex/enterprise-sso-rbac
Open

feat(auth): add enterprise SSO and RBAC#418
StringKe wants to merge 2 commits intomemohai:mainfrom
StringKe:codex/enterprise-sso-rbac

Conversation

@StringKe
Copy link
Copy Markdown
Contributor

@StringKe StringKe commented May 2, 2026

Summary

  • Add enterprise IAM schema for SSO providers, external identities, groups, role assignments, sessions, and audit-friendly auth state.
  • Add OIDC/OAuth login using github.com/zitadel/oidc/v3 and SAML login using github.com/crewjam/saml.
  • Replace legacy users.role auth behavior with system and bot-scoped RBAC while keeping the member/admin role keys as system roles.
  • Add IAM administration APIs, OpenAPI/SDK updates, and the web IAM settings UI.
  • Add tests for JWT sessions, SSO state/code handling, OIDC/SAML normalization, RBAC bootstrap/checks, and auth handlers.

Impact

Admins can configure OIDC and SAML SSO providers, control email linking behavior, map external groups to local groups, and assign system or bot-scoped roles without relying on the old single users.role field.

Validation

  • mise run sqlc-generate
  • mise run swagger-generate
  • ./node_modules/.bin/openapi-ts -f openapi-ts.config.ts
  • mise exec -- go test ./internal/... ./cmd/...
  • mise exec -- go build -o /tmp/memoh-check ./cmd/memoh
  • mise exec -- go build -o /tmp/agent-check ./cmd/agent
  • mise exec -- go build -o /tmp/bridge-check ./cmd/bridge
  • ./node_modules/.bin/vite build
  • SQLite local migration and cmd/agent serve smoke test on 127.0.0.1:18731
  • pre-commit large-file check, Go lint, Go test, and staged ESLint fix

@StringKe StringKe changed the title feat(auth): 添加企业 SSO 和 RBAC feat(auth): add enterprise SSO and RBAC May 2, 2026
Comment thread db/postgres/migrations/0002_channel_identity_avatar.down.sql
Comment thread db/postgres/migrations/0044_user_timezone.up.sql
Comment thread db/postgres/migrations/0031_chat_acl_remove_bot_members.up.sql
Comment thread db/postgres/migrations/0056_migrate_web_cli_to_local.up.sql
Comment thread db/postgres/migrations/0062_github_copilot_user_oauth.up.sql
Comment thread db/postgres/migrations/0064_revert_local_to_web.up.sql
@StringKe StringKe force-pushed the codex/enterprise-sso-rbac branch from 7d55f4b to 22015b5 Compare May 2, 2026 13:23
@StringKe StringKe force-pushed the codex/enterprise-sso-rbac branch from 22015b5 to b85f7e3 Compare May 2, 2026 13:25
@StringKe StringKe marked this pull request as ready for review May 2, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants