@idp.global/interfaces 22.0.0 → 24.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 +1 -1
- package/dist_ts/data/authorization.d.ts +8 -0
- package/dist_ts/data/authorization.js +67 -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 +3 -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 +4 -0
- package/dist_ts/request/admin.d.ts +52 -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 +1 -0
- package/ts/data/authorization.ts +79 -0
- package/ts/data/index.ts +1 -0
- package/ts/data/role.ts +3 -0
- package/ts/data/user.ts +3 -0
- package/ts/dto/activity.ts +1 -0
- package/ts/dto/organization.ts +2 -0
- package/ts/dto/user.ts +5 -0
- package/ts/request/admin.ts +62 -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 - 24.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- introduce capability-based authorization contracts (authorization)
|
|
8
|
+
- Export global and tenant capability catalogs with delegable subsets.
|
|
9
|
+
- Add direct global capability assignment request contract using user revision and operation id.
|
|
10
|
+
- Require explicit capability lists on customer-defined organization role contracts.
|
|
11
|
+
- Expose user global capability assignments and add global_capabilities_changed activity event.
|
|
12
|
+
|
|
13
|
+
## 2026-07-18 - 23.0.0
|
|
14
|
+
|
|
15
|
+
### Breaking Changes
|
|
16
|
+
|
|
17
|
+
- require two-step OIDC signing-key rotation approvals (admin)
|
|
18
|
+
- Require operationId for rotateOidcSigningKey requests and return rotation status metadata.
|
|
19
|
+
- Add approveOidcSigningKeyRotation request contract with expected active key validation.
|
|
20
|
+
- Expose completion-only rotation results such as approvedAt, resultingActiveKid, and retiringKids.
|
|
21
|
+
|
|
3
22
|
## 2026-07-18 - 22.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: '24.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' | '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
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
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"];
|
|
6
|
+
export type TTenantCapability = (typeof tenantCapabilities)[number];
|
|
7
|
+
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"];
|
|
8
|
+
export type TDelegableTenantCapability = (typeof delegableTenantCapabilities)[number];
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
export const tenantCapabilities = [
|
|
28
|
+
'tenant.organization.read',
|
|
29
|
+
'tenant.organization.manage',
|
|
30
|
+
'tenant.organization.delete',
|
|
31
|
+
'tenant.organization.export',
|
|
32
|
+
'tenant.role.read',
|
|
33
|
+
'tenant.role.manage',
|
|
34
|
+
'tenant.membership.read',
|
|
35
|
+
'tenant.membership.manage',
|
|
36
|
+
'tenant.ownership.transfer',
|
|
37
|
+
'tenant.app-connection.read',
|
|
38
|
+
'tenant.app-connection.manage',
|
|
39
|
+
'tenant.sso.read',
|
|
40
|
+
'tenant.sso.manage',
|
|
41
|
+
'tenant.scim-token.read',
|
|
42
|
+
'tenant.scim-token.manage',
|
|
43
|
+
'tenant.billing.read',
|
|
44
|
+
'tenant.billing.manage',
|
|
45
|
+
'tenant.alert.read',
|
|
46
|
+
'tenant.alert.manage',
|
|
47
|
+
];
|
|
48
|
+
export const delegableTenantCapabilities = [
|
|
49
|
+
'tenant.organization.read',
|
|
50
|
+
'tenant.organization.manage',
|
|
51
|
+
'tenant.organization.export',
|
|
52
|
+
'tenant.role.read',
|
|
53
|
+
'tenant.role.manage',
|
|
54
|
+
'tenant.membership.read',
|
|
55
|
+
'tenant.membership.manage',
|
|
56
|
+
'tenant.app-connection.read',
|
|
57
|
+
'tenant.app-connection.manage',
|
|
58
|
+
'tenant.sso.read',
|
|
59
|
+
'tenant.sso.manage',
|
|
60
|
+
'tenant.scim-token.read',
|
|
61
|
+
'tenant.scim-token.manage',
|
|
62
|
+
'tenant.billing.read',
|
|
63
|
+
'tenant.billing.manage',
|
|
64
|
+
'tenant.alert.read',
|
|
65
|
+
'tenant.alert.manage',
|
|
66
|
+
];
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2RhdGEvYXV0aG9yaXphdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxrQkFBa0IsR0FBRztJQUNoQyx5QkFBeUI7SUFDekIsMkJBQTJCO0lBQzNCLDBCQUEwQjtJQUMxQiw0QkFBNEI7SUFDNUIsbUJBQW1CO0lBQ25CLHFCQUFxQjtJQUNyQixrQkFBa0I7SUFDbEIsb0JBQW9CO0lBQ3BCLG9CQUFvQjtJQUNwQixxQkFBcUI7SUFDckIsMkJBQTJCO0lBQzNCLDRCQUE0QjtJQUM1Qiw0QkFBNEI7Q0FDcEIsQ0FBQztBQUlYLE1BQU0sQ0FBQyxNQUFNLDJCQUEyQixHQUFHO0lBQ3pDLHlCQUF5QjtJQUN6QiwyQkFBMkI7SUFDM0IsMEJBQTBCO0lBQzFCLDRCQUE0QjtJQUM1QixtQkFBbUI7SUFDbkIscUJBQXFCO0lBQ3JCLGtCQUFrQjtJQUNsQixvQkFBb0I7SUFDcEIsNEJBQTRCO0NBQ21CLENBQUM7QUFLbEQsTUFBTSxDQUFDLE1BQU0sa0JBQWtCLEdBQUc7SUFDaEMsMEJBQTBCO0lBQzFCLDRCQUE0QjtJQUM1Qiw0QkFBNEI7SUFDNUIsNEJBQTRCO0lBQzVCLGtCQUFrQjtJQUNsQixvQkFBb0I7SUFDcEIsd0JBQXdCO0lBQ3hCLDBCQUEwQjtJQUMxQiwyQkFBMkI7SUFDM0IsNEJBQTRCO0lBQzVCLDhCQUE4QjtJQUM5QixpQkFBaUI7SUFDakIsbUJBQW1CO0lBQ25CLHdCQUF3QjtJQUN4QiwwQkFBMEI7SUFDMUIscUJBQXFCO0lBQ3JCLHVCQUF1QjtJQUN2QixtQkFBbUI7SUFDbkIscUJBQXFCO0NBQ2IsQ0FBQztBQUlYLE1BQU0sQ0FBQyxNQUFNLDJCQUEyQixHQUFHO0lBQ3pDLDBCQUEwQjtJQUMxQiw0QkFBNEI7SUFDNUIsNEJBQTRCO0lBQzVCLGtCQUFrQjtJQUNsQixvQkFBb0I7SUFDcEIsd0JBQXdCO0lBQ3hCLDBCQUEwQjtJQUMxQiw0QkFBNEI7SUFDNUIsOEJBQThCO0lBQzlCLGlCQUFpQjtJQUNqQixtQkFBbUI7SUFDbkIsd0JBQXdCO0lBQ3hCLDBCQUEwQjtJQUMxQixxQkFBcUI7SUFDckIsdUJBQXVCO0lBQ3ZCLG1CQUFtQjtJQUNuQixxQkFBcUI7Q0FDMEIsQ0FBQyJ9
|
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,4 @@
|
|
|
1
|
+
import type { TDelegableGlobalCapability } from './authorization.js';
|
|
1
2
|
export interface IUser {
|
|
2
3
|
id: string;
|
|
3
4
|
data: {
|
|
@@ -35,6 +36,8 @@ export interface IUser {
|
|
|
35
36
|
* to manage global apps, view platform stats, etc.
|
|
36
37
|
*/
|
|
37
38
|
isGlobalAdmin?: boolean | null;
|
|
39
|
+
/** Sorted, explicit platform capabilities for a non-administrator. */
|
|
40
|
+
globalCapabilities?: TDelegableGlobalCapability[] | null;
|
|
38
41
|
/**
|
|
39
42
|
* Links to external identities established via enterprise SSO.
|
|
40
43
|
* One entry per SSO connection the user has signed in through.
|
|
@@ -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<'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,4 @@
|
|
|
1
|
+
import type { TDelegableGlobalCapability } from '../data/authorization.js';
|
|
1
2
|
export interface IUserDataDto {
|
|
2
3
|
name: string;
|
|
3
4
|
username: string;
|
|
@@ -6,6 +7,7 @@ export interface IUserDataDto {
|
|
|
6
7
|
status: 'new' | 'active' | 'deleted' | 'suspended';
|
|
7
8
|
connectedOrgs: string[];
|
|
8
9
|
isGlobalAdmin?: boolean;
|
|
10
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
9
11
|
}
|
|
10
12
|
export interface IUserDto {
|
|
11
13
|
id: string;
|
|
@@ -36,6 +38,8 @@ export interface IGlobalUserAdminDto {
|
|
|
36
38
|
email: string;
|
|
37
39
|
status: IUserDataDto['status'];
|
|
38
40
|
isGlobalAdmin: boolean;
|
|
41
|
+
/** Sorted direct assignments; empty for global administrators. */
|
|
42
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
39
43
|
/** number of organizations the user belongs to */
|
|
40
44
|
orgCount: number;
|
|
41
45
|
/** epoch ms; derived for accounts created before this field existed */
|
|
@@ -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. */
|
|
@@ -167,10 +168,41 @@ export interface IReq_RotateOidcSigningKey extends plugins.typedRequestInterface
|
|
|
167
168
|
method: 'rotateOidcSigningKey';
|
|
168
169
|
request: {
|
|
169
170
|
jwt: string;
|
|
171
|
+
/** Caller-stable idempotency key for this exact rotation request. */
|
|
172
|
+
operationId: string;
|
|
173
|
+
};
|
|
174
|
+
response: {
|
|
175
|
+
status: 'pending' | 'completed' | 'expired';
|
|
176
|
+
operationId: string;
|
|
177
|
+
activeKid: string;
|
|
178
|
+
requestedAt: number;
|
|
179
|
+
expiresAt: number;
|
|
180
|
+
/** Present only when a distinct administrator completed the request. */
|
|
181
|
+
approvedAt?: number;
|
|
182
|
+
/** Present only when the request completed and identifies its new active key. */
|
|
183
|
+
resultingActiveKid?: string;
|
|
184
|
+
/** Present only when the request completed. */
|
|
185
|
+
retiringKids?: string[];
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Approve and execute a pending OIDC signing-key rotation requested by a
|
|
190
|
+
* different global administrator.
|
|
191
|
+
*/
|
|
192
|
+
export interface IReq_ApproveOidcSigningKeyRotation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_ApproveOidcSigningKeyRotation> {
|
|
193
|
+
method: 'approveOidcSigningKeyRotation';
|
|
194
|
+
request: {
|
|
195
|
+
jwt: string;
|
|
196
|
+
/** Must exactly match the caller-stable id of the pending request. */
|
|
197
|
+
operationId: string;
|
|
198
|
+
/** Binds approval to the key that was active when the request was reviewed. */
|
|
199
|
+
expectedActiveKid: string;
|
|
170
200
|
};
|
|
171
201
|
response: {
|
|
202
|
+
operationId: string;
|
|
172
203
|
activeKid: string;
|
|
173
204
|
retiringKids: string[];
|
|
205
|
+
approvedAt: number;
|
|
174
206
|
};
|
|
175
207
|
}
|
|
176
208
|
export interface IReq_SetOrganizationSuspension extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_SetOrganizationSuspension> {
|
|
@@ -236,6 +268,26 @@ export interface IReq_SetGlobalAdmin extends plugins.typedRequestInterfaces.impl
|
|
|
236
268
|
user: dto.IGlobalUserAdminDto;
|
|
237
269
|
};
|
|
238
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
|
+
}
|
|
239
291
|
/**
|
|
240
292
|
* Platform-wide organization directory with member counts (admin only)
|
|
241
293
|
*/
|
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
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
export const tenantCapabilities = [
|
|
35
|
+
'tenant.organization.read',
|
|
36
|
+
'tenant.organization.manage',
|
|
37
|
+
'tenant.organization.delete',
|
|
38
|
+
'tenant.organization.export',
|
|
39
|
+
'tenant.role.read',
|
|
40
|
+
'tenant.role.manage',
|
|
41
|
+
'tenant.membership.read',
|
|
42
|
+
'tenant.membership.manage',
|
|
43
|
+
'tenant.ownership.transfer',
|
|
44
|
+
'tenant.app-connection.read',
|
|
45
|
+
'tenant.app-connection.manage',
|
|
46
|
+
'tenant.sso.read',
|
|
47
|
+
'tenant.sso.manage',
|
|
48
|
+
'tenant.scim-token.read',
|
|
49
|
+
'tenant.scim-token.manage',
|
|
50
|
+
'tenant.billing.read',
|
|
51
|
+
'tenant.billing.manage',
|
|
52
|
+
'tenant.alert.read',
|
|
53
|
+
'tenant.alert.manage',
|
|
54
|
+
] as const;
|
|
55
|
+
|
|
56
|
+
export type TTenantCapability = (typeof tenantCapabilities)[number];
|
|
57
|
+
|
|
58
|
+
export const delegableTenantCapabilities = [
|
|
59
|
+
'tenant.organization.read',
|
|
60
|
+
'tenant.organization.manage',
|
|
61
|
+
'tenant.organization.export',
|
|
62
|
+
'tenant.role.read',
|
|
63
|
+
'tenant.role.manage',
|
|
64
|
+
'tenant.membership.read',
|
|
65
|
+
'tenant.membership.manage',
|
|
66
|
+
'tenant.app-connection.read',
|
|
67
|
+
'tenant.app-connection.manage',
|
|
68
|
+
'tenant.sso.read',
|
|
69
|
+
'tenant.sso.manage',
|
|
70
|
+
'tenant.scim-token.read',
|
|
71
|
+
'tenant.scim-token.manage',
|
|
72
|
+
'tenant.billing.read',
|
|
73
|
+
'tenant.billing.manage',
|
|
74
|
+
'tenant.alert.read',
|
|
75
|
+
'tenant.alert.manage',
|
|
76
|
+
] as const satisfies readonly TTenantCapability[];
|
|
77
|
+
|
|
78
|
+
export type TDelegableTenantCapability =
|
|
79
|
+
(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,6 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import { type IRole } from './role.js';
|
|
3
|
+
import type { TDelegableGlobalCapability } from './authorization.js';
|
|
3
4
|
|
|
4
5
|
export interface IUser {
|
|
5
6
|
id: string;
|
|
@@ -39,6 +40,8 @@ export interface IUser {
|
|
|
39
40
|
* to manage global apps, view platform stats, etc.
|
|
40
41
|
*/
|
|
41
42
|
isGlobalAdmin?: boolean | null;
|
|
43
|
+
/** Sorted, explicit platform capabilities for a non-administrator. */
|
|
44
|
+
globalCapabilities?: TDelegableGlobalCapability[] | null;
|
|
42
45
|
/**
|
|
43
46
|
* Links to external identities established via enterprise SSO.
|
|
44
47
|
* One entry per SSO connection the user has signed in through.
|
package/ts/dto/activity.ts
CHANGED
|
@@ -77,6 +77,7 @@ 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>
|
|
80
81
|
| TActivityEventFor<'account_deletion_requested', 'account', null>
|
|
81
82
|
| TActivityEventFor<'account_deletion_cancelled', 'account', null>
|
|
82
83
|
| 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,5 @@
|
|
|
1
|
+
import type { TDelegableGlobalCapability } from '../data/authorization.js';
|
|
2
|
+
|
|
1
3
|
export interface IUserDataDto {
|
|
2
4
|
name: string;
|
|
3
5
|
username: string;
|
|
@@ -6,6 +8,7 @@ export interface IUserDataDto {
|
|
|
6
8
|
status: 'new' | 'active' | 'deleted' | 'suspended';
|
|
7
9
|
connectedOrgs: string[];
|
|
8
10
|
isGlobalAdmin?: boolean;
|
|
11
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export interface IUserDto {
|
|
@@ -39,6 +42,8 @@ export interface IGlobalUserAdminDto {
|
|
|
39
42
|
email: string;
|
|
40
43
|
status: IUserDataDto['status'];
|
|
41
44
|
isGlobalAdmin: boolean;
|
|
45
|
+
/** Sorted direct assignments; empty for global administrators. */
|
|
46
|
+
globalCapabilities: TDelegableGlobalCapability[];
|
|
42
47
|
/** number of organizations the user belongs to */
|
|
43
48
|
orgCount: number;
|
|
44
49
|
/** 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';
|
|
@@ -218,10 +219,46 @@ export interface IReq_RotateOidcSigningKey
|
|
|
218
219
|
method: 'rotateOidcSigningKey';
|
|
219
220
|
request: {
|
|
220
221
|
jwt: string;
|
|
222
|
+
/** Caller-stable idempotency key for this exact rotation request. */
|
|
223
|
+
operationId: string;
|
|
224
|
+
};
|
|
225
|
+
response: {
|
|
226
|
+
status: 'pending' | 'completed' | 'expired';
|
|
227
|
+
operationId: string;
|
|
228
|
+
activeKid: string;
|
|
229
|
+
requestedAt: number;
|
|
230
|
+
expiresAt: number;
|
|
231
|
+
/** Present only when a distinct administrator completed the request. */
|
|
232
|
+
approvedAt?: number;
|
|
233
|
+
/** Present only when the request completed and identifies its new active key. */
|
|
234
|
+
resultingActiveKid?: string;
|
|
235
|
+
/** Present only when the request completed. */
|
|
236
|
+
retiringKids?: string[];
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Approve and execute a pending OIDC signing-key rotation requested by a
|
|
242
|
+
* different global administrator.
|
|
243
|
+
*/
|
|
244
|
+
export interface IReq_ApproveOidcSigningKeyRotation
|
|
245
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
246
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
247
|
+
IReq_ApproveOidcSigningKeyRotation
|
|
248
|
+
> {
|
|
249
|
+
method: 'approveOidcSigningKeyRotation';
|
|
250
|
+
request: {
|
|
251
|
+
jwt: string;
|
|
252
|
+
/** Must exactly match the caller-stable id of the pending request. */
|
|
253
|
+
operationId: string;
|
|
254
|
+
/** Binds approval to the key that was active when the request was reviewed. */
|
|
255
|
+
expectedActiveKid: string;
|
|
221
256
|
};
|
|
222
257
|
response: {
|
|
258
|
+
operationId: string;
|
|
223
259
|
activeKid: string;
|
|
224
260
|
retiringKids: string[];
|
|
261
|
+
approvedAt: number;
|
|
225
262
|
};
|
|
226
263
|
}
|
|
227
264
|
|
|
@@ -308,6 +345,31 @@ export interface IReq_SetGlobalAdmin
|
|
|
308
345
|
};
|
|
309
346
|
}
|
|
310
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
|
+
|
|
311
373
|
/**
|
|
312
374
|
* Platform-wide organization directory with member counts (admin only)
|
|
313
375
|
*/
|