@idp.global/interfaces 7.0.0 → 8.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 +11 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/activity.d.ts +1 -1
- package/dist_ts/data/index.d.ts +2 -0
- package/dist_ts/data/index.js +3 -1
- package/dist_ts/data/scim.d.ts +87 -0
- package/dist_ts/data/scim.js +11 -0
- package/dist_ts/data/ssoconnection.d.ts +87 -0
- package/dist_ts/data/ssoconnection.js +2 -0
- package/dist_ts/data/user.d.ts +22 -0
- package/dist_ts/dto/index.d.ts +1 -0
- package/dist_ts/dto/index.js +2 -1
- package/dist_ts/dto/ssoconnection.d.ts +57 -0
- package/dist_ts/dto/ssoconnection.js +2 -0
- package/dist_ts/request/index.d.ts +1 -0
- package/dist_ts/request/index.js +2 -1
- package/dist_ts/request/ssoconnection.d.ts +163 -0
- package/dist_ts/request/ssoconnection.js +4 -0
- package/package.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/activity.ts +11 -1
- package/ts/data/index.ts +2 -0
- package/ts/data/scim.ts +107 -0
- package/ts/data/ssoconnection.ts +91 -0
- package/ts/data/user.ts +22 -0
- package/ts/dto/index.ts +1 -0
- package/ts/dto/ssoconnection.ts +60 -0
- package/ts/request/index.ts +1 -0
- package/ts/request/ssoconnection.ts +208 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-07-08 - 8.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- add enterprise SSO and SCIM contracts (sso)
|
|
8
|
+
- New data contracts: ISsoConnection (org-level SAML connection with email-domain HRD, IdP cert rollover, provisioning modes, group-role mappings), IScimTokenRecord, and shared SCIM 2.0 wire types (IScimUserResource, IScimGroupResource, IScimListResponse, IScimPatchRequest, IScimError)
|
|
9
|
+
- New DTOs: ISsoConnectionDto, IScimTokenDto, ISsoSpDetailsDto
|
|
10
|
+
- New request contracts: getSsoConnections, createSsoConnection, updateSsoConnection, deleteSsoConnection, getSsoSpDetails, createScimToken, getScimTokens, revokeScimToken, and public discoverSsoForEmail
|
|
11
|
+
- IUser gains optional externalIdentities and scim provisioning state
|
|
12
|
+
- TActivityAction extended with sso_* and scim_* actions (breaking for exhaustive consumers)
|
|
13
|
+
|
|
3
14
|
## 2026-06-24 - 7.0.0
|
|
4
15
|
|
|
5
16
|
### Breaking Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@idp.global/interfaces',
|
|
6
|
-
version: '
|
|
6
|
+
version: '8.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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
|
|
@@ -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';
|
|
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' | 'sso_connection_created' | 'sso_connection_updated' | 'sso_connection_deleted' | 'sso_login' | 'scim_token_created' | 'scim_token_revoked' | 'scim_user_provisioned' | 'scim_user_updated' | 'scim_user_deactivated' | 'scim_group_membership_changed';
|
|
2
2
|
export interface IActivityLog {
|
|
3
3
|
id: string;
|
|
4
4
|
data: {
|
package/dist_ts/data/index.d.ts
CHANGED
package/dist_ts/data/index.js
CHANGED
|
@@ -21,4 +21,6 @@ export * from './registrationsession.js';
|
|
|
21
21
|
export * from './role.js';
|
|
22
22
|
export * from './user.js';
|
|
23
23
|
export * from './userinvitation.js';
|
|
24
|
-
|
|
24
|
+
export * from './ssoconnection.js';
|
|
25
|
+
export * from './scim.js';
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kYXRhL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLFdBQVcsQ0FBQyJ9
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal SCIM 2.0 wire types (RFC 7643/7644 subset) shared between the
|
|
3
|
+
* app's SCIM server implementation and its tests. Field shapes follow what
|
|
4
|
+
* Okta and Microsoft Entra ID actually send.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SCIM_URN_USER = "urn:ietf:params:scim:schemas:core:2.0:User";
|
|
7
|
+
export declare const SCIM_URN_GROUP = "urn:ietf:params:scim:schemas:core:2.0:Group";
|
|
8
|
+
export declare const SCIM_URN_LIST_RESPONSE = "urn:ietf:params:scim:api:messages:2.0:ListResponse";
|
|
9
|
+
export declare const SCIM_URN_PATCH_OP = "urn:ietf:params:scim:api:messages:2.0:PatchOp";
|
|
10
|
+
export declare const SCIM_URN_ERROR = "urn:ietf:params:scim:api:messages:2.0:Error";
|
|
11
|
+
export interface IScimMeta {
|
|
12
|
+
resourceType: 'User' | 'Group' | 'ServiceProviderConfig' | 'ResourceType' | 'Schema';
|
|
13
|
+
/** ISO 8601 */
|
|
14
|
+
created?: string;
|
|
15
|
+
/** ISO 8601 */
|
|
16
|
+
lastModified?: string;
|
|
17
|
+
location?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface IScimName {
|
|
20
|
+
givenName?: string;
|
|
21
|
+
familyName?: string;
|
|
22
|
+
formatted?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IScimEmail {
|
|
25
|
+
value: string;
|
|
26
|
+
type?: string;
|
|
27
|
+
primary?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface IScimUserResource {
|
|
30
|
+
schemas: string[];
|
|
31
|
+
/** Server-assigned, immutable */
|
|
32
|
+
id: string;
|
|
33
|
+
/** Assigned by the provisioning IdP; echoed back verbatim */
|
|
34
|
+
externalId?: string;
|
|
35
|
+
/** Unique server-wide, matched case-insensitively */
|
|
36
|
+
userName: string;
|
|
37
|
+
name?: IScimName;
|
|
38
|
+
displayName?: string;
|
|
39
|
+
emails?: IScimEmail[];
|
|
40
|
+
active: boolean;
|
|
41
|
+
meta: IScimMeta;
|
|
42
|
+
}
|
|
43
|
+
export interface IScimGroupMember {
|
|
44
|
+
/** SCIM id of the member user */
|
|
45
|
+
value: string;
|
|
46
|
+
display?: string;
|
|
47
|
+
/** Entra sends null here; tolerated and ignored */
|
|
48
|
+
$ref?: string | null;
|
|
49
|
+
}
|
|
50
|
+
export interface IScimGroupResource {
|
|
51
|
+
schemas: string[];
|
|
52
|
+
id: string;
|
|
53
|
+
externalId?: string;
|
|
54
|
+
displayName: string;
|
|
55
|
+
members?: IScimGroupMember[];
|
|
56
|
+
meta: IScimMeta;
|
|
57
|
+
}
|
|
58
|
+
export interface IScimListResponse<T> {
|
|
59
|
+
schemas: string[];
|
|
60
|
+
/** Numbers, never strings */
|
|
61
|
+
totalResults: number;
|
|
62
|
+
startIndex: number;
|
|
63
|
+
itemsPerPage: number;
|
|
64
|
+
Resources: T[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A single PATCH operation. `op` must be matched case-insensitively
|
|
68
|
+
* (Entra sends "Add"/"Replace"/"Remove"). `value` may be a primitive, a
|
|
69
|
+
* boolean-as-string ("False"), an object with dotted keys, or an array of
|
|
70
|
+
* member refs, depending on the operation.
|
|
71
|
+
*/
|
|
72
|
+
export interface IScimPatchOperation {
|
|
73
|
+
op: string;
|
|
74
|
+
path?: string;
|
|
75
|
+
value?: unknown;
|
|
76
|
+
}
|
|
77
|
+
export interface IScimPatchRequest {
|
|
78
|
+
schemas: string[];
|
|
79
|
+
Operations: IScimPatchOperation[];
|
|
80
|
+
}
|
|
81
|
+
export interface IScimError {
|
|
82
|
+
schemas: string[];
|
|
83
|
+
/** HTTP status as a JSON string per RFC 7644 */
|
|
84
|
+
status: string;
|
|
85
|
+
scimType?: 'invalidFilter' | 'invalidPath' | 'invalidValue' | 'invalidSyntax' | 'noTarget' | 'mutability' | 'uniqueness' | 'tooMany' | 'sensitive';
|
|
86
|
+
detail?: string;
|
|
87
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal SCIM 2.0 wire types (RFC 7643/7644 subset) shared between the
|
|
3
|
+
* app's SCIM server implementation and its tests. Field shapes follow what
|
|
4
|
+
* Okta and Microsoft Entra ID actually send.
|
|
5
|
+
*/
|
|
6
|
+
export const SCIM_URN_USER = 'urn:ietf:params:scim:schemas:core:2.0:User';
|
|
7
|
+
export const SCIM_URN_GROUP = 'urn:ietf:params:scim:schemas:core:2.0:Group';
|
|
8
|
+
export const SCIM_URN_LIST_RESPONSE = 'urn:ietf:params:scim:api:messages:2.0:ListResponse';
|
|
9
|
+
export const SCIM_URN_PATCH_OP = 'urn:ietf:params:scim:api:messages:2.0:PatchOp';
|
|
10
|
+
export const SCIM_URN_ERROR = 'urn:ietf:params:scim:api:messages:2.0:Error';
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NpbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2RhdGEvc2NpbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7OztHQUlHO0FBRUgsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLDRDQUE0QyxDQUFDO0FBQzFFLE1BQU0sQ0FBQyxNQUFNLGNBQWMsR0FBRyw2Q0FBNkMsQ0FBQztBQUM1RSxNQUFNLENBQUMsTUFBTSxzQkFBc0IsR0FBRyxvREFBb0QsQ0FBQztBQUMzRixNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FBRywrQ0FBK0MsQ0FBQztBQUNqRixNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUcsNkNBQTZDLENBQUMifQ==
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enterprise SSO provisioning mode for a connection.
|
|
3
|
+
* - jit: accounts are created just-in-time on first SAML login
|
|
4
|
+
* - scim-only: accounts must be provisioned via SCIM before they can sign in
|
|
5
|
+
* - jit-and-scim: both paths are allowed
|
|
6
|
+
*/
|
|
7
|
+
export type TSsoProvisioningMode = 'jit' | 'scim-only' | 'jit-and-scim';
|
|
8
|
+
/**
|
|
9
|
+
* Maps an IdP-side group name to org roles on idp.global.
|
|
10
|
+
* Used both for SAML group attributes and SCIM group memberships.
|
|
11
|
+
*/
|
|
12
|
+
export interface IGroupRoleMapping {
|
|
13
|
+
/** Group name as sent by the customer IdP (SAML attribute value or SCIM group displayName) */
|
|
14
|
+
idpGroup: string;
|
|
15
|
+
/** Org roles granted while the user is a member of the group */
|
|
16
|
+
orgRoles: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Optional SAML attribute name overrides. Sensible defaults are applied
|
|
20
|
+
* when unset (NameID for email, standard claim URIs for name/groups).
|
|
21
|
+
*/
|
|
22
|
+
export interface ISsoAttributeMapping {
|
|
23
|
+
email?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
groups?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* An org-level enterprise SSO connection. idp.global acts as the SAML
|
|
29
|
+
* service provider; the customer org brings their own IdP (Okta, Entra, ...).
|
|
30
|
+
*/
|
|
31
|
+
export interface ISsoConnection {
|
|
32
|
+
id: string;
|
|
33
|
+
data: {
|
|
34
|
+
organizationId: string;
|
|
35
|
+
/** Connection protocol. Only SAML for now; OIDC federation may follow. */
|
|
36
|
+
type: 'saml';
|
|
37
|
+
displayName: string;
|
|
38
|
+
status: 'active' | 'disabled';
|
|
39
|
+
/**
|
|
40
|
+
* Email domains routed to this connection during home-realm discovery.
|
|
41
|
+
* Globally unique across all connections.
|
|
42
|
+
*/
|
|
43
|
+
emailDomains: string[];
|
|
44
|
+
idp: {
|
|
45
|
+
/** IdP entityID from metadata */
|
|
46
|
+
entityId: string;
|
|
47
|
+
/** IdP single-sign-on URL (HTTP-Redirect binding) */
|
|
48
|
+
ssoUrl: string;
|
|
49
|
+
/**
|
|
50
|
+
* IdP signing certificates (PEM). Multiple entries allow zero-downtime
|
|
51
|
+
* certificate rollover on the customer side.
|
|
52
|
+
*/
|
|
53
|
+
signingCertificates: string[];
|
|
54
|
+
/** Raw uploaded metadata XML, kept for re-parsing and debugging */
|
|
55
|
+
metadataXml?: string;
|
|
56
|
+
};
|
|
57
|
+
provisioning: {
|
|
58
|
+
mode: TSsoProvisioningMode;
|
|
59
|
+
/** Org roles granted to every user of this connection */
|
|
60
|
+
defaultOrgRoles: string[];
|
|
61
|
+
};
|
|
62
|
+
groupMappings: IGroupRoleMapping[];
|
|
63
|
+
attributeMapping?: ISsoAttributeMapping;
|
|
64
|
+
createdAt: number;
|
|
65
|
+
updatedAt: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Internal persisted SCIM bearer token record. Never return this shape to
|
|
70
|
+
* clients; the plaintext token is shown exactly once at creation.
|
|
71
|
+
*/
|
|
72
|
+
export interface IScimTokenRecord {
|
|
73
|
+
id: string;
|
|
74
|
+
data: {
|
|
75
|
+
organizationId: string;
|
|
76
|
+
/** Human-readable label, e.g. "Okta production" */
|
|
77
|
+
label: string;
|
|
78
|
+
/** sha256 hash of the bearer token */
|
|
79
|
+
tokenHash: string;
|
|
80
|
+
/** First characters of the token for display purposes */
|
|
81
|
+
tokenPrefix: string;
|
|
82
|
+
createdAt: number;
|
|
83
|
+
expiresAt?: number;
|
|
84
|
+
lastUsedAt?: number;
|
|
85
|
+
revoked: boolean;
|
|
86
|
+
};
|
|
87
|
+
}
|
package/dist_ts/data/user.d.ts
CHANGED
|
@@ -28,5 +28,27 @@ export interface IUser {
|
|
|
28
28
|
* to manage global apps, view platform stats, etc.
|
|
29
29
|
*/
|
|
30
30
|
isGlobalAdmin?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Links to external identities established via enterprise SSO.
|
|
33
|
+
* One entry per SSO connection the user has signed in through.
|
|
34
|
+
*/
|
|
35
|
+
externalIdentities?: {
|
|
36
|
+
/** The ISsoConnection id this identity belongs to */
|
|
37
|
+
connectionId: string;
|
|
38
|
+
/** Stable subject identifier at the customer IdP (SAML NameID) */
|
|
39
|
+
subjectId: string;
|
|
40
|
+
}[];
|
|
41
|
+
/**
|
|
42
|
+
* SCIM provisioning state. Present when the user is managed by an
|
|
43
|
+
* org's SCIM integration.
|
|
44
|
+
*/
|
|
45
|
+
scim?: {
|
|
46
|
+
/** externalId assigned by the provisioning IdP */
|
|
47
|
+
externalId?: string;
|
|
48
|
+
/** The ISsoConnection id whose SCIM integration manages this user */
|
|
49
|
+
provisionedByConnectionId?: string;
|
|
50
|
+
/** SCIM-side active flag; false after deprovisioning */
|
|
51
|
+
active?: boolean;
|
|
52
|
+
};
|
|
31
53
|
};
|
|
32
54
|
}
|
package/dist_ts/dto/index.d.ts
CHANGED
package/dist_ts/dto/index.js
CHANGED
|
@@ -7,4 +7,5 @@ export * from './mfa.js';
|
|
|
7
7
|
export * from './organization.js';
|
|
8
8
|
export * from './passport.js';
|
|
9
9
|
export * from './user.js';
|
|
10
|
-
|
|
10
|
+
export * from './ssoconnection.js';
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kdG8vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsb0JBQW9CLENBQUMifQ==
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { TSsoProvisioningMode, IGroupRoleMapping, ISsoAttributeMapping } from '../data/ssoconnection.js';
|
|
2
|
+
/**
|
|
3
|
+
* Client-facing SSO connection shape. IdP signing certificates are public
|
|
4
|
+
* material and stay included; the raw metadata XML is omitted.
|
|
5
|
+
*/
|
|
6
|
+
export interface ISsoConnectionDto {
|
|
7
|
+
id: string;
|
|
8
|
+
data: {
|
|
9
|
+
organizationId: string;
|
|
10
|
+
type: 'saml';
|
|
11
|
+
displayName: string;
|
|
12
|
+
status: 'active' | 'disabled';
|
|
13
|
+
emailDomains: string[];
|
|
14
|
+
idp: {
|
|
15
|
+
entityId: string;
|
|
16
|
+
ssoUrl: string;
|
|
17
|
+
signingCertificates: string[];
|
|
18
|
+
};
|
|
19
|
+
provisioning: {
|
|
20
|
+
mode: TSsoProvisioningMode;
|
|
21
|
+
defaultOrgRoles: string[];
|
|
22
|
+
};
|
|
23
|
+
groupMappings: IGroupRoleMapping[];
|
|
24
|
+
attributeMapping?: ISsoAttributeMapping;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
updatedAt: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Client-facing SCIM token shape. Never carries the token hash; the
|
|
31
|
+
* plaintext token is returned exactly once by createScimToken.
|
|
32
|
+
*/
|
|
33
|
+
export interface IScimTokenDto {
|
|
34
|
+
id: string;
|
|
35
|
+
data: {
|
|
36
|
+
organizationId: string;
|
|
37
|
+
label: string;
|
|
38
|
+
tokenPrefix: string;
|
|
39
|
+
createdAt: number;
|
|
40
|
+
expiresAt?: number;
|
|
41
|
+
lastUsedAt?: number;
|
|
42
|
+
revoked: boolean;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Service-provider side details an org admin needs to configure their IdP.
|
|
47
|
+
*/
|
|
48
|
+
export interface ISsoSpDetailsDto {
|
|
49
|
+
/** SP entityID to register at the customer IdP */
|
|
50
|
+
spEntityId: string;
|
|
51
|
+
/** Assertion consumer service URL (HTTP-POST binding) */
|
|
52
|
+
acsUrl: string;
|
|
53
|
+
/** URL serving the SP metadata XML */
|
|
54
|
+
metadataUrl: string;
|
|
55
|
+
/** Base URL of the SCIM v2 endpoint for this org */
|
|
56
|
+
scimBaseUrl: string;
|
|
57
|
+
}
|
package/dist_ts/request/index.js
CHANGED
|
@@ -13,4 +13,5 @@ export * from './plan.js';
|
|
|
13
13
|
export * from './registration.js';
|
|
14
14
|
export * from './user.js';
|
|
15
15
|
export * from './userinvitation.js';
|
|
16
|
-
|
|
16
|
+
export * from './ssoconnection.js';
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLG9CQUFvQixDQUFDIn0=
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
2
|
+
import * as dto from '../dto/index.js';
|
|
3
|
+
import * as plugins from '../plugins.js';
|
|
4
|
+
/**
|
|
5
|
+
* List the SSO connections of an organization (org admin only)
|
|
6
|
+
*/
|
|
7
|
+
export interface IReq_GetSsoConnections extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetSsoConnections> {
|
|
8
|
+
method: 'getSsoConnections';
|
|
9
|
+
request: {
|
|
10
|
+
jwt: string;
|
|
11
|
+
organizationId: string;
|
|
12
|
+
};
|
|
13
|
+
response: {
|
|
14
|
+
connections: dto.ISsoConnectionDto[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create an SSO connection for an organization (org admin only).
|
|
19
|
+
* Either metadataXml or the manual idp fields must be provided.
|
|
20
|
+
*/
|
|
21
|
+
export interface IReq_CreateSsoConnection extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_CreateSsoConnection> {
|
|
22
|
+
method: 'createSsoConnection';
|
|
23
|
+
request: {
|
|
24
|
+
jwt: string;
|
|
25
|
+
organizationId: string;
|
|
26
|
+
displayName: string;
|
|
27
|
+
emailDomains: string[];
|
|
28
|
+
/** IdP metadata XML; parsed server-side when provided */
|
|
29
|
+
metadataXml?: string;
|
|
30
|
+
/** Manual IdP configuration, used when metadataXml is absent */
|
|
31
|
+
idp?: {
|
|
32
|
+
entityId: string;
|
|
33
|
+
ssoUrl: string;
|
|
34
|
+
signingCertificates: string[];
|
|
35
|
+
};
|
|
36
|
+
provisioning: {
|
|
37
|
+
mode: data.TSsoProvisioningMode;
|
|
38
|
+
defaultOrgRoles: string[];
|
|
39
|
+
};
|
|
40
|
+
groupMappings?: data.IGroupRoleMapping[];
|
|
41
|
+
attributeMapping?: data.ISsoAttributeMapping;
|
|
42
|
+
};
|
|
43
|
+
response: {
|
|
44
|
+
connection: dto.ISsoConnectionDto;
|
|
45
|
+
spDetails: dto.ISsoSpDetailsDto;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Update an SSO connection (org admin only). Only provided fields change.
|
|
50
|
+
*/
|
|
51
|
+
export interface IReq_UpdateSsoConnection extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_UpdateSsoConnection> {
|
|
52
|
+
method: 'updateSsoConnection';
|
|
53
|
+
request: {
|
|
54
|
+
jwt: string;
|
|
55
|
+
connectionId: string;
|
|
56
|
+
displayName?: string;
|
|
57
|
+
status?: 'active' | 'disabled';
|
|
58
|
+
emailDomains?: string[];
|
|
59
|
+
metadataXml?: string;
|
|
60
|
+
idp?: {
|
|
61
|
+
entityId: string;
|
|
62
|
+
ssoUrl: string;
|
|
63
|
+
signingCertificates: string[];
|
|
64
|
+
};
|
|
65
|
+
provisioning?: {
|
|
66
|
+
mode: data.TSsoProvisioningMode;
|
|
67
|
+
defaultOrgRoles: string[];
|
|
68
|
+
};
|
|
69
|
+
groupMappings?: data.IGroupRoleMapping[];
|
|
70
|
+
attributeMapping?: data.ISsoAttributeMapping;
|
|
71
|
+
};
|
|
72
|
+
response: {
|
|
73
|
+
connection: dto.ISsoConnectionDto;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Delete an SSO connection (org admin only)
|
|
78
|
+
*/
|
|
79
|
+
export interface IReq_DeleteSsoConnection extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_DeleteSsoConnection> {
|
|
80
|
+
method: 'deleteSsoConnection';
|
|
81
|
+
request: {
|
|
82
|
+
jwt: string;
|
|
83
|
+
connectionId: string;
|
|
84
|
+
};
|
|
85
|
+
response: {
|
|
86
|
+
success: boolean;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get the SP-side details (entityId, ACS URL, metadata URL, SCIM base URL)
|
|
91
|
+
* an org admin needs to configure the customer IdP (org admin only)
|
|
92
|
+
*/
|
|
93
|
+
export interface IReq_GetSsoSpDetails extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetSsoSpDetails> {
|
|
94
|
+
method: 'getSsoSpDetails';
|
|
95
|
+
request: {
|
|
96
|
+
jwt: string;
|
|
97
|
+
connectionId: string;
|
|
98
|
+
};
|
|
99
|
+
response: {
|
|
100
|
+
spDetails: dto.ISsoSpDetailsDto;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Create a SCIM bearer token for an organization (org admin only).
|
|
105
|
+
* The plaintext token is returned exactly once.
|
|
106
|
+
*/
|
|
107
|
+
export interface IReq_CreateScimToken extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_CreateScimToken> {
|
|
108
|
+
method: 'createScimToken';
|
|
109
|
+
request: {
|
|
110
|
+
jwt: string;
|
|
111
|
+
organizationId: string;
|
|
112
|
+
label: string;
|
|
113
|
+
/** Optional expiry timestamp (epoch ms) */
|
|
114
|
+
expiresAt?: number;
|
|
115
|
+
};
|
|
116
|
+
response: {
|
|
117
|
+
token: dto.IScimTokenDto;
|
|
118
|
+
/** Plaintext bearer token; shown exactly once */
|
|
119
|
+
plaintextToken: string;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* List the SCIM tokens of an organization (org admin only)
|
|
124
|
+
*/
|
|
125
|
+
export interface IReq_GetScimTokens extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetScimTokens> {
|
|
126
|
+
method: 'getScimTokens';
|
|
127
|
+
request: {
|
|
128
|
+
jwt: string;
|
|
129
|
+
organizationId: string;
|
|
130
|
+
};
|
|
131
|
+
response: {
|
|
132
|
+
tokens: dto.IScimTokenDto[];
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Revoke a SCIM token (org admin only)
|
|
137
|
+
*/
|
|
138
|
+
export interface IReq_RevokeScimToken extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_RevokeScimToken> {
|
|
139
|
+
method: 'revokeScimToken';
|
|
140
|
+
request: {
|
|
141
|
+
jwt: string;
|
|
142
|
+
tokenId: string;
|
|
143
|
+
};
|
|
144
|
+
response: {
|
|
145
|
+
success: boolean;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Public home-realm discovery: given an email address, reports whether an
|
|
150
|
+
* active SSO connection covers its domain. Discloses domain-level presence
|
|
151
|
+
* only (standard Okta-style HRD behavior); no account information.
|
|
152
|
+
*/
|
|
153
|
+
export interface IReq_DiscoverSsoForEmail extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_DiscoverSsoForEmail> {
|
|
154
|
+
method: 'discoverSsoForEmail';
|
|
155
|
+
request: {
|
|
156
|
+
email: string;
|
|
157
|
+
};
|
|
158
|
+
response: {
|
|
159
|
+
ssoAvailable: boolean;
|
|
160
|
+
/** Relative login path to start the SAML flow when available */
|
|
161
|
+
loginUrl?: string;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
2
|
+
import * as dto from '../dto/index.js';
|
|
3
|
+
import * as plugins from '../plugins.js';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3NvY29ubmVjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL3JlcXVlc3Qvc3NvY29ubmVjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssSUFBSSxNQUFNLGtCQUFrQixDQUFDO0FBQ3pDLE9BQU8sS0FBSyxHQUFHLE1BQU0saUJBQWlCLENBQUM7QUFDdkMsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUMifQ==
|
package/package.json
CHANGED
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/activity.ts
CHANGED
|
@@ -25,7 +25,17 @@ export type TActivityAction =
|
|
|
25
25
|
| 'passkey_login'
|
|
26
26
|
| 'app_connected'
|
|
27
27
|
| 'app_disconnected'
|
|
28
|
-
| 'user_suspended'
|
|
28
|
+
| 'user_suspended'
|
|
29
|
+
| 'sso_connection_created'
|
|
30
|
+
| 'sso_connection_updated'
|
|
31
|
+
| 'sso_connection_deleted'
|
|
32
|
+
| 'sso_login'
|
|
33
|
+
| 'scim_token_created'
|
|
34
|
+
| 'scim_token_revoked'
|
|
35
|
+
| 'scim_user_provisioned'
|
|
36
|
+
| 'scim_user_updated'
|
|
37
|
+
| 'scim_user_deactivated'
|
|
38
|
+
| 'scim_group_membership_changed';
|
|
29
39
|
|
|
30
40
|
export interface IActivityLog {
|
|
31
41
|
id: string;
|
package/ts/data/index.ts
CHANGED
package/ts/data/scim.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal SCIM 2.0 wire types (RFC 7643/7644 subset) shared between the
|
|
3
|
+
* app's SCIM server implementation and its tests. Field shapes follow what
|
|
4
|
+
* Okta and Microsoft Entra ID actually send.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const SCIM_URN_USER = 'urn:ietf:params:scim:schemas:core:2.0:User';
|
|
8
|
+
export const SCIM_URN_GROUP = 'urn:ietf:params:scim:schemas:core:2.0:Group';
|
|
9
|
+
export const SCIM_URN_LIST_RESPONSE = 'urn:ietf:params:scim:api:messages:2.0:ListResponse';
|
|
10
|
+
export const SCIM_URN_PATCH_OP = 'urn:ietf:params:scim:api:messages:2.0:PatchOp';
|
|
11
|
+
export const SCIM_URN_ERROR = 'urn:ietf:params:scim:api:messages:2.0:Error';
|
|
12
|
+
|
|
13
|
+
export interface IScimMeta {
|
|
14
|
+
resourceType: 'User' | 'Group' | 'ServiceProviderConfig' | 'ResourceType' | 'Schema';
|
|
15
|
+
/** ISO 8601 */
|
|
16
|
+
created?: string;
|
|
17
|
+
/** ISO 8601 */
|
|
18
|
+
lastModified?: string;
|
|
19
|
+
location?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IScimName {
|
|
23
|
+
givenName?: string;
|
|
24
|
+
familyName?: string;
|
|
25
|
+
formatted?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IScimEmail {
|
|
29
|
+
value: string;
|
|
30
|
+
type?: string;
|
|
31
|
+
primary?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IScimUserResource {
|
|
35
|
+
schemas: string[];
|
|
36
|
+
/** Server-assigned, immutable */
|
|
37
|
+
id: string;
|
|
38
|
+
/** Assigned by the provisioning IdP; echoed back verbatim */
|
|
39
|
+
externalId?: string;
|
|
40
|
+
/** Unique server-wide, matched case-insensitively */
|
|
41
|
+
userName: string;
|
|
42
|
+
name?: IScimName;
|
|
43
|
+
displayName?: string;
|
|
44
|
+
emails?: IScimEmail[];
|
|
45
|
+
active: boolean;
|
|
46
|
+
meta: IScimMeta;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface IScimGroupMember {
|
|
50
|
+
/** SCIM id of the member user */
|
|
51
|
+
value: string;
|
|
52
|
+
display?: string;
|
|
53
|
+
/** Entra sends null here; tolerated and ignored */
|
|
54
|
+
$ref?: string | null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface IScimGroupResource {
|
|
58
|
+
schemas: string[];
|
|
59
|
+
id: string;
|
|
60
|
+
externalId?: string;
|
|
61
|
+
displayName: string;
|
|
62
|
+
members?: IScimGroupMember[];
|
|
63
|
+
meta: IScimMeta;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface IScimListResponse<T> {
|
|
67
|
+
schemas: string[];
|
|
68
|
+
/** Numbers, never strings */
|
|
69
|
+
totalResults: number;
|
|
70
|
+
startIndex: number;
|
|
71
|
+
itemsPerPage: number;
|
|
72
|
+
Resources: T[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A single PATCH operation. `op` must be matched case-insensitively
|
|
77
|
+
* (Entra sends "Add"/"Replace"/"Remove"). `value` may be a primitive, a
|
|
78
|
+
* boolean-as-string ("False"), an object with dotted keys, or an array of
|
|
79
|
+
* member refs, depending on the operation.
|
|
80
|
+
*/
|
|
81
|
+
export interface IScimPatchOperation {
|
|
82
|
+
op: string;
|
|
83
|
+
path?: string;
|
|
84
|
+
value?: unknown;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface IScimPatchRequest {
|
|
88
|
+
schemas: string[];
|
|
89
|
+
Operations: IScimPatchOperation[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface IScimError {
|
|
93
|
+
schemas: string[];
|
|
94
|
+
/** HTTP status as a JSON string per RFC 7644 */
|
|
95
|
+
status: string;
|
|
96
|
+
scimType?:
|
|
97
|
+
| 'invalidFilter'
|
|
98
|
+
| 'invalidPath'
|
|
99
|
+
| 'invalidValue'
|
|
100
|
+
| 'invalidSyntax'
|
|
101
|
+
| 'noTarget'
|
|
102
|
+
| 'mutability'
|
|
103
|
+
| 'uniqueness'
|
|
104
|
+
| 'tooMany'
|
|
105
|
+
| 'sensitive';
|
|
106
|
+
detail?: string;
|
|
107
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enterprise SSO provisioning mode for a connection.
|
|
3
|
+
* - jit: accounts are created just-in-time on first SAML login
|
|
4
|
+
* - scim-only: accounts must be provisioned via SCIM before they can sign in
|
|
5
|
+
* - jit-and-scim: both paths are allowed
|
|
6
|
+
*/
|
|
7
|
+
export type TSsoProvisioningMode = 'jit' | 'scim-only' | 'jit-and-scim';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Maps an IdP-side group name to org roles on idp.global.
|
|
11
|
+
* Used both for SAML group attributes and SCIM group memberships.
|
|
12
|
+
*/
|
|
13
|
+
export interface IGroupRoleMapping {
|
|
14
|
+
/** Group name as sent by the customer IdP (SAML attribute value or SCIM group displayName) */
|
|
15
|
+
idpGroup: string;
|
|
16
|
+
/** Org roles granted while the user is a member of the group */
|
|
17
|
+
orgRoles: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optional SAML attribute name overrides. Sensible defaults are applied
|
|
22
|
+
* when unset (NameID for email, standard claim URIs for name/groups).
|
|
23
|
+
*/
|
|
24
|
+
export interface ISsoAttributeMapping {
|
|
25
|
+
email?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
groups?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* An org-level enterprise SSO connection. idp.global acts as the SAML
|
|
32
|
+
* service provider; the customer org brings their own IdP (Okta, Entra, ...).
|
|
33
|
+
*/
|
|
34
|
+
export interface ISsoConnection {
|
|
35
|
+
id: string;
|
|
36
|
+
data: {
|
|
37
|
+
organizationId: string;
|
|
38
|
+
/** Connection protocol. Only SAML for now; OIDC federation may follow. */
|
|
39
|
+
type: 'saml';
|
|
40
|
+
displayName: string;
|
|
41
|
+
status: 'active' | 'disabled';
|
|
42
|
+
/**
|
|
43
|
+
* Email domains routed to this connection during home-realm discovery.
|
|
44
|
+
* Globally unique across all connections.
|
|
45
|
+
*/
|
|
46
|
+
emailDomains: string[];
|
|
47
|
+
idp: {
|
|
48
|
+
/** IdP entityID from metadata */
|
|
49
|
+
entityId: string;
|
|
50
|
+
/** IdP single-sign-on URL (HTTP-Redirect binding) */
|
|
51
|
+
ssoUrl: string;
|
|
52
|
+
/**
|
|
53
|
+
* IdP signing certificates (PEM). Multiple entries allow zero-downtime
|
|
54
|
+
* certificate rollover on the customer side.
|
|
55
|
+
*/
|
|
56
|
+
signingCertificates: string[];
|
|
57
|
+
/** Raw uploaded metadata XML, kept for re-parsing and debugging */
|
|
58
|
+
metadataXml?: string;
|
|
59
|
+
};
|
|
60
|
+
provisioning: {
|
|
61
|
+
mode: TSsoProvisioningMode;
|
|
62
|
+
/** Org roles granted to every user of this connection */
|
|
63
|
+
defaultOrgRoles: string[];
|
|
64
|
+
};
|
|
65
|
+
groupMappings: IGroupRoleMapping[];
|
|
66
|
+
attributeMapping?: ISsoAttributeMapping;
|
|
67
|
+
createdAt: number;
|
|
68
|
+
updatedAt: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Internal persisted SCIM bearer token record. Never return this shape to
|
|
74
|
+
* clients; the plaintext token is shown exactly once at creation.
|
|
75
|
+
*/
|
|
76
|
+
export interface IScimTokenRecord {
|
|
77
|
+
id: string;
|
|
78
|
+
data: {
|
|
79
|
+
organizationId: string;
|
|
80
|
+
/** Human-readable label, e.g. "Okta production" */
|
|
81
|
+
label: string;
|
|
82
|
+
/** sha256 hash of the bearer token */
|
|
83
|
+
tokenHash: string;
|
|
84
|
+
/** First characters of the token for display purposes */
|
|
85
|
+
tokenPrefix: string;
|
|
86
|
+
createdAt: number;
|
|
87
|
+
expiresAt?: number;
|
|
88
|
+
lastUsedAt?: number;
|
|
89
|
+
revoked: boolean;
|
|
90
|
+
};
|
|
91
|
+
}
|
package/ts/data/user.ts
CHANGED
|
@@ -32,5 +32,27 @@ export interface IUser {
|
|
|
32
32
|
* to manage global apps, view platform stats, etc.
|
|
33
33
|
*/
|
|
34
34
|
isGlobalAdmin?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Links to external identities established via enterprise SSO.
|
|
37
|
+
* One entry per SSO connection the user has signed in through.
|
|
38
|
+
*/
|
|
39
|
+
externalIdentities?: {
|
|
40
|
+
/** The ISsoConnection id this identity belongs to */
|
|
41
|
+
connectionId: string;
|
|
42
|
+
/** Stable subject identifier at the customer IdP (SAML NameID) */
|
|
43
|
+
subjectId: string;
|
|
44
|
+
}[];
|
|
45
|
+
/**
|
|
46
|
+
* SCIM provisioning state. Present when the user is managed by an
|
|
47
|
+
* org's SCIM integration.
|
|
48
|
+
*/
|
|
49
|
+
scim?: {
|
|
50
|
+
/** externalId assigned by the provisioning IdP */
|
|
51
|
+
externalId?: string;
|
|
52
|
+
/** The ISsoConnection id whose SCIM integration manages this user */
|
|
53
|
+
provisionedByConnectionId?: string;
|
|
54
|
+
/** SCIM-side active flag; false after deprovisioning */
|
|
55
|
+
active?: boolean;
|
|
56
|
+
};
|
|
35
57
|
};
|
|
36
58
|
}
|
package/ts/dto/index.ts
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { TSsoProvisioningMode, IGroupRoleMapping, ISsoAttributeMapping } from '../data/ssoconnection.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Client-facing SSO connection shape. IdP signing certificates are public
|
|
5
|
+
* material and stay included; the raw metadata XML is omitted.
|
|
6
|
+
*/
|
|
7
|
+
export interface ISsoConnectionDto {
|
|
8
|
+
id: string;
|
|
9
|
+
data: {
|
|
10
|
+
organizationId: string;
|
|
11
|
+
type: 'saml';
|
|
12
|
+
displayName: string;
|
|
13
|
+
status: 'active' | 'disabled';
|
|
14
|
+
emailDomains: string[];
|
|
15
|
+
idp: {
|
|
16
|
+
entityId: string;
|
|
17
|
+
ssoUrl: string;
|
|
18
|
+
signingCertificates: string[];
|
|
19
|
+
};
|
|
20
|
+
provisioning: {
|
|
21
|
+
mode: TSsoProvisioningMode;
|
|
22
|
+
defaultOrgRoles: string[];
|
|
23
|
+
};
|
|
24
|
+
groupMappings: IGroupRoleMapping[];
|
|
25
|
+
attributeMapping?: ISsoAttributeMapping;
|
|
26
|
+
createdAt: number;
|
|
27
|
+
updatedAt: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Client-facing SCIM token shape. Never carries the token hash; the
|
|
33
|
+
* plaintext token is returned exactly once by createScimToken.
|
|
34
|
+
*/
|
|
35
|
+
export interface IScimTokenDto {
|
|
36
|
+
id: string;
|
|
37
|
+
data: {
|
|
38
|
+
organizationId: string;
|
|
39
|
+
label: string;
|
|
40
|
+
tokenPrefix: string;
|
|
41
|
+
createdAt: number;
|
|
42
|
+
expiresAt?: number;
|
|
43
|
+
lastUsedAt?: number;
|
|
44
|
+
revoked: boolean;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Service-provider side details an org admin needs to configure their IdP.
|
|
50
|
+
*/
|
|
51
|
+
export interface ISsoSpDetailsDto {
|
|
52
|
+
/** SP entityID to register at the customer IdP */
|
|
53
|
+
spEntityId: string;
|
|
54
|
+
/** Assertion consumer service URL (HTTP-POST binding) */
|
|
55
|
+
acsUrl: string;
|
|
56
|
+
/** URL serving the SP metadata XML */
|
|
57
|
+
metadataUrl: string;
|
|
58
|
+
/** Base URL of the SCIM v2 endpoint for this org */
|
|
59
|
+
scimBaseUrl: string;
|
|
60
|
+
}
|
package/ts/request/index.ts
CHANGED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
2
|
+
import * as dto from '../dto/index.js';
|
|
3
|
+
import * as plugins from '../plugins.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* List the SSO connections of an organization (org admin only)
|
|
7
|
+
*/
|
|
8
|
+
export interface IReq_GetSsoConnections
|
|
9
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
10
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
11
|
+
IReq_GetSsoConnections
|
|
12
|
+
> {
|
|
13
|
+
method: 'getSsoConnections';
|
|
14
|
+
request: {
|
|
15
|
+
jwt: string;
|
|
16
|
+
organizationId: string;
|
|
17
|
+
};
|
|
18
|
+
response: {
|
|
19
|
+
connections: dto.ISsoConnectionDto[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Create an SSO connection for an organization (org admin only).
|
|
25
|
+
* Either metadataXml or the manual idp fields must be provided.
|
|
26
|
+
*/
|
|
27
|
+
export interface IReq_CreateSsoConnection
|
|
28
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
29
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
30
|
+
IReq_CreateSsoConnection
|
|
31
|
+
> {
|
|
32
|
+
method: 'createSsoConnection';
|
|
33
|
+
request: {
|
|
34
|
+
jwt: string;
|
|
35
|
+
organizationId: string;
|
|
36
|
+
displayName: string;
|
|
37
|
+
emailDomains: string[];
|
|
38
|
+
/** IdP metadata XML; parsed server-side when provided */
|
|
39
|
+
metadataXml?: string;
|
|
40
|
+
/** Manual IdP configuration, used when metadataXml is absent */
|
|
41
|
+
idp?: {
|
|
42
|
+
entityId: string;
|
|
43
|
+
ssoUrl: string;
|
|
44
|
+
signingCertificates: string[];
|
|
45
|
+
};
|
|
46
|
+
provisioning: {
|
|
47
|
+
mode: data.TSsoProvisioningMode;
|
|
48
|
+
defaultOrgRoles: string[];
|
|
49
|
+
};
|
|
50
|
+
groupMappings?: data.IGroupRoleMapping[];
|
|
51
|
+
attributeMapping?: data.ISsoAttributeMapping;
|
|
52
|
+
};
|
|
53
|
+
response: {
|
|
54
|
+
connection: dto.ISsoConnectionDto;
|
|
55
|
+
spDetails: dto.ISsoSpDetailsDto;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Update an SSO connection (org admin only). Only provided fields change.
|
|
61
|
+
*/
|
|
62
|
+
export interface IReq_UpdateSsoConnection
|
|
63
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
64
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
65
|
+
IReq_UpdateSsoConnection
|
|
66
|
+
> {
|
|
67
|
+
method: 'updateSsoConnection';
|
|
68
|
+
request: {
|
|
69
|
+
jwt: string;
|
|
70
|
+
connectionId: string;
|
|
71
|
+
displayName?: string;
|
|
72
|
+
status?: 'active' | 'disabled';
|
|
73
|
+
emailDomains?: string[];
|
|
74
|
+
metadataXml?: string;
|
|
75
|
+
idp?: {
|
|
76
|
+
entityId: string;
|
|
77
|
+
ssoUrl: string;
|
|
78
|
+
signingCertificates: string[];
|
|
79
|
+
};
|
|
80
|
+
provisioning?: {
|
|
81
|
+
mode: data.TSsoProvisioningMode;
|
|
82
|
+
defaultOrgRoles: string[];
|
|
83
|
+
};
|
|
84
|
+
groupMappings?: data.IGroupRoleMapping[];
|
|
85
|
+
attributeMapping?: data.ISsoAttributeMapping;
|
|
86
|
+
};
|
|
87
|
+
response: {
|
|
88
|
+
connection: dto.ISsoConnectionDto;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Delete an SSO connection (org admin only)
|
|
94
|
+
*/
|
|
95
|
+
export interface IReq_DeleteSsoConnection
|
|
96
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
97
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
98
|
+
IReq_DeleteSsoConnection
|
|
99
|
+
> {
|
|
100
|
+
method: 'deleteSsoConnection';
|
|
101
|
+
request: {
|
|
102
|
+
jwt: string;
|
|
103
|
+
connectionId: string;
|
|
104
|
+
};
|
|
105
|
+
response: {
|
|
106
|
+
success: boolean;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Get the SP-side details (entityId, ACS URL, metadata URL, SCIM base URL)
|
|
112
|
+
* an org admin needs to configure the customer IdP (org admin only)
|
|
113
|
+
*/
|
|
114
|
+
export interface IReq_GetSsoSpDetails
|
|
115
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
116
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
117
|
+
IReq_GetSsoSpDetails
|
|
118
|
+
> {
|
|
119
|
+
method: 'getSsoSpDetails';
|
|
120
|
+
request: {
|
|
121
|
+
jwt: string;
|
|
122
|
+
connectionId: string;
|
|
123
|
+
};
|
|
124
|
+
response: {
|
|
125
|
+
spDetails: dto.ISsoSpDetailsDto;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Create a SCIM bearer token for an organization (org admin only).
|
|
131
|
+
* The plaintext token is returned exactly once.
|
|
132
|
+
*/
|
|
133
|
+
export interface IReq_CreateScimToken
|
|
134
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
135
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
136
|
+
IReq_CreateScimToken
|
|
137
|
+
> {
|
|
138
|
+
method: 'createScimToken';
|
|
139
|
+
request: {
|
|
140
|
+
jwt: string;
|
|
141
|
+
organizationId: string;
|
|
142
|
+
label: string;
|
|
143
|
+
/** Optional expiry timestamp (epoch ms) */
|
|
144
|
+
expiresAt?: number;
|
|
145
|
+
};
|
|
146
|
+
response: {
|
|
147
|
+
token: dto.IScimTokenDto;
|
|
148
|
+
/** Plaintext bearer token; shown exactly once */
|
|
149
|
+
plaintextToken: string;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* List the SCIM tokens of an organization (org admin only)
|
|
155
|
+
*/
|
|
156
|
+
export interface IReq_GetScimTokens
|
|
157
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
158
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
159
|
+
IReq_GetScimTokens
|
|
160
|
+
> {
|
|
161
|
+
method: 'getScimTokens';
|
|
162
|
+
request: {
|
|
163
|
+
jwt: string;
|
|
164
|
+
organizationId: string;
|
|
165
|
+
};
|
|
166
|
+
response: {
|
|
167
|
+
tokens: dto.IScimTokenDto[];
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Revoke a SCIM token (org admin only)
|
|
173
|
+
*/
|
|
174
|
+
export interface IReq_RevokeScimToken
|
|
175
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
176
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
177
|
+
IReq_RevokeScimToken
|
|
178
|
+
> {
|
|
179
|
+
method: 'revokeScimToken';
|
|
180
|
+
request: {
|
|
181
|
+
jwt: string;
|
|
182
|
+
tokenId: string;
|
|
183
|
+
};
|
|
184
|
+
response: {
|
|
185
|
+
success: boolean;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Public home-realm discovery: given an email address, reports whether an
|
|
191
|
+
* active SSO connection covers its domain. Discloses domain-level presence
|
|
192
|
+
* only (standard Okta-style HRD behavior); no account information.
|
|
193
|
+
*/
|
|
194
|
+
export interface IReq_DiscoverSsoForEmail
|
|
195
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
196
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
197
|
+
IReq_DiscoverSsoForEmail
|
|
198
|
+
> {
|
|
199
|
+
method: 'discoverSsoForEmail';
|
|
200
|
+
request: {
|
|
201
|
+
email: string;
|
|
202
|
+
};
|
|
203
|
+
response: {
|
|
204
|
+
ssoAvailable: boolean;
|
|
205
|
+
/** Relative login path to start the SAML flow when available */
|
|
206
|
+
loginUrl?: string;
|
|
207
|
+
};
|
|
208
|
+
}
|