@fabrika/iam-contract 0.9.0-dev.47 → 0.9.0-dev.49

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/iam-contract",
3
- "version": "0.9.0-dev.47",
3
+ "version": "0.9.0-dev.49",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  "test": "bun test"
28
28
  },
29
29
  "dependencies": {
30
- "@fabrika/app": "0.9.0-dev.47",
31
- "@fabrika/auth-core": "0.9.0-dev.47",
32
- "@fabrika/proxy-core": "0.9.0-dev.47"
30
+ "@fabrika/app": "0.9.0-dev.49",
31
+ "@fabrika/auth-core": "0.9.0-dev.49",
32
+ "@fabrika/proxy-core": "0.9.0-dev.49"
33
33
  }
34
34
  }
package/src/index.ts CHANGED
@@ -29,8 +29,6 @@ import type { InstallationBrand } from '@fabrika/proxy-core/brand'
29
29
  import type {
30
30
  ExternalAppDto,
31
31
  ExternalAppInput,
32
- ImportOAuthClientsRequest,
33
- ImportOAuthClientsResponse,
34
32
  OAuthClientDto,
35
33
  OAuthClientInput,
36
34
  PutExternalAppRequest,
@@ -38,18 +36,15 @@ import type {
38
36
  } from './oauth-registry'
39
37
  import type {
40
38
  IssuePasskeyChallengeRequest,
41
- PasskeyChallenge,
42
- PasskeyCreationOptions,
43
39
  PasskeyDto,
44
- PasskeyRequestOptions,
45
40
  PasskeyResetResponse,
46
- RegisterPasskeyRequest,
47
- RemovePasskeyRequest,
41
+ PasskeyStepUpChallenge,
48
42
  VerifiedPasskeyAssertion,
49
43
  VerifyPasskeyAssertionRequest,
50
44
  } from './passkeys'
51
45
  import type { PasswordPolicyDto, SetPasswordPolicyRequest } from './password-policy'
52
46
  import type { ProvisionRequestedApiKeyRequest, RequestedApiKey, RequestedApiKeyInput, RequestedApiKeyResponse } from './requested-keys'
47
+ import type { ScimSettingsDto, ScimTokenIssuedDto } from './scim'
53
48
 
54
49
  // ── Common wrappers ───────────────────────────────────────────────────────────
55
50
 
@@ -295,17 +290,27 @@ export const CREDENTIALS_MODES = ['off', 'person', 'refuse'] as const
295
290
 
296
291
  export type CredentialsMode = (typeof CREDENTIALS_MODES)[number]
297
292
 
293
+ /**
294
+ * What an environment does with an agent's `write` grant (ADR-0090 §5), as Control mirrors its `agent-write` category:
295
+ * `open` serves it, `passkey` serves it when the approving person confirms with a passkey, `refuse` never serves it.
296
+ */
297
+ export const AGENT_WRITE_GATES = ['open', 'passkey', 'refuse'] as const
298
+
299
+ export type AgentWriteGate = (typeof AGENT_WRITE_GATES)[number]
300
+
298
301
  /**
299
302
  * Control's mirror of an application environment's approval gates in IAM, set with the provisioning key (ADR-0083 §4,
300
- * §8): whether its console grants wait (`required`), and its `credentials` mode. `revision` is the environment's
301
- * protection revision: IAM ignores one older than it holds, and answers what it holds. A request without `credentials`
302
- * (an older Control's) clears IAM's mode, which then reads as `person`.
303
+ * §8, ADR-0090 §5): whether its console grants wait (`required`), its `credentials` mode and its `agentWrite` gate.
304
+ * `revision` is the environment's protection revision: IAM ignores one older than it holds, and answers what it holds. A
305
+ * request without `credentials` (an older Control's) clears IAM's mode, which then reads as `person`; one without
306
+ * `agentWrite` clears that gate, which then reads as `refuse`.
303
307
  */
304
308
  export interface SetGrantApprovalRequest {
305
309
  app: string
306
310
  required: boolean
307
311
  revision: number
308
312
  credentials?: CredentialsMode
313
+ agentWrite?: AgentWriteGate
309
314
  }
310
315
 
311
316
  // ── Apps (read-only; the live registry derived from the schema tables) ────────
@@ -967,8 +972,6 @@ export interface IamAdminRpcContract {
967
972
  list: RpcProcedure<void, ListResponse<OAuthClientDto>>
968
973
  put: RpcProcedure<PutOAuthClientRequest, OAuthClientDto>
969
974
  delete: RpcProcedure<OAuthClientInput, OkResponse>
970
- /** The deploy's one import of its client list, with the provisioning key; every later call writes nothing. */
971
- importOnce: RpcProcedure<ImportOAuthClientsRequest, ImportOAuthClientsResponse>
972
975
  }
973
976
  policies: {
974
977
  list: RpcProcedure<AppInput, ListResponse<PolicyDto>>
@@ -1044,6 +1047,17 @@ export interface IamAdminRpcContract {
1044
1047
  get: RpcProcedure<void, PasswordPolicyDto>
1045
1048
  set: RpcProcedure<SetPasswordPolicyRequest, PasswordPolicyDto>
1046
1049
  }
1050
+ /**
1051
+ * SCIM provisioning by the organization's identity provider (ADR-0091), an installation administrator's in a signed-in
1052
+ * session. `rotateToken` creates the installation's one token or replaces it (the old one stops working at once) and
1053
+ * answers the secret once; `revokeToken` removes it, after which every SCIM request is refused. Each writes
1054
+ * `iam.scim.token.rotate` or `iam.scim.token.revoke`.
1055
+ */
1056
+ scim: {
1057
+ get: RpcProcedure<void, ScimSettingsDto>
1058
+ rotateToken: RpcProcedure<void, ScimTokenIssuedDto>
1059
+ revokeToken: RpcProcedure<void, ScimSettingsDto>
1060
+ }
1047
1061
  /**
1048
1062
  * A person's second factor (TOTP), an installation administrator's (`iam.admin`) to read and to reset. The person
1049
1063
  * enrols at IAM's `SECOND_FACTOR_ENROL_PATH`, never here. A reset removes the authenticator and its recovery codes
@@ -1054,24 +1068,23 @@ export interface IamAdminRpcContract {
1054
1068
  reset: RpcProcedure<PrincipalIdInput, SecondFactorDto>
1055
1069
  }
1056
1070
  /**
1057
- * A person's passkeys. The first six are the caller's own and need a person in a signed-in session, never a `px_` key:
1058
- * the console runs the browser half of each ceremony. Registering another passkey while one exists, and removing one,
1059
- * take an assertion by one of the person's passkeys bound to that change. `challenge` and `verify` are the step-up
1060
- * seam: a challenge bound to an opaque string, and its verification against the same string. `listOf` and `reset`
1061
- * are an installation administrator's (`iam.admin`); the reset removes every passkey and writes `iam.passkey.reset`.
1071
+ * A person's passkeys. A person registers and removes their own on IAM's account page (`ACCOUNT_PAGE_PATH`).
1072
+ * `challenge` and `verify` are the step-up seam, for a person in a signed-in session, never a `px_` key: a challenge
1073
+ * bound to an opaque string, which the person answers on IAM's page at its `url`, and its verification against the
1074
+ * same string. `listOf` and `reset` are an installation administrator's (`iam.admin`); the reset removes every
1075
+ * passkey and writes `iam.passkey.reset`.
1062
1076
  */
1063
1077
  passkeys: {
1064
- list: RpcProcedure<void, ListResponse<PasskeyDto>>
1065
- registrationOptions: RpcProcedure<void, PasskeyChallenge<PasskeyCreationOptions>>
1066
- register: RpcProcedure<RegisterPasskeyRequest, PasskeyDto>
1067
- remove: RpcProcedure<RemovePasskeyRequest, OkResponse>
1068
- challenge: RpcProcedure<IssuePasskeyChallengeRequest, PasskeyChallenge<PasskeyRequestOptions>>
1078
+ challenge: RpcProcedure<IssuePasskeyChallengeRequest, PasskeyStepUpChallenge>
1069
1079
  verify: RpcProcedure<VerifyPasskeyAssertionRequest, VerifiedPasskeyAssertion>
1070
1080
  listOf: RpcProcedure<PrincipalIdInput, ListResponse<PasskeyDto>>
1071
1081
  reset: RpcProcedure<PrincipalIdInput, PasskeyResetResponse>
1072
1082
  }
1073
1083
  }
1074
1084
 
1085
+ /** The signed-in person's own page on IAM's origin: their connections and their passkeys. */
1086
+ export const ACCOUNT_PAGE_PATH = '/auth/account'
1087
+
1075
1088
  /** Where a signed-in administrator enrols an authenticator app, on IAM's own origin. */
1076
1089
  export const SECOND_FACTOR_ENROL_PATH = '/auth/second-factor/enrol'
1077
1090
 
@@ -1114,3 +1127,4 @@ export * from './oauth-registry'
1114
1127
  export * from './passkeys'
1115
1128
  export * from './password-policy'
1116
1129
  export * from './requested-keys'
1130
+ export * from './scim'
@@ -4,13 +4,6 @@
4
4
 
5
5
  import type { OAuthClientProvider, OAuthIdentityRole } from './oauth'
6
6
 
7
- /**
8
- * IAM's refusal of a registry write before the deploy imported its client list (release N of ADR-0089), answered with
9
- * HTTP 409. The console and the CLI match it to say what to do instead of showing a generic conflict.
10
- */
11
- export const OAUTH_REGISTRY_NOT_IMPORTED = 'IAM takes registry writes once a deploy of this release has imported the OAuth client list '
12
- + '(oauthClients.importOnce); until then it serves the clients of its OAUTH_CONFIG. Deploy the platform first.'
13
-
14
7
  /** How many clients one external application has. */
15
8
  export const MAX_EXTERNAL_APP_CLIENTS = 16
16
9
 
@@ -37,7 +30,7 @@ export interface PutExternalAppRequest {
37
30
 
38
31
  export interface ExternalAppDto {
39
32
  app: string
40
- /** Null for an application the deploy variable's import registered, which named none. */
33
+ /** Null for an application an earlier release's import of the deploy variable registered, which named none. */
41
34
  name: string | null
42
35
  resource: string
43
36
  /** Null when the application declares no roles. */
@@ -73,15 +66,3 @@ export interface PutOAuthClientRequest {
73
66
  export interface OAuthClientInput {
74
67
  clientId: string
75
68
  }
76
-
77
- /**
78
- * The deploy variable's list, imported once (release N of ADR-0089): each entry in the shape `OAUTH_CONFIG.clients`
79
- * takes, an `OAuthManagedClient` with an optional `metadataUrl`. IAM checks every entry again.
80
- */
81
- export interface ImportOAuthClientsRequest {
82
- clients: unknown[]
83
- }
84
-
85
- export type ImportOAuthClientsResponse =
86
- | { status: 'imported'; externalApps: string[]; oauthClients: string[] }
87
- | { status: 'already_imported' }
package/src/passkeys.ts CHANGED
@@ -1,5 +1,6 @@
1
- // A person's passkeys (WebAuthn), kept by IAM. The console runs the browser half of each ceremony; IAM issues the
2
- // challenge and verifies the answer. Every binary value travels base64url-encoded, as in WebAuthn's JSON encodings.
1
+ // A person's passkeys (WebAuthn), kept by IAM. Every ceremony runs on IAM's own pages, under IAM's host as the RP ID: the
2
+ // person registers and removes passkeys on IAM's account page, and a step-up another service asks for is answered on
3
+ // IAM's step-up page. Every binary value travels base64url-encoded, as in WebAuthn's JSON encodings.
3
4
 
4
5
  /** How long a ceremony's challenge can be answered, in seconds. */
5
6
  export const PASSKEY_CHALLENGE_TTL_SECONDS = 300
@@ -16,12 +17,18 @@ export const MAX_PASSKEYS_PER_PERSON = 20
16
17
  /** The error `type` of `passkeys.challenge`'s refusal to a person with no passkey, so a caller tells it from other 409s. */
17
18
  export const NO_PASSKEY_ERROR = 'no_passkey'
18
19
 
20
+ /**
21
+ * The prefix of the bindings IAM's own pages use. Another service never asks a step-up with one, and IAM's step-up page
22
+ * never answers one, so a check IAM asks for itself is answered only on the page that asked it.
23
+ */
24
+ export const IAM_BINDING_PREFIX = 'iam:'
25
+
19
26
  /** The binding of the assertion that registering another passkey takes, when the person already has one. */
20
- export const PASSKEY_REGISTRATION_BINDING = 'iam:passkeys.register'
27
+ export const PASSKEY_REGISTRATION_BINDING = `${IAM_BINDING_PREFIX}passkeys.register`
21
28
 
22
29
  /** The binding of the assertion that removing the passkey `passkeyId` takes. */
23
30
  export function passkeyRemovalBinding(passkeyId: string): string {
24
- return `iam:passkeys.remove:${passkeyId}`
31
+ return `${IAM_BINDING_PREFIX}passkeys.remove:${passkeyId}`
25
32
  }
26
33
 
27
34
  /** A passkey as its owner and an installation administrator see it. No key material. */
@@ -102,29 +109,26 @@ export interface PasskeyAssertion {
102
109
  credential: PasskeyAssertionCredential
103
110
  }
104
111
 
105
- export interface RegisterPasskeyRequest {
106
- challengeId: string
107
- label: string
108
- credential: PasskeyRegistrationCredential
109
- /** Required when the person already has a passkey: an assertion bound to `PASSKEY_REGISTRATION_BINDING`. */
110
- stepUp?: PasskeyAssertion
111
- }
112
-
113
- export interface RemovePasskeyRequest {
114
- passkeyId: string
115
- /** An assertion by one of the person's passkeys, bound to `passkeyRemovalBinding(passkeyId)`. */
116
- stepUp: PasskeyAssertion
117
- }
118
-
119
112
  export interface IssuePasskeyChallengeRequest {
120
113
  /** What the assertion is for, compared verbatim at verification. Opaque to IAM. */
121
114
  binding: string
122
115
  }
123
116
 
117
+ /**
118
+ * A step-up challenge IAM issued to the person: they answer it on IAM's page at `url` before `expiresAt` (epoch
119
+ * seconds), and its issuer then verifies it by `challengeId`.
120
+ */
121
+ export interface PasskeyStepUpChallenge {
122
+ challengeId: string
123
+ expiresAt: number
124
+ url: string
125
+ }
126
+
124
127
  export interface VerifyPasskeyAssertionRequest {
125
128
  /** The binding the challenge was issued with. */
126
129
  binding: string
127
- assertion: PasskeyAssertion
130
+ /** The challenge the person answered on IAM's step-up page. */
131
+ challengeId: string
128
132
  }
129
133
 
130
134
  /** A verified assertion: who answered, with which credential (its WebAuthn id, base64url), and when (epoch seconds). */
package/src/scim.ts ADDED
@@ -0,0 +1,19 @@
1
+ // SCIM provisioning (ADR-0091): the organization's identity provider creates, updates and deprovisions the
2
+ // installation's users at IAM's `/scim/v2`, with one bearer token an installation administrator creates and rotates.
3
+
4
+ /** The installation's SCIM provisioning as the console shows it. */
5
+ export interface ScimSettingsDto {
6
+ /** The tenant URL an identity provider is configured with: IAM's origin and `/scim/v2`. */
7
+ endpoint: string
8
+ /** Whether a token exists; without one IAM refuses every SCIM request. */
9
+ configured: boolean
10
+ /** When the current token was created, in epoch seconds; null without one. */
11
+ createdAt: number | null
12
+ }
13
+
14
+ /** A token just created: the secret is in this answer and nowhere else, ever again. */
15
+ export interface ScimTokenIssuedDto extends ScimSettingsDto {
16
+ configured: true
17
+ createdAt: number
18
+ token: string
19
+ }
@@ -1,10 +1,11 @@
1
1
  import type { RpcProcedureContract } from '@fabrika/app';
2
2
  import type { AppActionDef, AppDelegationDef, AppLinkMountDef, AppMemberItem, AppSchema, AppScopeDef, DimensionValue, Locale, PermissionEntry, PermissionSource, PrincipalAffiliation, PrincipalType, RoleDef, WorkloadKind } from '@fabrika/auth-core';
3
3
  import type { InstallationBrand } from '@fabrika/proxy-core/brand';
4
- import type { ExternalAppDto, ExternalAppInput, ImportOAuthClientsRequest, ImportOAuthClientsResponse, OAuthClientDto, OAuthClientInput, PutExternalAppRequest, PutOAuthClientRequest } from './oauth-registry';
5
- import type { IssuePasskeyChallengeRequest, PasskeyChallenge, PasskeyCreationOptions, PasskeyDto, PasskeyRequestOptions, PasskeyResetResponse, RegisterPasskeyRequest, RemovePasskeyRequest, VerifiedPasskeyAssertion, VerifyPasskeyAssertionRequest } from './passkeys';
4
+ import type { ExternalAppDto, ExternalAppInput, OAuthClientDto, OAuthClientInput, PutExternalAppRequest, PutOAuthClientRequest } from './oauth-registry';
5
+ import type { IssuePasskeyChallengeRequest, PasskeyDto, PasskeyResetResponse, PasskeyStepUpChallenge, VerifiedPasskeyAssertion, VerifyPasskeyAssertionRequest } from './passkeys';
6
6
  import type { PasswordPolicyDto, SetPasswordPolicyRequest } from './password-policy';
7
7
  import type { ProvisionRequestedApiKeyRequest, RequestedApiKey, RequestedApiKeyInput, RequestedApiKeyResponse } from './requested-keys';
8
+ import type { ScimSettingsDto, ScimTokenIssuedDto } from './scim';
8
9
  /** A plain list response. */
9
10
  export interface ListResponse<T> {
10
11
  items: T[];
@@ -228,17 +229,25 @@ export interface DecideGrantRequestInput {
228
229
  /** An environment's `credentials` mode as IAM keeps it for its own key issuance to a machine caller (ADR-0083 §8). */
229
230
  export declare const CREDENTIALS_MODES: readonly ["off", "person", "refuse"];
230
231
  export type CredentialsMode = (typeof CREDENTIALS_MODES)[number];
232
+ /**
233
+ * What an environment does with an agent's `write` grant (ADR-0090 §5), as Control mirrors its `agent-write` category:
234
+ * `open` serves it, `passkey` serves it when the approving person confirms with a passkey, `refuse` never serves it.
235
+ */
236
+ export declare const AGENT_WRITE_GATES: readonly ["open", "passkey", "refuse"];
237
+ export type AgentWriteGate = (typeof AGENT_WRITE_GATES)[number];
231
238
  /**
232
239
  * Control's mirror of an application environment's approval gates in IAM, set with the provisioning key (ADR-0083 §4,
233
- * §8): whether its console grants wait (`required`), and its `credentials` mode. `revision` is the environment's
234
- * protection revision: IAM ignores one older than it holds, and answers what it holds. A request without `credentials`
235
- * (an older Control's) clears IAM's mode, which then reads as `person`.
240
+ * §8, ADR-0090 §5): whether its console grants wait (`required`), its `credentials` mode and its `agentWrite` gate.
241
+ * `revision` is the environment's protection revision: IAM ignores one older than it holds, and answers what it holds. A
242
+ * request without `credentials` (an older Control's) clears IAM's mode, which then reads as `person`; one without
243
+ * `agentWrite` clears that gate, which then reads as `refuse`.
236
244
  */
237
245
  export interface SetGrantApprovalRequest {
238
246
  app: string;
239
247
  required: boolean;
240
248
  revision: number;
241
249
  credentials?: CredentialsMode;
250
+ agentWrite?: AgentWriteGate;
242
251
  }
243
252
  /** The set of app ids IAM knows about — the choices for a grant's `app`. */
244
253
  export interface AppDto {
@@ -834,8 +843,6 @@ export interface IamAdminRpcContract {
834
843
  list: RpcProcedure<void, ListResponse<OAuthClientDto>>;
835
844
  put: RpcProcedure<PutOAuthClientRequest, OAuthClientDto>;
836
845
  delete: RpcProcedure<OAuthClientInput, OkResponse>;
837
- /** The deploy's one import of its client list, with the provisioning key; every later call writes nothing. */
838
- importOnce: RpcProcedure<ImportOAuthClientsRequest, ImportOAuthClientsResponse>;
839
846
  };
840
847
  policies: {
841
848
  list: RpcProcedure<AppInput, ListResponse<PolicyDto>>;
@@ -911,6 +918,17 @@ export interface IamAdminRpcContract {
911
918
  get: RpcProcedure<void, PasswordPolicyDto>;
912
919
  set: RpcProcedure<SetPasswordPolicyRequest, PasswordPolicyDto>;
913
920
  };
921
+ /**
922
+ * SCIM provisioning by the organization's identity provider (ADR-0091), an installation administrator's in a signed-in
923
+ * session. `rotateToken` creates the installation's one token or replaces it (the old one stops working at once) and
924
+ * answers the secret once; `revokeToken` removes it, after which every SCIM request is refused. Each writes
925
+ * `iam.scim.token.rotate` or `iam.scim.token.revoke`.
926
+ */
927
+ scim: {
928
+ get: RpcProcedure<void, ScimSettingsDto>;
929
+ rotateToken: RpcProcedure<void, ScimTokenIssuedDto>;
930
+ revokeToken: RpcProcedure<void, ScimSettingsDto>;
931
+ };
914
932
  /**
915
933
  * A person's second factor (TOTP), an installation administrator's (`iam.admin`) to read and to reset. The person
916
934
  * enrols at IAM's `SECOND_FACTOR_ENROL_PATH`, never here. A reset removes the authenticator and its recovery codes
@@ -921,23 +939,21 @@ export interface IamAdminRpcContract {
921
939
  reset: RpcProcedure<PrincipalIdInput, SecondFactorDto>;
922
940
  };
923
941
  /**
924
- * A person's passkeys. The first six are the caller's own and need a person in a signed-in session, never a `px_` key:
925
- * the console runs the browser half of each ceremony. Registering another passkey while one exists, and removing one,
926
- * take an assertion by one of the person's passkeys bound to that change. `challenge` and `verify` are the step-up
927
- * seam: a challenge bound to an opaque string, and its verification against the same string. `listOf` and `reset`
928
- * are an installation administrator's (`iam.admin`); the reset removes every passkey and writes `iam.passkey.reset`.
942
+ * A person's passkeys. A person registers and removes their own on IAM's account page (`ACCOUNT_PAGE_PATH`).
943
+ * `challenge` and `verify` are the step-up seam, for a person in a signed-in session, never a `px_` key: a challenge
944
+ * bound to an opaque string, which the person answers on IAM's page at its `url`, and its verification against the
945
+ * same string. `listOf` and `reset` are an installation administrator's (`iam.admin`); the reset removes every
946
+ * passkey and writes `iam.passkey.reset`.
929
947
  */
930
948
  passkeys: {
931
- list: RpcProcedure<void, ListResponse<PasskeyDto>>;
932
- registrationOptions: RpcProcedure<void, PasskeyChallenge<PasskeyCreationOptions>>;
933
- register: RpcProcedure<RegisterPasskeyRequest, PasskeyDto>;
934
- remove: RpcProcedure<RemovePasskeyRequest, OkResponse>;
935
- challenge: RpcProcedure<IssuePasskeyChallengeRequest, PasskeyChallenge<PasskeyRequestOptions>>;
949
+ challenge: RpcProcedure<IssuePasskeyChallengeRequest, PasskeyStepUpChallenge>;
936
950
  verify: RpcProcedure<VerifyPasskeyAssertionRequest, VerifiedPasskeyAssertion>;
937
951
  listOf: RpcProcedure<PrincipalIdInput, ListResponse<PasskeyDto>>;
938
952
  reset: RpcProcedure<PrincipalIdInput, PasskeyResetResponse>;
939
953
  };
940
954
  }
955
+ /** The signed-in person's own page on IAM's origin: their connections and their passkeys. */
956
+ export declare const ACCOUNT_PAGE_PATH = "/auth/account";
941
957
  /** Where a signed-in administrator enrols an authenticator app, on IAM's own origin. */
942
958
  export declare const SECOND_FACTOR_ENROL_PATH = "/auth/second-factor/enrol";
943
959
  /** A person's second factor as an installation administrator sees it. */
@@ -966,3 +982,4 @@ export * from './oauth-registry';
966
982
  export * from './passkeys';
967
983
  export * from './password-policy';
968
984
  export * from './requested-keys';
985
+ export * from './scim';
@@ -1,9 +1,4 @@
1
1
  import type { OAuthClientProvider, OAuthIdentityRole } from './oauth';
2
- /**
3
- * IAM's refusal of a registry write before the deploy imported its client list (release N of ADR-0089), answered with
4
- * HTTP 409. The console and the CLI match it to say what to do instead of showing a generic conflict.
5
- */
6
- export declare const OAUTH_REGISTRY_NOT_IMPORTED: string;
7
2
  /** How many clients one external application has. */
8
3
  export declare const MAX_EXTERNAL_APP_CLIENTS = 16;
9
4
  /** One client of an external application: its client id, its exact redirect URIs and where IAM fetches its document. */
@@ -27,7 +22,7 @@ export interface PutExternalAppRequest {
27
22
  }
28
23
  export interface ExternalAppDto {
29
24
  app: string;
30
- /** Null for an application the deploy variable's import registered, which named none. */
25
+ /** Null for an application an earlier release's import of the deploy variable registered, which named none. */
31
26
  name: string | null;
32
27
  resource: string;
33
28
  /** Null when the application declares no roles. */
@@ -63,17 +58,3 @@ export interface PutOAuthClientRequest {
63
58
  export interface OAuthClientInput {
64
59
  clientId: string;
65
60
  }
66
- /**
67
- * The deploy variable's list, imported once (release N of ADR-0089): each entry in the shape `OAUTH_CONFIG.clients`
68
- * takes, an `OAuthManagedClient` with an optional `metadataUrl`. IAM checks every entry again.
69
- */
70
- export interface ImportOAuthClientsRequest {
71
- clients: unknown[];
72
- }
73
- export type ImportOAuthClientsResponse = {
74
- status: 'imported';
75
- externalApps: string[];
76
- oauthClients: string[];
77
- } | {
78
- status: 'already_imported';
79
- };
@@ -8,6 +8,11 @@ export declare const MAX_PASSKEY_BINDING_LENGTH = 512;
8
8
  export declare const MAX_PASSKEYS_PER_PERSON = 20;
9
9
  /** The error `type` of `passkeys.challenge`'s refusal to a person with no passkey, so a caller tells it from other 409s. */
10
10
  export declare const NO_PASSKEY_ERROR = "no_passkey";
11
+ /**
12
+ * The prefix of the bindings IAM's own pages use. Another service never asks a step-up with one, and IAM's step-up page
13
+ * never answers one, so a check IAM asks for itself is answered only on the page that asked it.
14
+ */
15
+ export declare const IAM_BINDING_PREFIX = "iam:";
11
16
  /** The binding of the assertion that registering another passkey takes, when the person already has one. */
12
17
  export declare const PASSKEY_REGISTRATION_BINDING = "iam:passkeys.register";
13
18
  /** The binding of the assertion that removing the passkey `passkeyId` takes. */
@@ -95,26 +100,24 @@ export interface PasskeyAssertion {
95
100
  challengeId: string;
96
101
  credential: PasskeyAssertionCredential;
97
102
  }
98
- export interface RegisterPasskeyRequest {
99
- challengeId: string;
100
- label: string;
101
- credential: PasskeyRegistrationCredential;
102
- /** Required when the person already has a passkey: an assertion bound to `PASSKEY_REGISTRATION_BINDING`. */
103
- stepUp?: PasskeyAssertion;
104
- }
105
- export interface RemovePasskeyRequest {
106
- passkeyId: string;
107
- /** An assertion by one of the person's passkeys, bound to `passkeyRemovalBinding(passkeyId)`. */
108
- stepUp: PasskeyAssertion;
109
- }
110
103
  export interface IssuePasskeyChallengeRequest {
111
104
  /** What the assertion is for, compared verbatim at verification. Opaque to IAM. */
112
105
  binding: string;
113
106
  }
107
+ /**
108
+ * A step-up challenge IAM issued to the person: they answer it on IAM's page at `url` before `expiresAt` (epoch
109
+ * seconds), and its issuer then verifies it by `challengeId`.
110
+ */
111
+ export interface PasskeyStepUpChallenge {
112
+ challengeId: string;
113
+ expiresAt: number;
114
+ url: string;
115
+ }
114
116
  export interface VerifyPasskeyAssertionRequest {
115
117
  /** The binding the challenge was issued with. */
116
118
  binding: string;
117
- assertion: PasskeyAssertion;
119
+ /** The challenge the person answered on IAM's step-up page. */
120
+ challengeId: string;
118
121
  }
119
122
  /** A verified assertion: who answered, with which credential (its WebAuthn id, base64url), and when (epoch seconds). */
120
123
  export interface VerifiedPasskeyAssertion {
@@ -0,0 +1,15 @@
1
+ /** The installation's SCIM provisioning as the console shows it. */
2
+ export interface ScimSettingsDto {
3
+ /** The tenant URL an identity provider is configured with: IAM's origin and `/scim/v2`. */
4
+ endpoint: string;
5
+ /** Whether a token exists; without one IAM refuses every SCIM request. */
6
+ configured: boolean;
7
+ /** When the current token was created, in epoch seconds; null without one. */
8
+ createdAt: number | null;
9
+ }
10
+ /** A token just created: the secret is in this answer and nowhere else, ever again. */
11
+ export interface ScimTokenIssuedDto extends ScimSettingsDto {
12
+ configured: true;
13
+ createdAt: number;
14
+ token: string;
15
+ }