@idp.global/interfaces 23.0.0 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +19 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/activity.d.ts +2 -2
- package/dist_ts/data/authorization.d.ts +15 -0
- package/dist_ts/data/authorization.js +78 -0
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/role.d.ts +3 -0
- package/dist_ts/data/user.d.ts +37 -0
- package/dist_ts/dto/activity.d.ts +1 -1
- package/dist_ts/dto/organization.d.ts +2 -0
- package/dist_ts/dto/user.d.ts +33 -0
- package/dist_ts/request/admin.d.ts +74 -0
- package/dist_ts/request/admin.js +2 -1
- package/dist_ts/request/organization.d.ts +2 -0
- package/package.json +1 -1
- package/readme.md +8 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/activity.ts +6 -0
- package/ts/data/authorization.ts +94 -0
- package/ts/data/index.ts +1 -0
- package/ts/data/role.ts +3 -0
- package/ts/data/user.ts +50 -0
- package/ts/dto/activity.ts +5 -0
- package/ts/dto/organization.ts +2 -0
- package/ts/dto/user.ts +43 -0
- package/ts/request/admin.ts +94 -0
- package/ts/request/organization.ts +1 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-07-18 - 25.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- add break-glass access contracts (break-glass)
|
|
8
|
+
- Adds break-glass activity event and target types for request, activation, use, and review flows
|
|
9
|
+
- Adds eligible global capabilities, user data state, public DTO state, and admin request contracts for request, approval, and review
|
|
10
|
+
- Adds required breakGlassAccess to IGlobalUserAdminDto
|
|
11
|
+
|
|
12
|
+
## 2026-07-18 - 24.0.0
|
|
13
|
+
|
|
14
|
+
### Breaking Changes
|
|
15
|
+
|
|
16
|
+
- introduce capability-based authorization contracts (authorization)
|
|
17
|
+
- Export global and tenant capability catalogs with delegable subsets.
|
|
18
|
+
- Add direct global capability assignment request contract using user revision and operation id.
|
|
19
|
+
- Require explicit capability lists on customer-defined organization role contracts.
|
|
20
|
+
- Expose user global capability assignments and add global_capabilities_changed activity event.
|
|
21
|
+
|
|
3
22
|
## 2026-07-18 - 23.0.0
|
|
4
23
|
|
|
5
24
|
### Breaking Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@idp.global/interfaces',
|
|
6
|
-
version: '
|
|
6
|
+
version: '25.0.0',
|
|
7
7
|
description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TActivityAction = 'login' | 'logout' | 'session_created' | 'session_revoked' | 'passport_device_enrolled' | 'passport_device_revoked' | 'passport_challenge_approved' | 'passport_challenge_rejected' | 'org_created' | 'org_updated' | 'org_deleted' | 'org_ownership_transferred' | 'org_joined' | 'org_left' | 'role_changed' | 'org_app_role_mappings_updated' | 'profile_updated' | 'totp_enabled' | 'totp_disabled' | 'backup_codes_regenerated' | 'mfa_completed' | 'passkey_registered' | 'passkey_revoked' | 'passkey_login' | 'app_connected' | 'app_disconnected' | 'user_suspended' | 'user_unsuspended' | 'global_admin_granted' | 'global_admin_removed' | 'account_deletion_requested' | 'account_deletion_cancelled' | 'account_purged' | 'sso_connection_created' | 'sso_connection_updated' | 'sso_connection_deleted' | 'sso_domain_verified' | 'sso_login' | 'scim_token_created' | 'scim_token_revoked' | 'scim_user_provisioned' | 'scim_user_updated' | 'scim_user_deactivated' | 'scim_group_membership_changed' | 'oidc_authorization_granted' | 'oidc_code_exchanged' | 'oidc_refresh_rotated' | 'oidc_refresh_reuse_detected' | 'oidc_token_revoked' | 'oidc_logout' | 'oidc_client_created' | 'oidc_client_updated' | 'oidc_client_activation_changed' | 'oidc_client_deleted' | 'oidc_client_secret_rotated' | 'oidc_signing_key_rotated' | 'oidc_lifecycle_revoked' | 'org_suspended' | 'org_unsuspended';
|
|
1
|
+
export type TActivityAction = 'login' | 'logout' | 'session_created' | 'session_revoked' | 'passport_device_enrolled' | 'passport_device_revoked' | 'passport_challenge_approved' | 'passport_challenge_rejected' | 'org_created' | 'org_updated' | 'org_deleted' | 'org_ownership_transferred' | 'org_joined' | 'org_left' | 'role_changed' | 'org_app_role_mappings_updated' | 'profile_updated' | 'totp_enabled' | 'totp_disabled' | 'backup_codes_regenerated' | 'mfa_completed' | 'passkey_registered' | 'passkey_revoked' | 'passkey_login' | 'app_connected' | 'app_disconnected' | 'user_suspended' | 'user_unsuspended' | 'global_admin_granted' | 'global_admin_removed' | 'global_capabilities_changed' | 'break_glass_requested' | 'break_glass_activated' | 'break_glass_used' | 'break_glass_reviewed' | 'account_deletion_requested' | 'account_deletion_cancelled' | 'account_purged' | 'sso_connection_created' | 'sso_connection_updated' | 'sso_connection_deleted' | 'sso_domain_verified' | 'sso_login' | 'scim_token_created' | 'scim_token_revoked' | 'scim_user_provisioned' | 'scim_user_updated' | 'scim_user_deactivated' | 'scim_group_membership_changed' | 'oidc_authorization_granted' | 'oidc_code_exchanged' | 'oidc_refresh_rotated' | 'oidc_refresh_reuse_detected' | 'oidc_token_revoked' | 'oidc_logout' | 'oidc_client_created' | 'oidc_client_updated' | 'oidc_client_activation_changed' | 'oidc_client_deleted' | 'oidc_client_secret_rotated' | 'oidc_signing_key_rotated' | 'oidc_lifecycle_revoked' | 'org_suspended' | 'org_unsuspended';
|
|
2
2
|
export type TActivityOutcome = 'attempted' | 'succeeded' | 'denied' | 'failed';
|
|
3
3
|
/**
|
|
4
4
|
* Public failure reasons are deliberately finite and non-descriptive. They
|
|
@@ -6,7 +6,7 @@ export type TActivityOutcome = 'attempted' | 'succeeded' | 'denied' | 'failed';
|
|
|
6
6
|
* caller-authored text across the public contract boundary.
|
|
7
7
|
*/
|
|
8
8
|
export type TActivityReasonCode = 'account_inactive' | 'authentication_failed' | 'authorization_denied' | 'conflict' | 'expired' | 'invalid_request' | 'policy_denied' | 'rate_limited' | 'replay_detected' | 'revoked' | 'step_up_required' | 'upstream_unavailable' | 'user_cancelled';
|
|
9
|
-
export type TActivityTargetType = 'account' | 'application_connection' | 'mfa_method' | 'oidc_authorization' | 'oidc_client' | 'oidc_lifecycle' | 'oidc_signing_key' | 'oidc_token' | 'organization' | 'organization_membership' | 'organization_role_mapping' | 'passkey' | 'passport_challenge' | 'passport_device' | 'profile' | 'scim_group_membership' | 'scim_token' | 'scim_user' | 'session' | 'sso_connection' | 'sso_domain';
|
|
9
|
+
export type TActivityTargetType = 'account' | 'application_connection' | 'break_glass_access' | 'mfa_method' | 'oidc_authorization' | 'oidc_client' | 'oidc_lifecycle' | 'oidc_signing_key' | 'oidc_token' | 'organization' | 'organization_membership' | 'organization_role_mapping' | 'passkey' | 'passport_challenge' | 'passport_device' | 'profile' | 'scim_group_membership' | 'scim_token' | 'scim_user' | 'session' | 'sso_connection' | 'sso_domain';
|
|
10
10
|
export type TActivityAuthenticationMethod = 'magic_link' | 'password';
|
|
11
11
|
export type TActivitySessionKind = 'browser' | 'oidc';
|
|
12
12
|
export type TActivityRevocationScope = 'account' | 'all_sessions' | 'application' | 'current_session' | 'organization' | 'token_family';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const globalCapabilities: readonly ["global.oidc-client.read", "global.oidc-client.manage", "global.organization.read", "global.organization.manage", "global.alert.read", "global.alert.manage", "global.user.read", "global.user.manage", "global.user.delete", "global.admin.manage", "global.signing-key.rotate", "global.break-glass.request", "global.break-glass.approve"];
|
|
2
|
+
export type TGlobalCapability = (typeof globalCapabilities)[number];
|
|
3
|
+
export declare const delegableGlobalCapabilities: readonly ["global.oidc-client.read", "global.oidc-client.manage", "global.organization.read", "global.organization.manage", "global.alert.read", "global.alert.manage", "global.user.read", "global.user.manage", "global.break-glass.request"];
|
|
4
|
+
export type TDelegableGlobalCapability = (typeof delegableGlobalCapabilities)[number];
|
|
5
|
+
/**
|
|
6
|
+
* Capabilities that may be activated temporarily through the two-person
|
|
7
|
+
* break-glass protocol. Authority to delete accounts, manage administrators,
|
|
8
|
+
* rotate signing keys, or approve break-glass access is never eligible.
|
|
9
|
+
*/
|
|
10
|
+
export declare const breakGlassEligibleGlobalCapabilities: readonly ["global.oidc-client.manage", "global.organization.manage", "global.alert.manage", "global.user.manage"];
|
|
11
|
+
export type TBreakGlassEligibleGlobalCapability = (typeof breakGlassEligibleGlobalCapabilities)[number];
|
|
12
|
+
export declare const tenantCapabilities: readonly ["tenant.organization.read", "tenant.organization.manage", "tenant.organization.delete", "tenant.organization.export", "tenant.role.read", "tenant.role.manage", "tenant.membership.read", "tenant.membership.manage", "tenant.ownership.transfer", "tenant.app-connection.read", "tenant.app-connection.manage", "tenant.sso.read", "tenant.sso.manage", "tenant.scim-token.read", "tenant.scim-token.manage", "tenant.billing.read", "tenant.billing.manage", "tenant.alert.read", "tenant.alert.manage"];
|
|
13
|
+
export type TTenantCapability = (typeof tenantCapabilities)[number];
|
|
14
|
+
export declare const delegableTenantCapabilities: readonly ["tenant.organization.read", "tenant.organization.manage", "tenant.organization.export", "tenant.role.read", "tenant.role.manage", "tenant.membership.read", "tenant.membership.manage", "tenant.app-connection.read", "tenant.app-connection.manage", "tenant.sso.read", "tenant.sso.manage", "tenant.scim-token.read", "tenant.scim-token.manage", "tenant.billing.read", "tenant.billing.manage", "tenant.alert.read", "tenant.alert.manage"];
|
|
15
|
+
export type TDelegableTenantCapability = (typeof delegableTenantCapabilities)[number];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const globalCapabilities = [
|
|
2
|
+
'global.oidc-client.read',
|
|
3
|
+
'global.oidc-client.manage',
|
|
4
|
+
'global.organization.read',
|
|
5
|
+
'global.organization.manage',
|
|
6
|
+
'global.alert.read',
|
|
7
|
+
'global.alert.manage',
|
|
8
|
+
'global.user.read',
|
|
9
|
+
'global.user.manage',
|
|
10
|
+
'global.user.delete',
|
|
11
|
+
'global.admin.manage',
|
|
12
|
+
'global.signing-key.rotate',
|
|
13
|
+
'global.break-glass.request',
|
|
14
|
+
'global.break-glass.approve',
|
|
15
|
+
];
|
|
16
|
+
export const delegableGlobalCapabilities = [
|
|
17
|
+
'global.oidc-client.read',
|
|
18
|
+
'global.oidc-client.manage',
|
|
19
|
+
'global.organization.read',
|
|
20
|
+
'global.organization.manage',
|
|
21
|
+
'global.alert.read',
|
|
22
|
+
'global.alert.manage',
|
|
23
|
+
'global.user.read',
|
|
24
|
+
'global.user.manage',
|
|
25
|
+
'global.break-glass.request',
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* Capabilities that may be activated temporarily through the two-person
|
|
29
|
+
* break-glass protocol. Authority to delete accounts, manage administrators,
|
|
30
|
+
* rotate signing keys, or approve break-glass access is never eligible.
|
|
31
|
+
*/
|
|
32
|
+
export const breakGlassEligibleGlobalCapabilities = [
|
|
33
|
+
'global.oidc-client.manage',
|
|
34
|
+
'global.organization.manage',
|
|
35
|
+
'global.alert.manage',
|
|
36
|
+
'global.user.manage',
|
|
37
|
+
];
|
|
38
|
+
export const tenantCapabilities = [
|
|
39
|
+
'tenant.organization.read',
|
|
40
|
+
'tenant.organization.manage',
|
|
41
|
+
'tenant.organization.delete',
|
|
42
|
+
'tenant.organization.export',
|
|
43
|
+
'tenant.role.read',
|
|
44
|
+
'tenant.role.manage',
|
|
45
|
+
'tenant.membership.read',
|
|
46
|
+
'tenant.membership.manage',
|
|
47
|
+
'tenant.ownership.transfer',
|
|
48
|
+
'tenant.app-connection.read',
|
|
49
|
+
'tenant.app-connection.manage',
|
|
50
|
+
'tenant.sso.read',
|
|
51
|
+
'tenant.sso.manage',
|
|
52
|
+
'tenant.scim-token.read',
|
|
53
|
+
'tenant.scim-token.manage',
|
|
54
|
+
'tenant.billing.read',
|
|
55
|
+
'tenant.billing.manage',
|
|
56
|
+
'tenant.alert.read',
|
|
57
|
+
'tenant.alert.manage',
|
|
58
|
+
];
|
|
59
|
+
export const delegableTenantCapabilities = [
|
|
60
|
+
'tenant.organization.read',
|
|
61
|
+
'tenant.organization.manage',
|
|
62
|
+
'tenant.organization.export',
|
|
63
|
+
'tenant.role.read',
|
|
64
|
+
'tenant.role.manage',
|
|
65
|
+
'tenant.membership.read',
|
|
66
|
+
'tenant.membership.manage',
|
|
67
|
+
'tenant.app-connection.read',
|
|
68
|
+
'tenant.app-connection.manage',
|
|
69
|
+
'tenant.sso.read',
|
|
70
|
+
'tenant.sso.manage',
|
|
71
|
+
'tenant.scim-token.read',
|
|
72
|
+
'tenant.scim-token.manage',
|
|
73
|
+
'tenant.billing.read',
|
|
74
|
+
'tenant.billing.manage',
|
|
75
|
+
'tenant.alert.read',
|
|
76
|
+
'tenant.alert.manage',
|
|
77
|
+
];
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2RhdGEvYXV0aG9yaXphdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxrQkFBa0IsR0FBRztJQUNoQyx5QkFBeUI7SUFDekIsMkJBQTJCO0lBQzNCLDBCQUEwQjtJQUMxQiw0QkFBNEI7SUFDNUIsbUJBQW1CO0lBQ25CLHFCQUFxQjtJQUNyQixrQkFBa0I7SUFDbEIsb0JBQW9CO0lBQ3BCLG9CQUFvQjtJQUNwQixxQkFBcUI7SUFDckIsMkJBQTJCO0lBQzNCLDRCQUE0QjtJQUM1Qiw0QkFBNEI7Q0FDcEIsQ0FBQztBQUlYLE1BQU0sQ0FBQyxNQUFNLDJCQUEyQixHQUFHO0lBQ3pDLHlCQUF5QjtJQUN6QiwyQkFBMkI7SUFDM0IsMEJBQTBCO0lBQzFCLDRCQUE0QjtJQUM1QixtQkFBbUI7SUFDbkIscUJBQXFCO0lBQ3JCLGtCQUFrQjtJQUNsQixvQkFBb0I7SUFDcEIsNEJBQTRCO0NBQ21CLENBQUM7QUFLbEQ7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxNQUFNLG9DQUFvQyxHQUFHO0lBQ2xELDJCQUEyQjtJQUMzQiw0QkFBNEI7SUFDNUIscUJBQXFCO0lBQ3JCLG9CQUFvQjtDQUMyQixDQUFDO0FBS2xELE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHO0lBQ2hDLDBCQUEwQjtJQUMxQiw0QkFBNEI7SUFDNUIsNEJBQTRCO0lBQzVCLDRCQUE0QjtJQUM1QixrQkFBa0I7SUFDbEIsb0JBQW9CO0lBQ3BCLHdCQUF3QjtJQUN4QiwwQkFBMEI7SUFDMUIsMkJBQTJCO0lBQzNCLDRCQUE0QjtJQUM1Qiw4QkFBOEI7SUFDOUIsaUJBQWlCO0lBQ2pCLG1CQUFtQjtJQUNuQix3QkFBd0I7SUFDeEIsMEJBQTBCO0lBQzFCLHFCQUFxQjtJQUNyQix1QkFBdUI7SUFDdkIsbUJBQW1CO0lBQ25CLHFCQUFxQjtDQUNiLENBQUM7QUFJWCxNQUFNLENBQUMsTUFBTSwyQkFBMkIsR0FBRztJQUN6QywwQkFBMEI7SUFDMUIsNEJBQTRCO0lBQzVCLDRCQUE0QjtJQUM1QixrQkFBa0I7SUFDbEIsb0JBQW9CO0lBQ3BCLHdCQUF3QjtJQUN4QiwwQkFBMEI7SUFDMUIsNEJBQTRCO0lBQzVCLDhCQUE4QjtJQUM5QixpQkFBaUI7SUFDakIsbUJBQW1CO0lBQ25CLHdCQUF3QjtJQUN4QiwwQkFBMEI7SUFDMUIscUJBQXFCO0lBQ3JCLHVCQUF1QjtJQUN2QixtQkFBbUI7SUFDbkIscUJBQXFCO0NBQzBCLENBQUMifQ==
|
package/dist_ts/data/index.d.ts
CHANGED
package/dist_ts/data/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './activity.js';
|
|
|
3
3
|
export * from './alert.js';
|
|
4
4
|
export * from './alertrule.js';
|
|
5
5
|
export * from './app.js';
|
|
6
|
+
export * from './authorization.js';
|
|
6
7
|
export * from './emailactiontoken.js';
|
|
7
8
|
export * from './oidc.js';
|
|
8
9
|
export * from './appconnection.js';
|
|
@@ -23,4 +24,4 @@ export * from './user.js';
|
|
|
23
24
|
export * from './userinvitation.js';
|
|
24
25
|
export * from './ssoconnection.js';
|
|
25
26
|
export * from './scim.js';
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kYXRhL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsV0FBVyxDQUFDIn0=
|
package/dist_ts/data/role.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { TDelegableTenantCapability } from './authorization.js';
|
|
1
2
|
/** Standard role types available in all organizations */
|
|
2
3
|
export type TStandardRole = 'owner' | 'admin' | 'editor' | 'guest' | 'viewer' | 'outlaw';
|
|
3
4
|
export interface IOrgRoleDefinition {
|
|
4
5
|
key: string;
|
|
5
6
|
name: string;
|
|
6
7
|
description?: string | null;
|
|
8
|
+
/** Sorted, explicit capabilities granted by this customer-defined role. */
|
|
9
|
+
capabilities: TDelegableTenantCapability[];
|
|
7
10
|
createdAt: number;
|
|
8
11
|
updatedAt: number;
|
|
9
12
|
}
|
package/dist_ts/data/user.d.ts
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
import type { TBreakGlassEligibleGlobalCapability, TDelegableGlobalCapability } from './authorization.js';
|
|
2
|
+
export type TBreakGlassJustificationCode = 'access_recovery' | 'security_incident' | 'service_outage';
|
|
3
|
+
export type TBreakGlassReviewOutcome = 'confirmed' | 'escalated';
|
|
4
|
+
interface IBreakGlassAccessBase {
|
|
5
|
+
operationId: string;
|
|
6
|
+
capabilities: TBreakGlassEligibleGlobalCapability[];
|
|
7
|
+
justificationCode: TBreakGlassJustificationCode;
|
|
8
|
+
requestedAt: number;
|
|
9
|
+
approvalExpiresAt: number;
|
|
10
|
+
activationDurationSeconds: number;
|
|
11
|
+
}
|
|
12
|
+
export type TBreakGlassAccess = IBreakGlassAccessBase & ({
|
|
13
|
+
status: 'pending';
|
|
14
|
+
} | {
|
|
15
|
+
status: 'active';
|
|
16
|
+
approvedByUserRef: string;
|
|
17
|
+
approvedAt: number;
|
|
18
|
+
activeUntil: number;
|
|
19
|
+
firstUsedAt: number | null;
|
|
20
|
+
} | {
|
|
21
|
+
status: 'reviewed';
|
|
22
|
+
approvedByUserRef: string;
|
|
23
|
+
approvedAt: number;
|
|
24
|
+
activeUntil: number;
|
|
25
|
+
firstUsedAt: number | null;
|
|
26
|
+
reviewedByUserRef: string;
|
|
27
|
+
reviewedAt: number;
|
|
28
|
+
reviewOutcome: TBreakGlassReviewOutcome;
|
|
29
|
+
});
|
|
1
30
|
export interface IUser {
|
|
2
31
|
id: string;
|
|
3
32
|
data: {
|
|
@@ -35,6 +64,13 @@ export interface IUser {
|
|
|
35
64
|
* to manage global apps, view platform stats, etc.
|
|
36
65
|
*/
|
|
37
66
|
isGlobalAdmin?: boolean | null;
|
|
67
|
+
/** Sorted, explicit platform capabilities for a non-administrator. */
|
|
68
|
+
globalCapabilities?: TDelegableGlobalCapability[] | null;
|
|
69
|
+
/**
|
|
70
|
+
* Current break-glass request/grant state. Active authority is always
|
|
71
|
+
* time-bounded and a reviewed record is retained until the next request.
|
|
72
|
+
*/
|
|
73
|
+
breakGlassAccess?: TBreakGlassAccess | null;
|
|
38
74
|
/**
|
|
39
75
|
* Links to external identities established via enterprise SSO.
|
|
40
76
|
* One entry per SSO connection the user has signed in through.
|
|
@@ -47,3 +83,4 @@ export interface IUser {
|
|
|
47
83
|
}[] | null;
|
|
48
84
|
};
|
|
49
85
|
}
|
|
86
|
+
export {};
|
|
@@ -24,7 +24,7 @@ export type TActivityEventDto = TActivityEventFor<'login', 'account', {
|
|
|
24
24
|
roleChange: TActivityRoleChange;
|
|
25
25
|
}> | TActivityEventFor<'org_app_role_mappings_updated', 'organization_role_mapping', null> | TActivityEventFor<'profile_updated', 'profile', null> | TActivityEventFor<'totp_enabled', 'mfa_method', null> | TActivityEventFor<'totp_disabled', 'mfa_method', null> | TActivityEventFor<'backup_codes_regenerated', 'mfa_method', null> | TActivityEventFor<'mfa_completed', 'mfa_method', {
|
|
26
26
|
factor: TActivityMfaFactor;
|
|
27
|
-
}> | TActivityEventFor<'passkey_registered', 'passkey', null> | TActivityEventFor<'passkey_revoked', 'passkey', null> | TActivityEventFor<'passkey_login', 'passkey', null> | TActivityEventFor<'app_connected', 'application_connection', null> | TActivityEventFor<'app_disconnected', 'application_connection', null> | TActivityEventFor<'user_suspended', 'account', null> | TActivityEventFor<'user_unsuspended', 'account', null> | TActivityEventFor<'global_admin_granted', 'account', null> | TActivityEventFor<'global_admin_removed', 'account', null> | TActivityEventFor<'account_deletion_requested', 'account', null> | TActivityEventFor<'account_deletion_cancelled', 'account', null> | TActivityEventFor<'account_purged', 'account', null> | TActivityEventFor<'sso_connection_created', 'sso_connection', {
|
|
27
|
+
}> | TActivityEventFor<'passkey_registered', 'passkey', null> | TActivityEventFor<'passkey_revoked', 'passkey', null> | TActivityEventFor<'passkey_login', 'passkey', null> | TActivityEventFor<'app_connected', 'application_connection', null> | TActivityEventFor<'app_disconnected', 'application_connection', null> | TActivityEventFor<'user_suspended', 'account', null> | TActivityEventFor<'user_unsuspended', 'account', null> | TActivityEventFor<'global_admin_granted', 'account', null> | TActivityEventFor<'global_admin_removed', 'account', null> | TActivityEventFor<'global_capabilities_changed', 'account', null> | TActivityEventFor<'break_glass_requested', 'break_glass_access', null> | TActivityEventFor<'break_glass_activated', 'break_glass_access', null> | TActivityEventFor<'break_glass_used', 'break_glass_access', null> | TActivityEventFor<'break_glass_reviewed', 'break_glass_access', null> | TActivityEventFor<'account_deletion_requested', 'account', null> | TActivityEventFor<'account_deletion_cancelled', 'account', null> | TActivityEventFor<'account_purged', 'account', null> | TActivityEventFor<'sso_connection_created', 'sso_connection', {
|
|
28
28
|
protocol: 'saml';
|
|
29
29
|
}> | TActivityEventFor<'sso_connection_updated', 'sso_connection', {
|
|
30
30
|
protocol: 'saml';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { IUserDto } from './user.js';
|
|
2
|
+
import type { TDelegableTenantCapability } from '../data/authorization.js';
|
|
2
3
|
export interface IOrgRoleDefinitionDto {
|
|
3
4
|
key: string;
|
|
4
5
|
name: string;
|
|
5
6
|
description?: string;
|
|
7
|
+
capabilities: TDelegableTenantCapability[];
|
|
6
8
|
createdAt: number;
|
|
7
9
|
updatedAt: number;
|
|
8
10
|
}
|
package/dist_ts/dto/user.d.ts
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
import type { TBreakGlassEligibleGlobalCapability, TDelegableGlobalCapability } from '../data/authorization.js';
|
|
2
|
+
import type { TBreakGlassJustificationCode, TBreakGlassReviewOutcome } from '../data/user.js';
|
|
3
|
+
interface IBreakGlassAccessDtoBase {
|
|
4
|
+
operationId: string;
|
|
5
|
+
capabilities: TBreakGlassEligibleGlobalCapability[];
|
|
6
|
+
justificationCode: TBreakGlassJustificationCode;
|
|
7
|
+
requestedAt: number;
|
|
8
|
+
approvalExpiresAt: number;
|
|
9
|
+
activationDurationSeconds: number;
|
|
10
|
+
}
|
|
11
|
+
export type TBreakGlassAccessDto = IBreakGlassAccessDtoBase & ({
|
|
12
|
+
status: 'pending';
|
|
13
|
+
} | {
|
|
14
|
+
status: 'active' | 'expired';
|
|
15
|
+
approvedAt: number;
|
|
16
|
+
activeUntil: number;
|
|
17
|
+
firstUsedAt: number | null;
|
|
18
|
+
} | {
|
|
19
|
+
status: 'reviewed';
|
|
20
|
+
approvedAt: number;
|
|
21
|
+
activeUntil: number;
|
|
22
|
+
firstUsedAt: number | null;
|
|
23
|
+
reviewedAt: number;
|
|
24
|
+
reviewOutcome: TBreakGlassReviewOutcome;
|
|
25
|
+
});
|
|
1
26
|
export interface IUserDataDto {
|
|
2
27
|
name: string;
|
|
3
28
|
username: string;
|
|
@@ -6,6 +31,9 @@ export interface IUserDataDto {
|
|
|
6
31
|
status: 'new' | 'active' | 'deleted' | 'suspended';
|
|
7
32
|
connectedOrgs: string[];
|
|
8
33
|
isGlobalAdmin?: boolean;
|
|
34
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
35
|
+
/** Current public-safe break-glass state, without custody references. */
|
|
36
|
+
breakGlassAccess?: TBreakGlassAccessDto | null;
|
|
9
37
|
}
|
|
10
38
|
export interface IUserDto {
|
|
11
39
|
id: string;
|
|
@@ -36,8 +64,13 @@ export interface IGlobalUserAdminDto {
|
|
|
36
64
|
email: string;
|
|
37
65
|
status: IUserDataDto['status'];
|
|
38
66
|
isGlobalAdmin: boolean;
|
|
67
|
+
/** Sorted direct assignments; empty for global administrators. */
|
|
68
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
69
|
+
/** Current public-safe break-glass request/grant/review state. */
|
|
70
|
+
breakGlassAccess: TBreakGlassAccessDto | null;
|
|
39
71
|
/** number of organizations the user belongs to */
|
|
40
72
|
orgCount: number;
|
|
41
73
|
/** epoch ms; derived for accounts created before this field existed */
|
|
42
74
|
createdAt: number;
|
|
43
75
|
}
|
|
76
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as data from '../data/index.js';
|
|
2
3
|
import * as dto from '../dto/index.js';
|
|
3
4
|
export type TSecretDeliveryAlgorithm = 'RSA-OAEP-256';
|
|
4
5
|
/** Caller-held RSA public key used to seal one-time secret material. */
|
|
@@ -267,6 +268,79 @@ export interface IReq_SetGlobalAdmin extends plugins.typedRequestInterfaces.impl
|
|
|
267
268
|
user: dto.IGlobalUserAdminDto;
|
|
268
269
|
};
|
|
269
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Replace the direct, delegable platform capabilities of a non-administrator.
|
|
273
|
+
* Non-delegable administrator, deletion, signing-key, and approval authority
|
|
274
|
+
* cannot cross this contract.
|
|
275
|
+
*/
|
|
276
|
+
export interface IReq_SetGlobalCapabilityAssignments extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_SetGlobalCapabilityAssignments> {
|
|
277
|
+
method: 'setGlobalCapabilityAssignments';
|
|
278
|
+
request: {
|
|
279
|
+
jwt: string;
|
|
280
|
+
/** Caller-stable idempotency key for one exact replacement. */
|
|
281
|
+
operationId: string;
|
|
282
|
+
userId: string;
|
|
283
|
+
/** Exact current User revision the caller reviewed. */
|
|
284
|
+
expectedUserRevision: number;
|
|
285
|
+
capabilities: data.TDelegableGlobalCapability[];
|
|
286
|
+
};
|
|
287
|
+
response: {
|
|
288
|
+
user: dto.IGlobalUserAdminDto;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Request narrow, temporary platform authority for the authenticated user.
|
|
293
|
+
* Approval by a distinct administrator is required before authority becomes
|
|
294
|
+
* active.
|
|
295
|
+
*/
|
|
296
|
+
export interface IReq_RequestBreakGlassAccess extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_RequestBreakGlassAccess> {
|
|
297
|
+
method: 'requestBreakGlassAccess';
|
|
298
|
+
request: {
|
|
299
|
+
jwt: string;
|
|
300
|
+
operationId: string;
|
|
301
|
+
/** Exact current revision of the authenticated User. */
|
|
302
|
+
expectedUserRevision: number;
|
|
303
|
+
capabilities: data.TBreakGlassEligibleGlobalCapability[];
|
|
304
|
+
justificationCode: data.TBreakGlassJustificationCode;
|
|
305
|
+
/** Requested active lifetime, from 60 through 1800 seconds. */
|
|
306
|
+
activationDurationSeconds: number;
|
|
307
|
+
};
|
|
308
|
+
response: {
|
|
309
|
+
user: dto.IGlobalUserAdminDto;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
/** Approve a pending break-glass request from a different user. */
|
|
313
|
+
export interface IReq_ApproveBreakGlassAccess extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_ApproveBreakGlassAccess> {
|
|
314
|
+
method: 'approveBreakGlassAccess';
|
|
315
|
+
request: {
|
|
316
|
+
jwt: string;
|
|
317
|
+
operationId: string;
|
|
318
|
+
userId: string;
|
|
319
|
+
/** Exact current revision of the requesting User. */
|
|
320
|
+
expectedUserRevision: number;
|
|
321
|
+
};
|
|
322
|
+
response: {
|
|
323
|
+
user: dto.IGlobalUserAdminDto;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Close an expired (or deliberately terminated) break-glass grant with a
|
|
328
|
+
* durable post-use review outcome. Calling this before expiry ends access.
|
|
329
|
+
*/
|
|
330
|
+
export interface IReq_ReviewBreakGlassAccess extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_ReviewBreakGlassAccess> {
|
|
331
|
+
method: 'reviewBreakGlassAccess';
|
|
332
|
+
request: {
|
|
333
|
+
jwt: string;
|
|
334
|
+
operationId: string;
|
|
335
|
+
userId: string;
|
|
336
|
+
/** Exact current revision of the requesting User. */
|
|
337
|
+
expectedUserRevision: number;
|
|
338
|
+
reviewOutcome: data.TBreakGlassReviewOutcome;
|
|
339
|
+
};
|
|
340
|
+
response: {
|
|
341
|
+
user: dto.IGlobalUserAdminDto;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
270
344
|
/**
|
|
271
345
|
* Platform-wide organization directory with member counts (admin only)
|
|
272
346
|
*/
|
package/dist_ts/request/admin.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as data from '../data/index.js';
|
|
2
3
|
import * as dto from '../dto/index.js';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRtaW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0L2FkbWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sS0FBSyxJQUFJLE1BQU0sa0JBQWtCLENBQUM7QUFDekMsT0FBTyxLQUFLLEdBQUcsTUFBTSxpQkFBaUIsQ0FBQyJ9
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
1
2
|
import * as dto from '../dto/index.js';
|
|
2
3
|
import * as plugins from '../plugins.js';
|
|
3
4
|
export interface IReq_GetOrganizationById extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetOrganizationById> {
|
|
@@ -72,6 +73,7 @@ export interface IReq_UpsertOrgRoleDefinition extends plugins.typedRequestInterf
|
|
|
72
73
|
key: string;
|
|
73
74
|
name: string;
|
|
74
75
|
description?: string;
|
|
76
|
+
capabilities: data.TDelegableTenantCapability[];
|
|
75
77
|
};
|
|
76
78
|
};
|
|
77
79
|
response: {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -68,6 +68,14 @@ retries reconcile one durable attempt without overwriting a newer decision.
|
|
|
68
68
|
and mutation responses.
|
|
69
69
|
Grant/removal attempt and result events use the closed `global_admin_granted`
|
|
70
70
|
and `global_admin_removed` activity actions.
|
|
71
|
+
|
|
72
|
+
The authorization data contract exports the complete global and tenant
|
|
73
|
+
capability sets plus the narrower delegable subsets. Direct platform
|
|
74
|
+
assignments use `setGlobalCapabilityAssignments`, an exact User revision, and
|
|
75
|
+
a caller-stable operation id. Customer-defined organization roles carry a
|
|
76
|
+
sorted `capabilities` list; tenant deletion and ownership transfer remain
|
|
77
|
+
reserved to the built-in owner role.
|
|
78
|
+
|
|
71
79
|
The target hash is derived server-side from the canonical, authorized
|
|
72
80
|
`ITransferTarget.appUrl`; the raw target URL is never persisted in session
|
|
73
81
|
data. Opaque tokens and the transfer target remain limited to the request and
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/activity.ts
CHANGED
|
@@ -29,6 +29,11 @@ export type TActivityAction =
|
|
|
29
29
|
| 'user_unsuspended'
|
|
30
30
|
| 'global_admin_granted'
|
|
31
31
|
| 'global_admin_removed'
|
|
32
|
+
| 'global_capabilities_changed'
|
|
33
|
+
| 'break_glass_requested'
|
|
34
|
+
| 'break_glass_activated'
|
|
35
|
+
| 'break_glass_used'
|
|
36
|
+
| 'break_glass_reviewed'
|
|
32
37
|
| 'account_deletion_requested'
|
|
33
38
|
| 'account_deletion_cancelled'
|
|
34
39
|
| 'account_purged'
|
|
@@ -84,6 +89,7 @@ export type TActivityReasonCode =
|
|
|
84
89
|
export type TActivityTargetType =
|
|
85
90
|
| 'account'
|
|
86
91
|
| 'application_connection'
|
|
92
|
+
| 'break_glass_access'
|
|
87
93
|
| 'mfa_method'
|
|
88
94
|
| 'oidc_authorization'
|
|
89
95
|
| 'oidc_client'
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export const globalCapabilities = [
|
|
2
|
+
'global.oidc-client.read',
|
|
3
|
+
'global.oidc-client.manage',
|
|
4
|
+
'global.organization.read',
|
|
5
|
+
'global.organization.manage',
|
|
6
|
+
'global.alert.read',
|
|
7
|
+
'global.alert.manage',
|
|
8
|
+
'global.user.read',
|
|
9
|
+
'global.user.manage',
|
|
10
|
+
'global.user.delete',
|
|
11
|
+
'global.admin.manage',
|
|
12
|
+
'global.signing-key.rotate',
|
|
13
|
+
'global.break-glass.request',
|
|
14
|
+
'global.break-glass.approve',
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
export type TGlobalCapability = (typeof globalCapabilities)[number];
|
|
18
|
+
|
|
19
|
+
export const delegableGlobalCapabilities = [
|
|
20
|
+
'global.oidc-client.read',
|
|
21
|
+
'global.oidc-client.manage',
|
|
22
|
+
'global.organization.read',
|
|
23
|
+
'global.organization.manage',
|
|
24
|
+
'global.alert.read',
|
|
25
|
+
'global.alert.manage',
|
|
26
|
+
'global.user.read',
|
|
27
|
+
'global.user.manage',
|
|
28
|
+
'global.break-glass.request',
|
|
29
|
+
] as const satisfies readonly TGlobalCapability[];
|
|
30
|
+
|
|
31
|
+
export type TDelegableGlobalCapability =
|
|
32
|
+
(typeof delegableGlobalCapabilities)[number];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Capabilities that may be activated temporarily through the two-person
|
|
36
|
+
* break-glass protocol. Authority to delete accounts, manage administrators,
|
|
37
|
+
* rotate signing keys, or approve break-glass access is never eligible.
|
|
38
|
+
*/
|
|
39
|
+
export const breakGlassEligibleGlobalCapabilities = [
|
|
40
|
+
'global.oidc-client.manage',
|
|
41
|
+
'global.organization.manage',
|
|
42
|
+
'global.alert.manage',
|
|
43
|
+
'global.user.manage',
|
|
44
|
+
] as const satisfies readonly TGlobalCapability[];
|
|
45
|
+
|
|
46
|
+
export type TBreakGlassEligibleGlobalCapability =
|
|
47
|
+
(typeof breakGlassEligibleGlobalCapabilities)[number];
|
|
48
|
+
|
|
49
|
+
export const tenantCapabilities = [
|
|
50
|
+
'tenant.organization.read',
|
|
51
|
+
'tenant.organization.manage',
|
|
52
|
+
'tenant.organization.delete',
|
|
53
|
+
'tenant.organization.export',
|
|
54
|
+
'tenant.role.read',
|
|
55
|
+
'tenant.role.manage',
|
|
56
|
+
'tenant.membership.read',
|
|
57
|
+
'tenant.membership.manage',
|
|
58
|
+
'tenant.ownership.transfer',
|
|
59
|
+
'tenant.app-connection.read',
|
|
60
|
+
'tenant.app-connection.manage',
|
|
61
|
+
'tenant.sso.read',
|
|
62
|
+
'tenant.sso.manage',
|
|
63
|
+
'tenant.scim-token.read',
|
|
64
|
+
'tenant.scim-token.manage',
|
|
65
|
+
'tenant.billing.read',
|
|
66
|
+
'tenant.billing.manage',
|
|
67
|
+
'tenant.alert.read',
|
|
68
|
+
'tenant.alert.manage',
|
|
69
|
+
] as const;
|
|
70
|
+
|
|
71
|
+
export type TTenantCapability = (typeof tenantCapabilities)[number];
|
|
72
|
+
|
|
73
|
+
export const delegableTenantCapabilities = [
|
|
74
|
+
'tenant.organization.read',
|
|
75
|
+
'tenant.organization.manage',
|
|
76
|
+
'tenant.organization.export',
|
|
77
|
+
'tenant.role.read',
|
|
78
|
+
'tenant.role.manage',
|
|
79
|
+
'tenant.membership.read',
|
|
80
|
+
'tenant.membership.manage',
|
|
81
|
+
'tenant.app-connection.read',
|
|
82
|
+
'tenant.app-connection.manage',
|
|
83
|
+
'tenant.sso.read',
|
|
84
|
+
'tenant.sso.manage',
|
|
85
|
+
'tenant.scim-token.read',
|
|
86
|
+
'tenant.scim-token.manage',
|
|
87
|
+
'tenant.billing.read',
|
|
88
|
+
'tenant.billing.manage',
|
|
89
|
+
'tenant.alert.read',
|
|
90
|
+
'tenant.alert.manage',
|
|
91
|
+
] as const satisfies readonly TTenantCapability[];
|
|
92
|
+
|
|
93
|
+
export type TDelegableTenantCapability =
|
|
94
|
+
(typeof delegableTenantCapabilities)[number];
|
package/ts/data/index.ts
CHANGED
package/ts/data/role.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
+
import type { TDelegableTenantCapability } from './authorization.js';
|
|
2
3
|
|
|
3
4
|
/** Standard role types available in all organizations */
|
|
4
5
|
export type TStandardRole = 'owner' | 'admin' | 'editor' | 'guest' | 'viewer' | 'outlaw';
|
|
@@ -7,6 +8,8 @@ export interface IOrgRoleDefinition {
|
|
|
7
8
|
key: string;
|
|
8
9
|
name: string;
|
|
9
10
|
description?: string | null;
|
|
11
|
+
/** Sorted, explicit capabilities granted by this customer-defined role. */
|
|
12
|
+
capabilities: TDelegableTenantCapability[];
|
|
10
13
|
createdAt: number;
|
|
11
14
|
updatedAt: number;
|
|
12
15
|
}
|
package/ts/data/user.ts
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import { type IRole } from './role.js';
|
|
3
|
+
import type {
|
|
4
|
+
TBreakGlassEligibleGlobalCapability,
|
|
5
|
+
TDelegableGlobalCapability,
|
|
6
|
+
} from './authorization.js';
|
|
7
|
+
|
|
8
|
+
export type TBreakGlassJustificationCode =
|
|
9
|
+
| 'access_recovery'
|
|
10
|
+
| 'security_incident'
|
|
11
|
+
| 'service_outage';
|
|
12
|
+
|
|
13
|
+
export type TBreakGlassReviewOutcome = 'confirmed' | 'escalated';
|
|
14
|
+
|
|
15
|
+
interface IBreakGlassAccessBase {
|
|
16
|
+
operationId: string;
|
|
17
|
+
capabilities: TBreakGlassEligibleGlobalCapability[];
|
|
18
|
+
justificationCode: TBreakGlassJustificationCode;
|
|
19
|
+
requestedAt: number;
|
|
20
|
+
approvalExpiresAt: number;
|
|
21
|
+
activationDurationSeconds: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type TBreakGlassAccess = IBreakGlassAccessBase & (
|
|
25
|
+
| {
|
|
26
|
+
status: 'pending';
|
|
27
|
+
}
|
|
28
|
+
| {
|
|
29
|
+
status: 'active';
|
|
30
|
+
approvedByUserRef: string;
|
|
31
|
+
approvedAt: number;
|
|
32
|
+
activeUntil: number;
|
|
33
|
+
firstUsedAt: number | null;
|
|
34
|
+
}
|
|
35
|
+
| {
|
|
36
|
+
status: 'reviewed';
|
|
37
|
+
approvedByUserRef: string;
|
|
38
|
+
approvedAt: number;
|
|
39
|
+
activeUntil: number;
|
|
40
|
+
firstUsedAt: number | null;
|
|
41
|
+
reviewedByUserRef: string;
|
|
42
|
+
reviewedAt: number;
|
|
43
|
+
reviewOutcome: TBreakGlassReviewOutcome;
|
|
44
|
+
}
|
|
45
|
+
);
|
|
3
46
|
|
|
4
47
|
export interface IUser {
|
|
5
48
|
id: string;
|
|
@@ -39,6 +82,13 @@ export interface IUser {
|
|
|
39
82
|
* to manage global apps, view platform stats, etc.
|
|
40
83
|
*/
|
|
41
84
|
isGlobalAdmin?: boolean | null;
|
|
85
|
+
/** Sorted, explicit platform capabilities for a non-administrator. */
|
|
86
|
+
globalCapabilities?: TDelegableGlobalCapability[] | null;
|
|
87
|
+
/**
|
|
88
|
+
* Current break-glass request/grant state. Active authority is always
|
|
89
|
+
* time-bounded and a reviewed record is retained until the next request.
|
|
90
|
+
*/
|
|
91
|
+
breakGlassAccess?: TBreakGlassAccess | null;
|
|
42
92
|
/**
|
|
43
93
|
* Links to external identities established via enterprise SSO.
|
|
44
94
|
* One entry per SSO connection the user has signed in through.
|
package/ts/dto/activity.ts
CHANGED
|
@@ -77,6 +77,11 @@ export type TActivityEventDto =
|
|
|
77
77
|
| TActivityEventFor<'user_unsuspended', 'account', null>
|
|
78
78
|
| TActivityEventFor<'global_admin_granted', 'account', null>
|
|
79
79
|
| TActivityEventFor<'global_admin_removed', 'account', null>
|
|
80
|
+
| TActivityEventFor<'global_capabilities_changed', 'account', null>
|
|
81
|
+
| TActivityEventFor<'break_glass_requested', 'break_glass_access', null>
|
|
82
|
+
| TActivityEventFor<'break_glass_activated', 'break_glass_access', null>
|
|
83
|
+
| TActivityEventFor<'break_glass_used', 'break_glass_access', null>
|
|
84
|
+
| TActivityEventFor<'break_glass_reviewed', 'break_glass_access', null>
|
|
80
85
|
| TActivityEventFor<'account_deletion_requested', 'account', null>
|
|
81
86
|
| TActivityEventFor<'account_deletion_cancelled', 'account', null>
|
|
82
87
|
| TActivityEventFor<'account_purged', 'account', null>
|
package/ts/dto/organization.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { IUserDto } from './user.js';
|
|
2
|
+
import type { TDelegableTenantCapability } from '../data/authorization.js';
|
|
2
3
|
|
|
3
4
|
export interface IOrgRoleDefinitionDto {
|
|
4
5
|
key: string;
|
|
5
6
|
name: string;
|
|
6
7
|
description?: string;
|
|
8
|
+
capabilities: TDelegableTenantCapability[];
|
|
7
9
|
createdAt: number;
|
|
8
10
|
updatedAt: number;
|
|
9
11
|
}
|
package/ts/dto/user.ts
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TBreakGlassEligibleGlobalCapability,
|
|
3
|
+
TDelegableGlobalCapability,
|
|
4
|
+
} from '../data/authorization.js';
|
|
5
|
+
import type {
|
|
6
|
+
TBreakGlassJustificationCode,
|
|
7
|
+
TBreakGlassReviewOutcome,
|
|
8
|
+
} from '../data/user.js';
|
|
9
|
+
|
|
10
|
+
interface IBreakGlassAccessDtoBase {
|
|
11
|
+
operationId: string;
|
|
12
|
+
capabilities: TBreakGlassEligibleGlobalCapability[];
|
|
13
|
+
justificationCode: TBreakGlassJustificationCode;
|
|
14
|
+
requestedAt: number;
|
|
15
|
+
approvalExpiresAt: number;
|
|
16
|
+
activationDurationSeconds: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type TBreakGlassAccessDto = IBreakGlassAccessDtoBase & (
|
|
20
|
+
| { status: 'pending' }
|
|
21
|
+
| {
|
|
22
|
+
status: 'active' | 'expired';
|
|
23
|
+
approvedAt: number;
|
|
24
|
+
activeUntil: number;
|
|
25
|
+
firstUsedAt: number | null;
|
|
26
|
+
}
|
|
27
|
+
| {
|
|
28
|
+
status: 'reviewed';
|
|
29
|
+
approvedAt: number;
|
|
30
|
+
activeUntil: number;
|
|
31
|
+
firstUsedAt: number | null;
|
|
32
|
+
reviewedAt: number;
|
|
33
|
+
reviewOutcome: TBreakGlassReviewOutcome;
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
|
|
1
37
|
export interface IUserDataDto {
|
|
2
38
|
name: string;
|
|
3
39
|
username: string;
|
|
@@ -6,6 +42,9 @@ export interface IUserDataDto {
|
|
|
6
42
|
status: 'new' | 'active' | 'deleted' | 'suspended';
|
|
7
43
|
connectedOrgs: string[];
|
|
8
44
|
isGlobalAdmin?: boolean;
|
|
45
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
46
|
+
/** Current public-safe break-glass state, without custody references. */
|
|
47
|
+
breakGlassAccess?: TBreakGlassAccessDto | null;
|
|
9
48
|
}
|
|
10
49
|
|
|
11
50
|
export interface IUserDto {
|
|
@@ -39,6 +78,10 @@ export interface IGlobalUserAdminDto {
|
|
|
39
78
|
email: string;
|
|
40
79
|
status: IUserDataDto['status'];
|
|
41
80
|
isGlobalAdmin: boolean;
|
|
81
|
+
/** Sorted direct assignments; empty for global administrators. */
|
|
82
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
83
|
+
/** Current public-safe break-glass request/grant/review state. */
|
|
84
|
+
breakGlassAccess: TBreakGlassAccessDto | null;
|
|
42
85
|
/** number of organizations the user belongs to */
|
|
43
86
|
orgCount: number;
|
|
44
87
|
/** epoch ms; derived for accounts created before this field existed */
|
package/ts/request/admin.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as data from '../data/index.js';
|
|
2
3
|
import * as dto from '../dto/index.js';
|
|
3
4
|
|
|
4
5
|
export type TSecretDeliveryAlgorithm = 'RSA-OAEP-256';
|
|
@@ -344,6 +345,99 @@ export interface IReq_SetGlobalAdmin
|
|
|
344
345
|
};
|
|
345
346
|
}
|
|
346
347
|
|
|
348
|
+
/**
|
|
349
|
+
* Replace the direct, delegable platform capabilities of a non-administrator.
|
|
350
|
+
* Non-delegable administrator, deletion, signing-key, and approval authority
|
|
351
|
+
* cannot cross this contract.
|
|
352
|
+
*/
|
|
353
|
+
export interface IReq_SetGlobalCapabilityAssignments
|
|
354
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
355
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
356
|
+
IReq_SetGlobalCapabilityAssignments
|
|
357
|
+
> {
|
|
358
|
+
method: 'setGlobalCapabilityAssignments';
|
|
359
|
+
request: {
|
|
360
|
+
jwt: string;
|
|
361
|
+
/** Caller-stable idempotency key for one exact replacement. */
|
|
362
|
+
operationId: string;
|
|
363
|
+
userId: string;
|
|
364
|
+
/** Exact current User revision the caller reviewed. */
|
|
365
|
+
expectedUserRevision: number;
|
|
366
|
+
capabilities: data.TDelegableGlobalCapability[];
|
|
367
|
+
};
|
|
368
|
+
response: {
|
|
369
|
+
user: dto.IGlobalUserAdminDto;
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Request narrow, temporary platform authority for the authenticated user.
|
|
375
|
+
* Approval by a distinct administrator is required before authority becomes
|
|
376
|
+
* active.
|
|
377
|
+
*/
|
|
378
|
+
export interface IReq_RequestBreakGlassAccess
|
|
379
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
380
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
381
|
+
IReq_RequestBreakGlassAccess
|
|
382
|
+
> {
|
|
383
|
+
method: 'requestBreakGlassAccess';
|
|
384
|
+
request: {
|
|
385
|
+
jwt: string;
|
|
386
|
+
operationId: string;
|
|
387
|
+
/** Exact current revision of the authenticated User. */
|
|
388
|
+
expectedUserRevision: number;
|
|
389
|
+
capabilities: data.TBreakGlassEligibleGlobalCapability[];
|
|
390
|
+
justificationCode: data.TBreakGlassJustificationCode;
|
|
391
|
+
/** Requested active lifetime, from 60 through 1800 seconds. */
|
|
392
|
+
activationDurationSeconds: number;
|
|
393
|
+
};
|
|
394
|
+
response: {
|
|
395
|
+
user: dto.IGlobalUserAdminDto;
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** Approve a pending break-glass request from a different user. */
|
|
400
|
+
export interface IReq_ApproveBreakGlassAccess
|
|
401
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
402
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
403
|
+
IReq_ApproveBreakGlassAccess
|
|
404
|
+
> {
|
|
405
|
+
method: 'approveBreakGlassAccess';
|
|
406
|
+
request: {
|
|
407
|
+
jwt: string;
|
|
408
|
+
operationId: string;
|
|
409
|
+
userId: string;
|
|
410
|
+
/** Exact current revision of the requesting User. */
|
|
411
|
+
expectedUserRevision: number;
|
|
412
|
+
};
|
|
413
|
+
response: {
|
|
414
|
+
user: dto.IGlobalUserAdminDto;
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Close an expired (or deliberately terminated) break-glass grant with a
|
|
420
|
+
* durable post-use review outcome. Calling this before expiry ends access.
|
|
421
|
+
*/
|
|
422
|
+
export interface IReq_ReviewBreakGlassAccess
|
|
423
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
424
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
425
|
+
IReq_ReviewBreakGlassAccess
|
|
426
|
+
> {
|
|
427
|
+
method: 'reviewBreakGlassAccess';
|
|
428
|
+
request: {
|
|
429
|
+
jwt: string;
|
|
430
|
+
operationId: string;
|
|
431
|
+
userId: string;
|
|
432
|
+
/** Exact current revision of the requesting User. */
|
|
433
|
+
expectedUserRevision: number;
|
|
434
|
+
reviewOutcome: data.TBreakGlassReviewOutcome;
|
|
435
|
+
};
|
|
436
|
+
response: {
|
|
437
|
+
user: dto.IGlobalUserAdminDto;
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
|
|
347
441
|
/**
|
|
348
442
|
* Platform-wide organization directory with member counts (admin only)
|
|
349
443
|
*/
|