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

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.48",
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.48",
31
+ "@fabrika/auth-core": "0.9.0-dev.48",
32
+ "@fabrika/proxy-core": "0.9.0-dev.48"
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,
@@ -50,6 +48,7 @@ import type {
50
48
  } from './passkeys'
51
49
  import type { PasswordPolicyDto, SetPasswordPolicyRequest } from './password-policy'
52
50
  import type { ProvisionRequestedApiKeyRequest, RequestedApiKey, RequestedApiKeyInput, RequestedApiKeyResponse } from './requested-keys'
51
+ import type { ScimSettingsDto, ScimTokenIssuedDto } from './scim'
53
52
 
54
53
  // ── Common wrappers ───────────────────────────────────────────────────────────
55
54
 
@@ -967,8 +966,6 @@ export interface IamAdminRpcContract {
967
966
  list: RpcProcedure<void, ListResponse<OAuthClientDto>>
968
967
  put: RpcProcedure<PutOAuthClientRequest, OAuthClientDto>
969
968
  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
969
  }
973
970
  policies: {
974
971
  list: RpcProcedure<AppInput, ListResponse<PolicyDto>>
@@ -1044,6 +1041,17 @@ export interface IamAdminRpcContract {
1044
1041
  get: RpcProcedure<void, PasswordPolicyDto>
1045
1042
  set: RpcProcedure<SetPasswordPolicyRequest, PasswordPolicyDto>
1046
1043
  }
1044
+ /**
1045
+ * SCIM provisioning by the organization's identity provider (ADR-0091), an installation administrator's in a signed-in
1046
+ * session. `rotateToken` creates the installation's one token or replaces it (the old one stops working at once) and
1047
+ * answers the secret once; `revokeToken` removes it, after which every SCIM request is refused. Each writes
1048
+ * `iam.scim.token.rotate` or `iam.scim.token.revoke`.
1049
+ */
1050
+ scim: {
1051
+ get: RpcProcedure<void, ScimSettingsDto>
1052
+ rotateToken: RpcProcedure<void, ScimTokenIssuedDto>
1053
+ revokeToken: RpcProcedure<void, ScimSettingsDto>
1054
+ }
1047
1055
  /**
1048
1056
  * A person's second factor (TOTP), an installation administrator's (`iam.admin`) to read and to reset. The person
1049
1057
  * enrols at IAM's `SECOND_FACTOR_ENROL_PATH`, never here. A reset removes the authenticator and its recovery codes
@@ -1114,3 +1122,4 @@ export * from './oauth-registry'
1114
1122
  export * from './passkeys'
1115
1123
  export * from './password-policy'
1116
1124
  export * from './requested-keys'
1125
+ 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/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';
4
+ import type { ExternalAppDto, ExternalAppInput, OAuthClientDto, OAuthClientInput, PutExternalAppRequest, PutOAuthClientRequest } from './oauth-registry';
5
5
  import type { IssuePasskeyChallengeRequest, PasskeyChallenge, PasskeyCreationOptions, PasskeyDto, PasskeyRequestOptions, PasskeyResetResponse, RegisterPasskeyRequest, RemovePasskeyRequest, 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[];
@@ -834,8 +835,6 @@ export interface IamAdminRpcContract {
834
835
  list: RpcProcedure<void, ListResponse<OAuthClientDto>>;
835
836
  put: RpcProcedure<PutOAuthClientRequest, OAuthClientDto>;
836
837
  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
838
  };
840
839
  policies: {
841
840
  list: RpcProcedure<AppInput, ListResponse<PolicyDto>>;
@@ -911,6 +910,17 @@ export interface IamAdminRpcContract {
911
910
  get: RpcProcedure<void, PasswordPolicyDto>;
912
911
  set: RpcProcedure<SetPasswordPolicyRequest, PasswordPolicyDto>;
913
912
  };
913
+ /**
914
+ * SCIM provisioning by the organization's identity provider (ADR-0091), an installation administrator's in a signed-in
915
+ * session. `rotateToken` creates the installation's one token or replaces it (the old one stops working at once) and
916
+ * answers the secret once; `revokeToken` removes it, after which every SCIM request is refused. Each writes
917
+ * `iam.scim.token.rotate` or `iam.scim.token.revoke`.
918
+ */
919
+ scim: {
920
+ get: RpcProcedure<void, ScimSettingsDto>;
921
+ rotateToken: RpcProcedure<void, ScimTokenIssuedDto>;
922
+ revokeToken: RpcProcedure<void, ScimSettingsDto>;
923
+ };
914
924
  /**
915
925
  * A person's second factor (TOTP), an installation administrator's (`iam.admin`) to read and to reset. The person
916
926
  * enrols at IAM's `SECOND_FACTOR_ENROL_PATH`, never here. A reset removes the authenticator and its recovery codes
@@ -966,3 +976,4 @@ export * from './oauth-registry';
966
976
  export * from './passkeys';
967
977
  export * from './password-policy';
968
978
  export * from './requested-keys';
979
+ 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
- };
@@ -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
+ }