@idp.global/interfaces 13.0.0 → 14.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 +22 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/appconnection.d.ts +1 -1
- package/dist_ts/data/loginsession.d.ts +24 -4
- package/dist_ts/data/organization.d.ts +2 -2
- package/dist_ts/data/role.d.ts +1 -1
- package/dist_ts/data/user.d.ts +6 -25
- package/dist_ts/dto/organization.d.ts +1 -1
- package/dist_ts/request/registration.d.ts +5 -2
- package/dist_ts/request/registration.js +1 -2
- package/package.json +1 -1
- package/readme.md +11 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/appconnection.ts +1 -1
- package/ts/data/loginsession.ts +24 -4
- package/ts/data/organization.ts +2 -2
- package/ts/data/role.ts +1 -1
- package/ts/data/user.ts +6 -25
- package/ts/dto/organization.ts +1 -1
- package/ts/readme.md +8 -4
- package/ts/request/registration.ts +6 -2
package/changelog.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-07-17 - 14.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- represent ordinary nullable SmartData persistence values explicitly as
|
|
8
|
+
`null`, including app role mappings, rotated refresh-token hashes,
|
|
9
|
+
organization billing and role-definition data, and optional user profile,
|
|
10
|
+
credential, administrator, and external-identity state
|
|
11
|
+
- expose nullable organization billing-plan state in the organization DTO while
|
|
12
|
+
keeping absence-sensitive invitation, deletion-state, sparse-index, and
|
|
13
|
+
lifecycle contracts unchanged
|
|
14
|
+
- require current login-session ownership and timestamps plus user creation
|
|
15
|
+
timestamps, remove transient plaintext password and legacy embedded SCIM state
|
|
16
|
+
from persisted users, and give registration its own minimal input contract
|
|
17
|
+
|
|
18
|
+
## 2026-07-16 - 13.1.0
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- add `data.ILoginSession.data.transferTargetHash` so an outstanding transfer token, its expiry, and its canonical authorized target binding can be persisted and cleared atomically without storing a raw target URL
|
|
23
|
+
- document and test that `IReq_ExchangeRefreshTokenAndTransferToken` requires `transferTarget` for both transfer-token issue and consume requests
|
|
24
|
+
|
|
3
25
|
## 2026-07-16 - 13.0.0
|
|
4
26
|
|
|
5
27
|
### Breaking Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@idp.global/interfaces',
|
|
6
|
-
version: '
|
|
6
|
+
version: '14.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,13 +1,33 @@
|
|
|
1
1
|
export interface ILoginSession {
|
|
2
2
|
id: string;
|
|
3
3
|
data: {
|
|
4
|
-
userId: string
|
|
4
|
+
userId: string;
|
|
5
5
|
validUntil: number;
|
|
6
6
|
invalidated: boolean;
|
|
7
7
|
refreshTokenHash?: string | null;
|
|
8
|
-
rotatedRefreshTokenHashes?: string[];
|
|
8
|
+
rotatedRefreshTokenHashes?: string[] | null;
|
|
9
|
+
/**
|
|
10
|
+
* Hash of the single outstanding opaque transfer token.
|
|
11
|
+
*
|
|
12
|
+
* This field, `transferTokenExpiresAt`, and `transferTargetHash` describe
|
|
13
|
+
* one transfer grant and must be set, replaced, and cleared together in a
|
|
14
|
+
* single atomic persistence operation.
|
|
15
|
+
*/
|
|
9
16
|
transferTokenHash?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Absolute expiry time, in Unix epoch milliseconds, for the outstanding
|
|
19
|
+
* transfer grant.
|
|
20
|
+
*/
|
|
10
21
|
transferTokenExpiresAt?: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Server-derived binding hash of the canonical, authorized
|
|
24
|
+
* `ITransferTarget.appUrl` for the outstanding transfer grant.
|
|
25
|
+
*
|
|
26
|
+
* Implementations must never persist the raw target URL in login-session
|
|
27
|
+
* data. This field must be set, replaced, and cleared atomically with
|
|
28
|
+
* `transferTokenHash` and `transferTokenExpiresAt`.
|
|
29
|
+
*/
|
|
30
|
+
transferTargetHash?: string | null;
|
|
11
31
|
/**
|
|
12
32
|
* a device id that can be used to share the login session
|
|
13
33
|
* in different contexts on the same device
|
|
@@ -25,10 +45,10 @@ export interface ILoginSession {
|
|
|
25
45
|
/**
|
|
26
46
|
* When this session was created
|
|
27
47
|
*/
|
|
28
|
-
createdAt
|
|
48
|
+
createdAt: number;
|
|
29
49
|
/**
|
|
30
50
|
* Last time this session was active (e.g., refreshed)
|
|
31
51
|
*/
|
|
32
|
-
lastActive
|
|
52
|
+
lastActive: number;
|
|
33
53
|
};
|
|
34
54
|
}
|
|
@@ -5,8 +5,8 @@ export interface IOrganization {
|
|
|
5
5
|
name: string;
|
|
6
6
|
slug: string;
|
|
7
7
|
status: 'active' | 'suspended' | 'deleting';
|
|
8
|
-
billingPlanId: string;
|
|
8
|
+
billingPlanId: string | null;
|
|
9
9
|
roleIds: string[];
|
|
10
|
-
roleDefinitions?: IOrgRoleDefinition[];
|
|
10
|
+
roleDefinitions?: IOrgRoleDefinition[] | null;
|
|
11
11
|
};
|
|
12
12
|
}
|
package/dist_ts/data/role.d.ts
CHANGED
package/dist_ts/data/user.d.ts
CHANGED
|
@@ -7,21 +7,14 @@ export interface IUser {
|
|
|
7
7
|
/**
|
|
8
8
|
* mobile number used for verification
|
|
9
9
|
*/
|
|
10
|
-
mobileNumber?: string;
|
|
11
|
-
/**
|
|
12
|
-
* only used during initial password setting
|
|
13
|
-
*/
|
|
14
|
-
password?: string;
|
|
10
|
+
mobileNumber?: string | null;
|
|
15
11
|
/**
|
|
16
12
|
* used for validation of passwords
|
|
17
13
|
*/
|
|
18
|
-
passwordHash?: string;
|
|
14
|
+
passwordHash?: string | null;
|
|
19
15
|
status: 'new' | 'active' | 'deleted' | 'suspended';
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
* field existed (derive from the Mongo ObjectId timestamp when missing)
|
|
23
|
-
*/
|
|
24
|
-
createdAt?: number;
|
|
16
|
+
/** epoch ms of account creation */
|
|
17
|
+
createdAt: number;
|
|
25
18
|
/**
|
|
26
19
|
* present while an account deletion is pending: the account is locked
|
|
27
20
|
* (status 'deleted') and housekeeping purges it after purgeAt.
|
|
@@ -41,7 +34,7 @@ export interface IUser {
|
|
|
41
34
|
* Users with this flag can access the global admin panel
|
|
42
35
|
* to manage global apps, view platform stats, etc.
|
|
43
36
|
*/
|
|
44
|
-
isGlobalAdmin?: boolean;
|
|
37
|
+
isGlobalAdmin?: boolean | null;
|
|
45
38
|
/**
|
|
46
39
|
* Links to external identities established via enterprise SSO.
|
|
47
40
|
* One entry per SSO connection the user has signed in through.
|
|
@@ -51,18 +44,6 @@ export interface IUser {
|
|
|
51
44
|
connectionId: string;
|
|
52
45
|
/** Stable subject identifier at the customer IdP (SAML NameID) */
|
|
53
46
|
subjectId: string;
|
|
54
|
-
}[];
|
|
55
|
-
/**
|
|
56
|
-
* SCIM provisioning state. Present when the user is managed by an
|
|
57
|
-
* org's SCIM integration.
|
|
58
|
-
*/
|
|
59
|
-
scim?: {
|
|
60
|
-
/** externalId assigned by the provisioning IdP */
|
|
61
|
-
externalId?: string;
|
|
62
|
-
/** The ISsoConnection id whose SCIM integration manages this user */
|
|
63
|
-
provisionedByConnectionId?: string;
|
|
64
|
-
/** SCIM-side active flag; false after deprovisioning */
|
|
65
|
-
active?: boolean;
|
|
66
|
-
};
|
|
47
|
+
}[] | null;
|
|
67
48
|
};
|
|
68
49
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import * as dto from '../dto/index.js';
|
|
3
|
-
|
|
3
|
+
export interface IRegistrationUserDataInput {
|
|
4
|
+
name?: string;
|
|
5
|
+
password?: string;
|
|
6
|
+
}
|
|
4
7
|
export interface IReq_FirstRegistration extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_FirstRegistration> {
|
|
5
8
|
method: 'firstRegistrationRequest';
|
|
6
9
|
request: {
|
|
@@ -32,7 +35,7 @@ export interface IReq_SetDataForRegistration extends plugins.typedRequestInterfa
|
|
|
32
35
|
method: 'setDataForRegistration';
|
|
33
36
|
request: {
|
|
34
37
|
token: string;
|
|
35
|
-
userData:
|
|
38
|
+
userData: IRegistrationUserDataInput;
|
|
36
39
|
};
|
|
37
40
|
response: {
|
|
38
41
|
status: 'ok' | 'not ok';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import * as dto from '../dto/index.js';
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnaXN0cmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvcmVxdWVzdC9yZWdpc3RyYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxLQUFLLEdBQUcsTUFBTSxpQkFBaUIsQ0FBQztBQUN2QyxPQUFPLEVBQWMsTUFBTSxrQkFBa0IsQ0FBQyJ9
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnaXN0cmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvcmVxdWVzdC9yZWdpc3RyYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxLQUFLLEdBQUcsTUFBTSxpQkFBaUIsQ0FBQyJ9
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -53,8 +53,12 @@ const organization: data.IOrganization = {
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
Persisted `data.IJwt` and `data.ILoginSession` shapes never contain plaintext
|
|
56
|
-
refresh tokens. Session persistence exposes only refresh-token
|
|
57
|
-
|
|
56
|
+
refresh or transfer tokens. Session persistence exposes only refresh-token
|
|
57
|
+
hashes, refresh-token rotation history, and the atomic transfer-grant tuple
|
|
58
|
+
`transferTokenHash`, `transferTokenExpiresAt`, and `transferTargetHash`.
|
|
59
|
+
The target hash is derived server-side from the canonical, authorized
|
|
60
|
+
`ITransferTarget.appUrl`; the raw target URL is never persisted in session
|
|
61
|
+
data. Opaque tokens and the transfer target remain limited to the request and
|
|
58
62
|
response contracts that transport them.
|
|
59
63
|
|
|
60
64
|
## TypedRequest Contracts
|
|
@@ -86,6 +90,11 @@ const transferRequest: request.IReq_ExchangeRefreshTokenAndTransferToken['reques
|
|
|
86
90
|
};
|
|
87
91
|
```
|
|
88
92
|
|
|
93
|
+
`transferTarget` is required both when a refresh token issues a transfer token
|
|
94
|
+
and when a transfer token is consumed. The server authorizes and canonicalizes
|
|
95
|
+
the target before binding its server-derived hash to the outstanding transfer
|
|
96
|
+
token.
|
|
97
|
+
|
|
89
98
|
Request groups cover login, registration, JWT refresh, user/session queries, organization membership, invitations, apps, billing, admin actions, alerts, passport device flows, password reset, device IDs, and OIDC authorization.
|
|
90
99
|
|
|
91
100
|
OIDC app contracts expose only client configuration and safe credential
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/appconnection.ts
CHANGED
package/ts/data/loginsession.ts
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
export interface ILoginSession {
|
|
2
2
|
id: string;
|
|
3
3
|
data: {
|
|
4
|
-
userId: string
|
|
4
|
+
userId: string;
|
|
5
5
|
validUntil: number;
|
|
6
6
|
invalidated: boolean;
|
|
7
7
|
refreshTokenHash?: string | null;
|
|
8
|
-
rotatedRefreshTokenHashes?: string[];
|
|
8
|
+
rotatedRefreshTokenHashes?: string[] | null;
|
|
9
|
+
/**
|
|
10
|
+
* Hash of the single outstanding opaque transfer token.
|
|
11
|
+
*
|
|
12
|
+
* This field, `transferTokenExpiresAt`, and `transferTargetHash` describe
|
|
13
|
+
* one transfer grant and must be set, replaced, and cleared together in a
|
|
14
|
+
* single atomic persistence operation.
|
|
15
|
+
*/
|
|
9
16
|
transferTokenHash?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Absolute expiry time, in Unix epoch milliseconds, for the outstanding
|
|
19
|
+
* transfer grant.
|
|
20
|
+
*/
|
|
10
21
|
transferTokenExpiresAt?: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Server-derived binding hash of the canonical, authorized
|
|
24
|
+
* `ITransferTarget.appUrl` for the outstanding transfer grant.
|
|
25
|
+
*
|
|
26
|
+
* Implementations must never persist the raw target URL in login-session
|
|
27
|
+
* data. This field must be set, replaced, and cleared atomically with
|
|
28
|
+
* `transferTokenHash` and `transferTokenExpiresAt`.
|
|
29
|
+
*/
|
|
30
|
+
transferTargetHash?: string | null;
|
|
11
31
|
/**
|
|
12
32
|
* a device id that can be used to share the login session
|
|
13
33
|
* in different contexts on the same device
|
|
@@ -25,10 +45,10 @@ export interface ILoginSession {
|
|
|
25
45
|
/**
|
|
26
46
|
* When this session was created
|
|
27
47
|
*/
|
|
28
|
-
createdAt
|
|
48
|
+
createdAt: number;
|
|
29
49
|
/**
|
|
30
50
|
* Last time this session was active (e.g., refreshed)
|
|
31
51
|
*/
|
|
32
|
-
lastActive
|
|
52
|
+
lastActive: number;
|
|
33
53
|
};
|
|
34
54
|
}
|
package/ts/data/organization.ts
CHANGED
|
@@ -8,8 +8,8 @@ export interface IOrganization {
|
|
|
8
8
|
name: string;
|
|
9
9
|
slug: string;
|
|
10
10
|
status: 'active' | 'suspended' | 'deleting';
|
|
11
|
-
billingPlanId: string;
|
|
11
|
+
billingPlanId: string | null;
|
|
12
12
|
roleIds: string[];
|
|
13
|
-
roleDefinitions?: IOrgRoleDefinition[];
|
|
13
|
+
roleDefinitions?: IOrgRoleDefinition[] | null;
|
|
14
14
|
};
|
|
15
15
|
}
|
package/ts/data/role.ts
CHANGED
package/ts/data/user.ts
CHANGED
|
@@ -11,21 +11,14 @@ export interface IUser {
|
|
|
11
11
|
/**
|
|
12
12
|
* mobile number used for verification
|
|
13
13
|
*/
|
|
14
|
-
mobileNumber?: string;
|
|
15
|
-
/**
|
|
16
|
-
* only used during initial password setting
|
|
17
|
-
*/
|
|
18
|
-
password?: string;
|
|
14
|
+
mobileNumber?: string | null;
|
|
19
15
|
/**
|
|
20
16
|
* used for validation of passwords
|
|
21
17
|
*/
|
|
22
|
-
passwordHash?: string;
|
|
18
|
+
passwordHash?: string | null;
|
|
23
19
|
status: 'new' | 'active' | 'deleted' | 'suspended';
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
* field existed (derive from the Mongo ObjectId timestamp when missing)
|
|
27
|
-
*/
|
|
28
|
-
createdAt?: number;
|
|
20
|
+
/** epoch ms of account creation */
|
|
21
|
+
createdAt: number;
|
|
29
22
|
/**
|
|
30
23
|
* present while an account deletion is pending: the account is locked
|
|
31
24
|
* (status 'deleted') and housekeeping purges it after purgeAt.
|
|
@@ -45,7 +38,7 @@ export interface IUser {
|
|
|
45
38
|
* Users with this flag can access the global admin panel
|
|
46
39
|
* to manage global apps, view platform stats, etc.
|
|
47
40
|
*/
|
|
48
|
-
isGlobalAdmin?: boolean;
|
|
41
|
+
isGlobalAdmin?: boolean | null;
|
|
49
42
|
/**
|
|
50
43
|
* Links to external identities established via enterprise SSO.
|
|
51
44
|
* One entry per SSO connection the user has signed in through.
|
|
@@ -55,18 +48,6 @@ export interface IUser {
|
|
|
55
48
|
connectionId: string;
|
|
56
49
|
/** Stable subject identifier at the customer IdP (SAML NameID) */
|
|
57
50
|
subjectId: string;
|
|
58
|
-
}[];
|
|
59
|
-
/**
|
|
60
|
-
* SCIM provisioning state. Present when the user is managed by an
|
|
61
|
-
* org's SCIM integration.
|
|
62
|
-
*/
|
|
63
|
-
scim?: {
|
|
64
|
-
/** externalId assigned by the provisioning IdP */
|
|
65
|
-
externalId?: string;
|
|
66
|
-
/** The ISsoConnection id whose SCIM integration manages this user */
|
|
67
|
-
provisionedByConnectionId?: string;
|
|
68
|
-
/** SCIM-side active flag; false after deprovisioning */
|
|
69
|
-
active?: boolean;
|
|
70
|
-
};
|
|
51
|
+
}[] | null;
|
|
71
52
|
};
|
|
72
53
|
}
|
package/ts/dto/organization.ts
CHANGED
package/ts/readme.md
CHANGED
|
@@ -117,10 +117,14 @@ type TGetValidationKeys = request.IReq_GetPublicKeysForValidation;
|
|
|
117
117
|
type TPushValidationKeys = request.IReq_PushPublicKeysForValidation;
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
Persisted JWT and login-session data contracts contain no plaintext refresh
|
|
121
|
-
tokens. Transfer-token exchange
|
|
122
|
-
contract with an `appUrl
|
|
123
|
-
shape.
|
|
120
|
+
Persisted JWT and login-session data contracts contain no plaintext refresh or
|
|
121
|
+
transfer tokens. Transfer-token exchange requires the minimal
|
|
122
|
+
`data.ITransferTarget` contract with an `appUrl` for both issue and consume; it
|
|
123
|
+
does not expose the removed flat legacy app shape. A session persists only the
|
|
124
|
+
atomic `transferTokenHash`, `transferTokenExpiresAt`, and `transferTargetHash`
|
|
125
|
+
tuple for an outstanding transfer grant. The target hash is derived
|
|
126
|
+
server-side from the canonical, authorized URL, and the raw URL is never
|
|
127
|
+
persisted in session data.
|
|
124
128
|
|
|
125
129
|
Public app contracts contain client type, callback and post-logout URIs,
|
|
126
130
|
allowed scopes, grant types, and bounded token lifetime settings. Secret hashes,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import * as dto from '../dto/index.js';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export interface IRegistrationUserDataInput {
|
|
5
|
+
name?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
}
|
|
4
8
|
|
|
5
9
|
export interface IReq_FirstRegistration
|
|
6
10
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
@@ -47,7 +51,7 @@ export interface IReq_SetDataForRegistration
|
|
|
47
51
|
method: 'setDataForRegistration';
|
|
48
52
|
request: {
|
|
49
53
|
token: string;
|
|
50
|
-
userData:
|
|
54
|
+
userData: IRegistrationUserDataInput;
|
|
51
55
|
};
|
|
52
56
|
response: {
|
|
53
57
|
status: 'ok' | 'not ok';
|