ServiceIdentity
Database ownership của Identity
Schema/table ownership của Go Identity Service và rule boundary cross-service.
Database ownership của Identity
Schema owner
Identity Service owns schema:
identityGo migrations nằm trong identity-service/db/migration.
Tables chính
Confirmed từ migrations:
| Table | Identity sở hữu gì |
|---|---|
identity.account | account, profile auth cơ bản, status |
identity.credential | credential, password/OAuth/magic-link record |
identity.workspace | workspace dùng cho auth membership |
identity.workspace_member | member trong workspace |
identity.branch | branch metadata cho auth context |
identity.branch_member | branch membership |
identity.auth_session | login session, refresh rotation, branch scope |
Roles/permissions tables
Confirmed từ migrations:
| Table | Ghi chú |
|---|---|
identity.permission | permission catalog trong Identity schema |
identity.role | role theo workspace |
identity.role_permission | role-permission mapping |
identity.member_role | member-role mapping |
identity.branch_member_role | branch member role mapping |
identity.workspace_group | workspace group |
identity.member_group | group membership |
identity.group_permission | group-permission mapping |
Current auth/token code đọc role codes để đưa vào token/response.
Session table
identity.auth_session columns confirmed:
idworkspace_idaccount_idmember_idactive_branch_idstatusjtirevoked_atexpires_atcreated_atupdated_at
Session status constraint:
ACTIVE, REVOKED, EXPIREDIntegration tables
Confirmed nhưng chưa document sâu trong batch này:
identity.audit_logidentity.outbox_event
Boundary rule
Identity owns auth/membership tables.
Other services must not query Identity DB directly.
Other services nhận context qua:
- API Gateway
trusted headers. - Internal APIs/events later, khi được thiết kế và đóng.
Không thuộc Identity
Identity không own:
- setup status
current-context- entitlement/package/capability/navigation
- quote/order/subscription/payment lifecycle
TODO
- Chưa đóng: event/outbox contract.
- Chưa đóng: policy rõ cho role/permission ownership khi Entitlement capability graph hoàn tất.