@idp.global/interfaces 30.2.0 → 30.3.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 +15 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/oidc.d.ts +2 -0
- package/dist_ts/data/user.d.ts +26 -0
- package/dist_ts/data/user.js +18 -1
- package/package.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/oidc.ts +2 -0
- package/ts/data/user.ts +35 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-11-12 - 30.3.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- a stored email verification on the user (data)
|
|
8
|
+
- `IUser.data.emailVerification` is required: `IUserEmailVerification` (`address`, `verifiedAt` in epoch ms, `method`)
|
|
9
|
+
or `null` while the current address is unverified. `address` always equals `IUser.data.email`; changing the email
|
|
10
|
+
resets the verification to `null`.
|
|
11
|
+
- Code that builds `IUser['data']` must now set `emailVerification` (the idp.global app is the only producer).
|
|
12
|
+
- `TUserEmailVerificationMethod` is the closed set `registration`, `sign-in-code`, `magic-link`, `password-reset`
|
|
13
|
+
and `fixture` (local development fixtures, never a proof of control); `userEmailVerificationMethods` lists it for
|
|
14
|
+
validators.
|
|
15
|
+
- `IIdTokenClaims.email_verified` and `IUserInfoResponse.email_verified` are documented as
|
|
16
|
+
`emailVerification !== null`, independent of the account `status`.
|
|
17
|
+
|
|
3
18
|
## 2026-11-12 - 30.2.0
|
|
4
19
|
|
|
5
20
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@idp.global/interfaces',
|
|
6
|
-
version: '30.
|
|
6
|
+
version: '30.3.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/oidc.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ export interface IIdTokenClaims {
|
|
|
78
78
|
preferred_username?: string;
|
|
79
79
|
picture?: string;
|
|
80
80
|
email?: string;
|
|
81
|
+
/** Whether `IUser.data.emailVerification` records a verification of `email`. */
|
|
81
82
|
email_verified?: boolean;
|
|
82
83
|
organizations?: IOrganizationClaim[];
|
|
83
84
|
roles?: string[];
|
|
@@ -104,6 +105,7 @@ export interface IUserInfoResponse {
|
|
|
104
105
|
preferred_username?: string;
|
|
105
106
|
picture?: string;
|
|
106
107
|
email?: string;
|
|
108
|
+
/** Whether `IUser.data.emailVerification` records a verification of `email`. */
|
|
107
109
|
email_verified?: boolean;
|
|
108
110
|
organizations?: IOrganizationClaim[];
|
|
109
111
|
roles?: string[];
|
package/dist_ts/data/user.d.ts
CHANGED
|
@@ -49,12 +49,38 @@ export type TAdministratorRecovery = IAdministratorRecoveryBase & ({
|
|
|
49
49
|
completedAt: number;
|
|
50
50
|
passkeyCredentialRef: string;
|
|
51
51
|
});
|
|
52
|
+
/**
|
|
53
|
+
* How idp.global learned that the user controls an email address. The set is closed:
|
|
54
|
+
* - `registration`: the registration's emailed code or link was confirmed before the
|
|
55
|
+
* account was created;
|
|
56
|
+
* - `sign-in-code`: an emailed sign-in code was entered;
|
|
57
|
+
* - `magic-link`: an emailed sign-in link was followed;
|
|
58
|
+
* - `password-reset`: an emailed password-reset link was completed;
|
|
59
|
+
* - `fixture`: a local development fixture (development IdP persona, seed data); nobody
|
|
60
|
+
* proved control of the address.
|
|
61
|
+
*/
|
|
62
|
+
export declare const userEmailVerificationMethods: readonly ['registration', 'sign-in-code', 'magic-link', 'password-reset', 'fixture'];
|
|
63
|
+
export type TUserEmailVerificationMethod = (typeof userEmailVerificationMethods)[number];
|
|
64
|
+
/** A verification of the user's current email address. */
|
|
65
|
+
export interface IUserEmailVerification {
|
|
66
|
+
/** The verified address; always equal to `IUser.data.email`. */
|
|
67
|
+
address: string;
|
|
68
|
+
/** epoch ms when the verification was recorded */
|
|
69
|
+
verifiedAt: number;
|
|
70
|
+
method: TUserEmailVerificationMethod;
|
|
71
|
+
}
|
|
52
72
|
export interface IUser {
|
|
53
73
|
id: string;
|
|
54
74
|
data: {
|
|
55
75
|
name: string;
|
|
56
76
|
username: string;
|
|
57
77
|
email: string;
|
|
78
|
+
/**
|
|
79
|
+
* The verification of `email`, or null while it is unverified. Changing `email`
|
|
80
|
+
* resets it to null. The OIDC `email_verified` claim is `emailVerification !== null`;
|
|
81
|
+
* the account `status` does not affect it.
|
|
82
|
+
*/
|
|
83
|
+
emailVerification: IUserEmailVerification | null;
|
|
58
84
|
/**
|
|
59
85
|
* mobile number used for verification
|
|
60
86
|
*/
|
package/dist_ts/data/user.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import {} from './role.js';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* How idp.global learned that the user controls an email address. The set is closed:
|
|
5
|
+
* - `registration`: the registration's emailed code or link was confirmed before the
|
|
6
|
+
* account was created;
|
|
7
|
+
* - `sign-in-code`: an emailed sign-in code was entered;
|
|
8
|
+
* - `magic-link`: an emailed sign-in link was followed;
|
|
9
|
+
* - `password-reset`: an emailed password-reset link was completed;
|
|
10
|
+
* - `fixture`: a local development fixture (development IdP persona, seed data); nobody
|
|
11
|
+
* proved control of the address.
|
|
12
|
+
*/
|
|
13
|
+
export const userEmailVerificationMethods = [
|
|
14
|
+
'registration',
|
|
15
|
+
'sign-in-code',
|
|
16
|
+
'magic-link',
|
|
17
|
+
'password-reset',
|
|
18
|
+
'fixture',
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2RhdGEvdXNlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQWMsTUFBTSxXQUFXLENBQUM7QUF1RXZDOzs7Ozs7Ozs7R0FTRztBQUNILE1BQU0sQ0FBQyxNQUFNLDRCQUE0QixHQUFHO0lBQzFDLGNBQWM7SUFDZCxjQUFjO0lBQ2QsWUFBWTtJQUNaLGdCQUFnQjtJQUNoQixTQUFTO0NBQ0QsQ0FBQyJ9
|
package/package.json
CHANGED
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/oidc.ts
CHANGED
|
@@ -87,6 +87,7 @@ export interface IIdTokenClaims {
|
|
|
87
87
|
|
|
88
88
|
// Email scope claims
|
|
89
89
|
email?: string;
|
|
90
|
+
/** Whether `IUser.data.emailVerification` records a verification of `email`. */
|
|
90
91
|
email_verified?: boolean;
|
|
91
92
|
|
|
92
93
|
// Custom claims for organizations scope
|
|
@@ -123,6 +124,7 @@ export interface IUserInfoResponse {
|
|
|
123
124
|
|
|
124
125
|
// Email scope
|
|
125
126
|
email?: string;
|
|
127
|
+
/** Whether `IUser.data.emailVerification` records a verification of `email`. */
|
|
126
128
|
email_verified?: boolean;
|
|
127
129
|
|
|
128
130
|
// Organizations scope (custom)
|
package/ts/data/user.ts
CHANGED
|
@@ -70,12 +70,47 @@ export type TAdministratorRecovery = IAdministratorRecoveryBase & (
|
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* How idp.global learned that the user controls an email address. The set is closed:
|
|
75
|
+
* - `registration`: the registration's emailed code or link was confirmed before the
|
|
76
|
+
* account was created;
|
|
77
|
+
* - `sign-in-code`: an emailed sign-in code was entered;
|
|
78
|
+
* - `magic-link`: an emailed sign-in link was followed;
|
|
79
|
+
* - `password-reset`: an emailed password-reset link was completed;
|
|
80
|
+
* - `fixture`: a local development fixture (development IdP persona, seed data); nobody
|
|
81
|
+
* proved control of the address.
|
|
82
|
+
*/
|
|
83
|
+
export const userEmailVerificationMethods = [
|
|
84
|
+
'registration',
|
|
85
|
+
'sign-in-code',
|
|
86
|
+
'magic-link',
|
|
87
|
+
'password-reset',
|
|
88
|
+
'fixture',
|
|
89
|
+
] as const;
|
|
90
|
+
|
|
91
|
+
export type TUserEmailVerificationMethod = (typeof userEmailVerificationMethods)[number];
|
|
92
|
+
|
|
93
|
+
/** A verification of the user's current email address. */
|
|
94
|
+
export interface IUserEmailVerification {
|
|
95
|
+
/** The verified address; always equal to `IUser.data.email`. */
|
|
96
|
+
address: string;
|
|
97
|
+
/** epoch ms when the verification was recorded */
|
|
98
|
+
verifiedAt: number;
|
|
99
|
+
method: TUserEmailVerificationMethod;
|
|
100
|
+
}
|
|
101
|
+
|
|
73
102
|
export interface IUser {
|
|
74
103
|
id: string;
|
|
75
104
|
data: {
|
|
76
105
|
name: string;
|
|
77
106
|
username: string;
|
|
78
107
|
email: string;
|
|
108
|
+
/**
|
|
109
|
+
* The verification of `email`, or null while it is unverified. Changing `email`
|
|
110
|
+
* resets it to null. The OIDC `email_verified` claim is `emailVerification !== null`;
|
|
111
|
+
* the account `status` does not affect it.
|
|
112
|
+
*/
|
|
113
|
+
emailVerification: IUserEmailVerification | null;
|
|
79
114
|
|
|
80
115
|
/**
|
|
81
116
|
* mobile number used for verification
|