mirror of
https://github.com/docmost/docmost.git
synced 2025-11-23 15:41:08 +10:00
feat: implement SSO group synchronization for SAML and OIDC
- Add is_group_sync_enabled column to auth_providers table - Extract groups from SAML attributes (memberOf, groups, roles) - Extract groups from OIDC claims (groups, roles) - Implement case-insensitive group matching with auto-creation - Sync user groups on each SSO login - Ensure only one provider can have group sync enabled at a time - Add group sync toggle to SAML and OIDC configuration forms
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
import { type Kysely } from 'kysely';
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await db.schema
|
||||
.alterTable('auth_providers')
|
||||
.addColumn('is_group_sync_enabled', 'boolean', (col) =>
|
||||
col.defaultTo(false).notNull(),
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await db.schema
|
||||
.alterTable('auth_providers')
|
||||
.dropColumn('is_group_sync_enabled')
|
||||
.execute();
|
||||
}
|
||||
2
apps/server/src/database/types/db.d.ts
vendored
2
apps/server/src/database/types/db.d.ts
vendored
@ -62,6 +62,7 @@ export interface AuthProviders {
|
||||
deletedAt: Timestamp | null;
|
||||
id: Generated<string>;
|
||||
isEnabled: Generated<boolean>;
|
||||
isGroupSyncEnabled: Generated<boolean>;
|
||||
name: string;
|
||||
oidcClientId: string | null;
|
||||
oidcClientSecret: string | null;
|
||||
@ -122,6 +123,7 @@ export interface Comments {
|
||||
pageId: string;
|
||||
parentCommentId: string | null;
|
||||
resolvedAt: Timestamp | null;
|
||||
resolvedById: string | null;
|
||||
selection: string | null;
|
||||
type: string | null;
|
||||
workspaceId: string;
|
||||
|
||||
Submodule apps/server/src/ee updated: 4c252d1ec3...8f0fbf6964
Reference in New Issue
Block a user