@idp.global/interfaces 12.0.0 → 13.1.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 +16 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/app.d.ts +2 -13
- package/dist_ts/data/jwt.d.ts +0 -4
- package/dist_ts/data/loginsession.d.ts +20 -4
- package/dist_ts/request/jwt.d.ts +9 -11
- package/dist_ts/request/login.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +28 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/app.ts +2 -13
- package/ts/data/jwt.ts +0 -5
- package/ts/data/loginsession.ts +20 -4
- package/ts/readme.md +12 -1
- package/ts/request/jwt.ts +11 -13
- package/ts/request/login.ts +1 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-07-16 - 13.1.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- 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
|
|
8
|
+
- document and test that `IReq_ExchangeRefreshTokenAndTransferToken` requires `transferTarget` for both transfer-token issue and consume requests
|
|
9
|
+
|
|
10
|
+
## 2026-07-16 - 13.0.0
|
|
11
|
+
|
|
12
|
+
### Breaking Changes
|
|
13
|
+
|
|
14
|
+
- remove persisted plaintext `refreshToken` fields from `data.IJwt` and `data.ILoginSession`; login-session persistence exposes hashed refresh-token state only
|
|
15
|
+
- remove the compatibility-only `data.IAppLegacy` shape and replace the transfer exchange request's `appData` field with `transferTarget: data.ITransferTarget`, containing only `appUrl`
|
|
16
|
+
- replace `IReq_GetPublicKeyForValidation` and `IReq_PushPublicKeyForValidation` with plural `IReq_GetPublicKeysForValidation` and `IReq_PushPublicKeysForValidation` contracts using the `getPublicKeysForValidation` and `pushPublicKeysForValidation` methods
|
|
17
|
+
- remove the singular top-level `publicKeyPem` payload from validation-key requests and responses; callers receive and push only the complete `publicKeys` keyset
|
|
18
|
+
|
|
3
19
|
## 2026-07-16 - 12.0.0
|
|
4
20
|
|
|
5
21
|
### Breaking Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@idp.global/interfaces',
|
|
6
|
-
version: '
|
|
6
|
+
version: '13.1.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=
|
package/dist_ts/data/app.d.ts
CHANGED
|
@@ -66,20 +66,9 @@ export interface ICustomOidcApp {
|
|
|
66
66
|
}
|
|
67
67
|
export type IApp = IGlobalApp | IPartnerApp | ICustomOidcApp;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
70
|
-
* that expects a flat app structure (e.g., idpclient, transfermanager)
|
|
69
|
+
* Browser destination used by the refresh/transfer-token exchange flow.
|
|
71
70
|
*/
|
|
72
|
-
export interface
|
|
73
|
-
/**
|
|
74
|
-
* must be unique
|
|
75
|
-
*/
|
|
76
|
-
id: string;
|
|
77
|
-
/**
|
|
78
|
-
* should be unique
|
|
79
|
-
*/
|
|
80
|
-
name: string;
|
|
81
|
-
description: string;
|
|
82
|
-
logoUrl: string;
|
|
71
|
+
export interface ITransferTarget {
|
|
83
72
|
appUrl: string;
|
|
84
73
|
}
|
|
85
74
|
/**
|
package/dist_ts/data/jwt.d.ts
CHANGED
|
@@ -29,10 +29,6 @@ export interface IJwt {
|
|
|
29
29
|
* an interval in millis to recheck token invalidation
|
|
30
30
|
*/
|
|
31
31
|
refreshEvery: number;
|
|
32
|
-
/**
|
|
33
|
-
* legacy field kept for compatibility with already-issued jwt documents
|
|
34
|
-
*/
|
|
35
|
-
refreshToken?: string;
|
|
36
32
|
/**
|
|
37
33
|
* just for looks/debugging
|
|
38
34
|
*/
|
|
@@ -4,14 +4,30 @@ export interface ILoginSession {
|
|
|
4
4
|
userId: string | null;
|
|
5
5
|
validUntil: number;
|
|
6
6
|
invalidated: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* legacy plaintext refresh token field kept so existing sessions can migrate on first use
|
|
9
|
-
*/
|
|
10
|
-
refreshToken?: string | null;
|
|
11
7
|
refreshTokenHash?: string | null;
|
|
12
8
|
rotatedRefreshTokenHashes?: string[];
|
|
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
|
+
*/
|
|
13
16
|
transferTokenHash?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Absolute expiry time, in Unix epoch milliseconds, for the outstanding
|
|
19
|
+
* transfer grant.
|
|
20
|
+
*/
|
|
14
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;
|
|
15
31
|
/**
|
|
16
32
|
* a device id that can be used to share the login session
|
|
17
33
|
* in different contexts on the same device
|
package/dist_ts/request/jwt.d.ts
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
import * as data from '../data/index.js';
|
|
2
2
|
import * as plugins from '../plugins.js';
|
|
3
3
|
/**
|
|
4
|
-
* Request to get the public
|
|
4
|
+
* Request to get the public keyset for JWT validation.
|
|
5
5
|
*
|
|
6
6
|
* **Direction:** Client → idp.global
|
|
7
7
|
* **Requester:** Backend services that need to verify JWTs
|
|
8
8
|
* **Handler:** idp.global
|
|
9
9
|
*
|
|
10
|
-
* Use this to fetch
|
|
10
|
+
* Use this to fetch every currently accepted public key for verifying JWT signatures.
|
|
11
11
|
* The backend token authenticates the requesting service.
|
|
12
12
|
*/
|
|
13
|
-
export interface
|
|
14
|
-
method: '
|
|
13
|
+
export interface IReq_GetPublicKeysForValidation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetPublicKeysForValidation> {
|
|
14
|
+
method: 'getPublicKeysForValidation';
|
|
15
15
|
request: {
|
|
16
16
|
backendToken: string;
|
|
17
17
|
};
|
|
18
18
|
response: {
|
|
19
|
-
publicKeyPem: string;
|
|
20
19
|
publicKeys: data.IJwtVerificationKey[];
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
24
|
-
* Push public
|
|
23
|
+
* Push the complete public keyset to connected backend services for JWT validation.
|
|
25
24
|
*
|
|
26
25
|
* **Direction:** idp.global → Client
|
|
27
26
|
* **Requester:** idp.global (pushes when the JWT signing key rotates)
|
|
28
27
|
* **Handler:** Backend services - must register a TypedHandler for this method
|
|
29
28
|
*
|
|
30
|
-
* Backend services
|
|
31
|
-
*
|
|
29
|
+
* Backend services must register a matching handler to receive key-rotation
|
|
30
|
+
* updates and replace their local verification keyset.
|
|
32
31
|
*/
|
|
33
|
-
export interface
|
|
34
|
-
method: '
|
|
32
|
+
export interface IReq_PushPublicKeysForValidation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_PushPublicKeysForValidation> {
|
|
33
|
+
method: 'pushPublicKeysForValidation';
|
|
35
34
|
request: {
|
|
36
|
-
publicKeyPem: string;
|
|
37
35
|
publicKeys: data.IJwtVerificationKey[];
|
|
38
36
|
};
|
|
39
37
|
response: {};
|
|
@@ -62,7 +62,7 @@ export interface IReq_ExchangeRefreshTokenAndTransferToken extends plugins.typed
|
|
|
62
62
|
request: {
|
|
63
63
|
transferToken?: string;
|
|
64
64
|
refreshToken?: string;
|
|
65
|
-
|
|
65
|
+
transferTarget: data.ITransferTarget;
|
|
66
66
|
};
|
|
67
67
|
response: {
|
|
68
68
|
refreshToken?: string;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -52,6 +52,15 @@ const organization: data.IOrganization = {
|
|
|
52
52
|
};
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
Persisted `data.IJwt` and `data.ILoginSession` shapes never contain plaintext
|
|
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
|
|
62
|
+
response contracts that transport them.
|
|
63
|
+
|
|
55
64
|
## TypedRequest Contracts
|
|
56
65
|
|
|
57
66
|
Use `request` when registering handlers or creating typed clients with `@api.global/typedrequest` or `@api.global/typedsocket`.
|
|
@@ -67,6 +76,25 @@ const payload: LoginRequest['request'] = {
|
|
|
67
76
|
};
|
|
68
77
|
```
|
|
69
78
|
|
|
79
|
+
JWT verification-key distribution is keyset-only and uses plural method names:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
type GetValidationKeys = request.IReq_GetPublicKeysForValidation;
|
|
83
|
+
type PushValidationKeys = request.IReq_PushPublicKeysForValidation;
|
|
84
|
+
|
|
85
|
+
const transferRequest: request.IReq_ExchangeRefreshTokenAndTransferToken['request'] = {
|
|
86
|
+
refreshToken: 'opaque-refresh-token',
|
|
87
|
+
transferTarget: {
|
|
88
|
+
appUrl: 'https://app.example/',
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
```
|
|
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
|
+
|
|
70
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.
|
|
71
99
|
|
|
72
100
|
OIDC app contracts expose only client configuration and safe credential
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/app.ts
CHANGED
|
@@ -79,20 +79,9 @@ export interface ICustomOidcApp {
|
|
|
79
79
|
export type IApp = IGlobalApp | IPartnerApp | ICustomOidcApp;
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
* that expects a flat app structure (e.g., idpclient, transfermanager)
|
|
82
|
+
* Browser destination used by the refresh/transfer-token exchange flow.
|
|
84
83
|
*/
|
|
85
|
-
export interface
|
|
86
|
-
/**
|
|
87
|
-
* must be unique
|
|
88
|
-
*/
|
|
89
|
-
id: string;
|
|
90
|
-
/**
|
|
91
|
-
* should be unique
|
|
92
|
-
*/
|
|
93
|
-
name: string;
|
|
94
|
-
description: string;
|
|
95
|
-
logoUrl: string;
|
|
84
|
+
export interface ITransferTarget {
|
|
96
85
|
appUrl: string;
|
|
97
86
|
}
|
|
98
87
|
|
package/ts/data/jwt.ts
CHANGED
package/ts/data/loginsession.ts
CHANGED
|
@@ -4,14 +4,30 @@ export interface ILoginSession {
|
|
|
4
4
|
userId: string | null;
|
|
5
5
|
validUntil: number;
|
|
6
6
|
invalidated: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* legacy plaintext refresh token field kept so existing sessions can migrate on first use
|
|
9
|
-
*/
|
|
10
|
-
refreshToken?: string | null;
|
|
11
7
|
refreshTokenHash?: string | null;
|
|
12
8
|
rotatedRefreshTokenHashes?: string[];
|
|
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
|
+
*/
|
|
13
16
|
transferTokenHash?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Absolute expiry time, in Unix epoch milliseconds, for the outstanding
|
|
19
|
+
* transfer grant.
|
|
20
|
+
*/
|
|
14
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;
|
|
15
31
|
/**
|
|
16
32
|
* a device id that can be used to share the login session
|
|
17
33
|
* in different contexts on the same device
|
package/ts/readme.md
CHANGED
|
@@ -67,7 +67,7 @@ The `request` export includes typed request contracts for:
|
|
|
67
67
|
- organization CRUD-style requests
|
|
68
68
|
- invitations and membership changes
|
|
69
69
|
- app and admin actions
|
|
70
|
-
- billing and JWT validation support
|
|
70
|
+
- billing and JWT validation-keyset support
|
|
71
71
|
- alert and passport approval flows
|
|
72
72
|
- OIDC authorization preparation and completion
|
|
73
73
|
|
|
@@ -113,8 +113,19 @@ type TSessions = request.IReq_GetUserSessions['response']['sessions'];
|
|
|
113
113
|
type TUserInfo = data.IUserInfoResponse;
|
|
114
114
|
type TOidcSettings = data.IOidcSettings;
|
|
115
115
|
type TJwtVerificationKey = data.IJwtVerificationKey;
|
|
116
|
+
type TGetValidationKeys = request.IReq_GetPublicKeysForValidation;
|
|
117
|
+
type TPushValidationKeys = request.IReq_PushPublicKeysForValidation;
|
|
116
118
|
```
|
|
117
119
|
|
|
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.
|
|
128
|
+
|
|
118
129
|
Public app contracts contain client type, callback and post-logout URIs,
|
|
119
130
|
allowed scopes, grant types, and bounded token lifetime settings. Secret hashes,
|
|
120
131
|
private signing keys, and persistence records for authorization codes, access
|
package/ts/request/jwt.ts
CHANGED
|
@@ -2,48 +2,46 @@ import * as data from '../data/index.js';
|
|
|
2
2
|
import * as plugins from '../plugins.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Request to get the public
|
|
5
|
+
* Request to get the public keyset for JWT validation.
|
|
6
6
|
*
|
|
7
7
|
* **Direction:** Client → idp.global
|
|
8
8
|
* **Requester:** Backend services that need to verify JWTs
|
|
9
9
|
* **Handler:** idp.global
|
|
10
10
|
*
|
|
11
|
-
* Use this to fetch
|
|
11
|
+
* Use this to fetch every currently accepted public key for verifying JWT signatures.
|
|
12
12
|
* The backend token authenticates the requesting service.
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface IReq_GetPublicKeysForValidation
|
|
15
15
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
16
16
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
17
|
-
|
|
17
|
+
IReq_GetPublicKeysForValidation
|
|
18
18
|
> {
|
|
19
|
-
method: '
|
|
19
|
+
method: 'getPublicKeysForValidation';
|
|
20
20
|
request: {
|
|
21
21
|
backendToken: string;
|
|
22
22
|
};
|
|
23
23
|
response: {
|
|
24
|
-
publicKeyPem: string;
|
|
25
24
|
publicKeys: data.IJwtVerificationKey[];
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
|
-
* Push public
|
|
29
|
+
* Push the complete public keyset to connected backend services for JWT validation.
|
|
31
30
|
*
|
|
32
31
|
* **Direction:** idp.global → Client
|
|
33
32
|
* **Requester:** idp.global (pushes when the JWT signing key rotates)
|
|
34
33
|
* **Handler:** Backend services - must register a TypedHandler for this method
|
|
35
34
|
*
|
|
36
|
-
* Backend services
|
|
37
|
-
*
|
|
35
|
+
* Backend services must register a matching handler to receive key-rotation
|
|
36
|
+
* updates and replace their local verification keyset.
|
|
38
37
|
*/
|
|
39
|
-
export interface
|
|
38
|
+
export interface IReq_PushPublicKeysForValidation
|
|
40
39
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
41
40
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
42
|
-
|
|
41
|
+
IReq_PushPublicKeysForValidation
|
|
43
42
|
> {
|
|
44
|
-
method: '
|
|
43
|
+
method: 'pushPublicKeysForValidation';
|
|
45
44
|
request: {
|
|
46
|
-
publicKeyPem: string;
|
|
47
45
|
publicKeys: data.IJwtVerificationKey[];
|
|
48
46
|
};
|
|
49
47
|
response: {};
|
package/ts/request/login.ts
CHANGED