@fabrika/iam-contract 0.9.0-dev.32 → 0.9.0-dev.33
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/package.json +4 -4
- package/src/index.ts +35 -2
- package/src/password-policy.ts +1 -1
- package/types/src/index.d.ts +31 -2
- package/types/src/password-policy.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/iam-contract",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsrs --build tsconfig.lib.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@fabrika/app": "0.9.0-dev.
|
|
29
|
-
"@fabrika/auth-core": "0.9.0-dev.
|
|
30
|
-
"@fabrika/proxy-core": "0.9.0-dev.
|
|
28
|
+
"@fabrika/app": "0.9.0-dev.33",
|
|
29
|
+
"@fabrika/auth-core": "0.9.0-dev.33",
|
|
30
|
+
"@fabrika/proxy-core": "0.9.0-dev.33"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/index.ts
CHANGED
|
@@ -271,7 +271,7 @@ export interface ApiKeyDto {
|
|
|
271
271
|
|
|
272
272
|
/**
|
|
273
273
|
* One API key with its live credential, as `apiKeys.get` and each row of `apiKeys.list` answer it. Its permissions are
|
|
274
|
-
* its grants, edited with `grants.create` and `grants.delete` by an installation administrator and read again at every
|
|
274
|
+
* its grants, edited with `grants.create`, `grants.update` and `grants.delete` by an installation administrator and read again at every
|
|
275
275
|
* token exchange. An IAM older than the list's credential answers list rows without `credential`.
|
|
276
276
|
*/
|
|
277
277
|
export interface ApiKeyDetail extends ApiKeyDto {
|
|
@@ -279,6 +279,17 @@ export interface ApiKeyDetail extends ApiKeyDto {
|
|
|
279
279
|
credential: ApiKeyCredentialDto | null
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
+
/** A grant of `apiKeys.get`'s key, naming who granted it. */
|
|
283
|
+
export interface ApiKeyGrantDto extends GrantDto {
|
|
284
|
+
/** The granting principal's label, or its id when IAM no longer knows it; null when nobody granted it. */
|
|
285
|
+
grantedByLabel: string | null
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** `apiKeys.get`: one key whose grants name who granted them. */
|
|
289
|
+
export interface GetApiKeyResponse extends ApiKeyDetail {
|
|
290
|
+
grants: ApiKeyGrantDto[]
|
|
291
|
+
}
|
|
292
|
+
|
|
282
293
|
export interface ApiKeyCredentialDto {
|
|
283
294
|
/** The app the key mints tokens for; null = every app. A grant at another app never reaches the key's token. */
|
|
284
295
|
app: string | null
|
|
@@ -767,7 +778,7 @@ export interface IamAdminRpcContract {
|
|
|
767
778
|
}
|
|
768
779
|
apiKeys: {
|
|
769
780
|
list: RpcProcedure<ListApiKeysInput, CursorList<ApiKeyDetail>>
|
|
770
|
-
get: RpcProcedure<ApiKeyIdInput,
|
|
781
|
+
get: RpcProcedure<ApiKeyIdInput, GetApiKeyResponse>
|
|
771
782
|
provision: RpcProcedure<ProvisionApiKeyRequest, ProvisionApiKeyResponse>
|
|
772
783
|
rotate: RpcProcedure<RotateApiKeyInput, RotateApiKeyResponse>
|
|
773
784
|
revoke: RpcProcedure<ApiKeyIdInput, OkResponse>
|
|
@@ -826,6 +837,28 @@ export interface IamAdminRpcContract {
|
|
|
826
837
|
get: RpcProcedure<void, PasswordPolicyDto>
|
|
827
838
|
set: RpcProcedure<SetPasswordPolicyRequest, PasswordPolicyDto>
|
|
828
839
|
}
|
|
840
|
+
/**
|
|
841
|
+
* A person's second factor (TOTP), an installation administrator's (`iam.admin`) to read and to reset. The person
|
|
842
|
+
* enrols at IAM's `SECOND_FACTOR_ENROL_PATH`, never here. A reset removes the authenticator and its recovery codes
|
|
843
|
+
* and writes `iam.second_factor.reset`; the next sign-in asks for no code.
|
|
844
|
+
*/
|
|
845
|
+
secondFactor: {
|
|
846
|
+
get: RpcProcedure<PrincipalIdInput, SecondFactorDto>
|
|
847
|
+
reset: RpcProcedure<PrincipalIdInput, SecondFactorDto>
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/** Where a signed-in administrator enrols an authenticator app, on IAM's own origin. */
|
|
852
|
+
export const SECOND_FACTOR_ENROL_PATH = '/auth/second-factor/enrol'
|
|
853
|
+
|
|
854
|
+
/** A person's second factor as an installation administrator sees it. */
|
|
855
|
+
export interface SecondFactorDto {
|
|
856
|
+
/** When the person confirmed the authenticator, in epoch seconds; null when none is enrolled. */
|
|
857
|
+
enrolledAt: number | null
|
|
858
|
+
/** Recovery codes not used yet; 0 without an authenticator. */
|
|
859
|
+
recoveryCodesLeft: number
|
|
860
|
+
/** Whether this installation can enrol an authenticator at all: it holds the key that seals the secrets. */
|
|
861
|
+
available: boolean
|
|
829
862
|
}
|
|
830
863
|
|
|
831
864
|
export interface UserConnectionDto {
|
package/src/password-policy.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const PASSWORD_MIN_LENGTH_FLOOR = 4
|
|
|
14
14
|
/** The most code points a password may have, whatever the minimum. */
|
|
15
15
|
export const PASSWORD_MAX_LENGTH = 256
|
|
16
16
|
|
|
17
|
-
/** Below this NIST asks for a second factor, which IAM
|
|
17
|
+
/** Below this NIST asks for a second factor, which IAM gives only an enrolled administrator; the console says so. */
|
|
18
18
|
export const PASSWORD_SINGLE_FACTOR_FLOOR = 8
|
|
19
19
|
|
|
20
20
|
/** The password policy as IAM applies it now. */
|
package/types/src/index.d.ts
CHANGED
|
@@ -222,13 +222,22 @@ export interface ApiKeyDto {
|
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
224
|
* One API key with its live credential, as `apiKeys.get` and each row of `apiKeys.list` answer it. Its permissions are
|
|
225
|
-
* its grants, edited with `grants.create` and `grants.delete` by an installation administrator and read again at every
|
|
225
|
+
* its grants, edited with `grants.create`, `grants.update` and `grants.delete` by an installation administrator and read again at every
|
|
226
226
|
* token exchange. An IAM older than the list's credential answers list rows without `credential`.
|
|
227
227
|
*/
|
|
228
228
|
export interface ApiKeyDetail extends ApiKeyDto {
|
|
229
229
|
/** The key's live credential, or null when none is live (a revoked key). */
|
|
230
230
|
credential: ApiKeyCredentialDto | null;
|
|
231
231
|
}
|
|
232
|
+
/** A grant of `apiKeys.get`'s key, naming who granted it. */
|
|
233
|
+
export interface ApiKeyGrantDto extends GrantDto {
|
|
234
|
+
/** The granting principal's label, or its id when IAM no longer knows it; null when nobody granted it. */
|
|
235
|
+
grantedByLabel: string | null;
|
|
236
|
+
}
|
|
237
|
+
/** `apiKeys.get`: one key whose grants name who granted them. */
|
|
238
|
+
export interface GetApiKeyResponse extends ApiKeyDetail {
|
|
239
|
+
grants: ApiKeyGrantDto[];
|
|
240
|
+
}
|
|
232
241
|
export interface ApiKeyCredentialDto {
|
|
233
242
|
/** The app the key mints tokens for; null = every app. A grant at another app never reaches the key's token. */
|
|
234
243
|
app: string | null;
|
|
@@ -669,7 +678,7 @@ export interface IamAdminRpcContract {
|
|
|
669
678
|
};
|
|
670
679
|
apiKeys: {
|
|
671
680
|
list: RpcProcedure<ListApiKeysInput, CursorList<ApiKeyDetail>>;
|
|
672
|
-
get: RpcProcedure<ApiKeyIdInput,
|
|
681
|
+
get: RpcProcedure<ApiKeyIdInput, GetApiKeyResponse>;
|
|
673
682
|
provision: RpcProcedure<ProvisionApiKeyRequest, ProvisionApiKeyResponse>;
|
|
674
683
|
rotate: RpcProcedure<RotateApiKeyInput, RotateApiKeyResponse>;
|
|
675
684
|
revoke: RpcProcedure<ApiKeyIdInput, OkResponse>;
|
|
@@ -728,6 +737,26 @@ export interface IamAdminRpcContract {
|
|
|
728
737
|
get: RpcProcedure<void, PasswordPolicyDto>;
|
|
729
738
|
set: RpcProcedure<SetPasswordPolicyRequest, PasswordPolicyDto>;
|
|
730
739
|
};
|
|
740
|
+
/**
|
|
741
|
+
* A person's second factor (TOTP), an installation administrator's (`iam.admin`) to read and to reset. The person
|
|
742
|
+
* enrols at IAM's `SECOND_FACTOR_ENROL_PATH`, never here. A reset removes the authenticator and its recovery codes
|
|
743
|
+
* and writes `iam.second_factor.reset`; the next sign-in asks for no code.
|
|
744
|
+
*/
|
|
745
|
+
secondFactor: {
|
|
746
|
+
get: RpcProcedure<PrincipalIdInput, SecondFactorDto>;
|
|
747
|
+
reset: RpcProcedure<PrincipalIdInput, SecondFactorDto>;
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
/** Where a signed-in administrator enrols an authenticator app, on IAM's own origin. */
|
|
751
|
+
export declare const SECOND_FACTOR_ENROL_PATH = "/auth/second-factor/enrol";
|
|
752
|
+
/** A person's second factor as an installation administrator sees it. */
|
|
753
|
+
export interface SecondFactorDto {
|
|
754
|
+
/** When the person confirmed the authenticator, in epoch seconds; null when none is enrolled. */
|
|
755
|
+
enrolledAt: number | null;
|
|
756
|
+
/** Recovery codes not used yet; 0 without an authenticator. */
|
|
757
|
+
recoveryCodesLeft: number;
|
|
758
|
+
/** Whether this installation can enrol an authenticator at all: it holds the key that seals the secrets. */
|
|
759
|
+
available: boolean;
|
|
731
760
|
}
|
|
732
761
|
export interface UserConnectionDto {
|
|
733
762
|
id: string;
|
|
@@ -7,7 +7,7 @@ export declare const PASSWORD_DEFAULT_MIN_LENGTH = 15;
|
|
|
7
7
|
export declare const PASSWORD_MIN_LENGTH_FLOOR = 4;
|
|
8
8
|
/** The most code points a password may have, whatever the minimum. */
|
|
9
9
|
export declare const PASSWORD_MAX_LENGTH = 256;
|
|
10
|
-
/** Below this NIST asks for a second factor, which IAM
|
|
10
|
+
/** Below this NIST asks for a second factor, which IAM gives only an enrolled administrator; the console says so. */
|
|
11
11
|
export declare const PASSWORD_SINGLE_FACTOR_FLOOR = 8;
|
|
12
12
|
/** The password policy as IAM applies it now. */
|
|
13
13
|
export interface PasswordPolicyDto {
|