@_mustachio/openauth 0.12.0 → 0.13.1

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.
Files changed (98) hide show
  1. package/dist/esm/domain/scim/discovery.js +206 -0
  2. package/dist/esm/domain/scim/filter.js +177 -0
  3. package/dist/esm/domain/scim/handle.js +338 -0
  4. package/dist/esm/domain/scim/patch.js +568 -0
  5. package/dist/esm/domain/scim/resource.js +256 -0
  6. package/dist/esm/http/handlers/scim.js +59 -0
  7. package/dist/esm/http/middleware/tenant.js +25 -0
  8. package/dist/esm/http/router.js +3 -0
  9. package/dist/esm/index.js +1 -0
  10. package/dist/esm/methods/saml-sp/acs.js +44 -20
  11. package/dist/esm/methods/saml-sp/attributes.js +2 -0
  12. package/dist/esm/methods/saml-sp/authnrequest.js +2 -2
  13. package/dist/esm/methods/saml-sp/factory.js +12 -1
  14. package/dist/esm/methods/saml-sp/metadata.js +5 -3
  15. package/dist/esm/methods/saml-sp/saml-instance.js +13 -3
  16. package/dist/esm/methods/saml-sp/slo-initiate.js +2 -2
  17. package/dist/esm/methods/saml-sp/sls.js +12 -4
  18. package/dist/esm/ports/scim-directory.js +0 -0
  19. package/dist/esm/types/error.js +5 -0
  20. package/dist/esm/types/scim.js +0 -0
  21. package/dist/types/domain/scim/discovery.d.ts +11 -0
  22. package/dist/types/domain/scim/discovery.d.ts.map +1 -0
  23. package/dist/types/domain/scim/filter.d.ts +51 -0
  24. package/dist/types/domain/scim/filter.d.ts.map +1 -0
  25. package/dist/types/domain/scim/handle.d.ts +35 -0
  26. package/dist/types/domain/scim/handle.d.ts.map +1 -0
  27. package/dist/types/domain/scim/patch.d.ts +73 -0
  28. package/dist/types/domain/scim/patch.d.ts.map +1 -0
  29. package/dist/types/domain/scim/resource.d.ts +56 -0
  30. package/dist/types/domain/scim/resource.d.ts.map +1 -0
  31. package/dist/types/http/context.d.ts +3 -0
  32. package/dist/types/http/context.d.ts.map +1 -1
  33. package/dist/types/http/handlers/method-route.d.ts.map +1 -1
  34. package/dist/types/http/handlers/scim.d.ts +3 -0
  35. package/dist/types/http/handlers/scim.d.ts.map +1 -0
  36. package/dist/types/http/middleware/tenant.d.ts.map +1 -1
  37. package/dist/types/http/router.d.ts.map +1 -1
  38. package/dist/types/index.d.ts +2 -0
  39. package/dist/types/index.d.ts.map +1 -1
  40. package/dist/types/methods/saml-sp/acs.d.ts.map +1 -1
  41. package/dist/types/methods/saml-sp/attributes.d.ts +5 -0
  42. package/dist/types/methods/saml-sp/attributes.d.ts.map +1 -1
  43. package/dist/types/methods/saml-sp/authnrequest.d.ts.map +1 -1
  44. package/dist/types/methods/saml-sp/factory.d.ts +217 -1
  45. package/dist/types/methods/saml-sp/factory.d.ts.map +1 -1
  46. package/dist/types/methods/saml-sp/metadata.d.ts +8 -0
  47. package/dist/types/methods/saml-sp/metadata.d.ts.map +1 -1
  48. package/dist/types/methods/saml-sp/parse-idp-metadata.d.ts.map +1 -1
  49. package/dist/types/methods/saml-sp/saml-instance.d.ts +12 -0
  50. package/dist/types/methods/saml-sp/saml-instance.d.ts.map +1 -1
  51. package/dist/types/methods/saml-sp/slo-initiate.d.ts.map +1 -1
  52. package/dist/types/methods/saml-sp/sls.d.ts +20 -0
  53. package/dist/types/methods/saml-sp/sls.d.ts.map +1 -1
  54. package/dist/types/methods/saml-sp/types.d.ts +95 -0
  55. package/dist/types/methods/saml-sp/types.d.ts.map +1 -1
  56. package/dist/types/ports/scim-directory.d.ts +104 -0
  57. package/dist/types/ports/scim-directory.d.ts.map +1 -0
  58. package/dist/types/ports/session-store.d.ts.map +1 -1
  59. package/dist/types/types/error.d.ts +5 -0
  60. package/dist/types/types/error.d.ts.map +1 -1
  61. package/dist/types/types/idp.d.ts +12 -0
  62. package/dist/types/types/idp.d.ts.map +1 -1
  63. package/dist/types/types/result.d.ts.map +1 -1
  64. package/dist/types/types/scim.d.ts +269 -0
  65. package/dist/types/types/scim.d.ts.map +1 -0
  66. package/dist/types/types/tenant.d.ts +10 -0
  67. package/dist/types/types/tenant.d.ts.map +1 -1
  68. package/package.json +1 -1
  69. package/src/domain/scim/discovery.ts +262 -0
  70. package/src/domain/scim/filter.ts +295 -0
  71. package/src/domain/scim/handle.ts +597 -0
  72. package/src/domain/scim/patch.ts +807 -0
  73. package/src/domain/scim/resource.ts +358 -0
  74. package/src/http/context.ts +3 -0
  75. package/src/http/handlers/authorize.ts +0 -1
  76. package/src/http/handlers/method-route.ts +1 -4
  77. package/src/http/handlers/scim.ts +107 -0
  78. package/src/http/middleware/tenant.ts +47 -1
  79. package/src/http/router.ts +9 -0
  80. package/src/index.ts +20 -0
  81. package/src/methods/saml-sp/acs.ts +98 -49
  82. package/src/methods/saml-sp/attributes.ts +12 -3
  83. package/src/methods/saml-sp/authnrequest.ts +3 -2
  84. package/src/methods/saml-sp/factory.ts +24 -3
  85. package/src/methods/saml-sp/metadata.ts +19 -8
  86. package/src/methods/saml-sp/parse-idp-metadata.ts +3 -9
  87. package/src/methods/saml-sp/saml-instance.ts +42 -5
  88. package/src/methods/saml-sp/slo-initiate.ts +6 -3
  89. package/src/methods/saml-sp/sls.ts +35 -5
  90. package/src/methods/saml-sp/types.ts +97 -6
  91. package/src/ports/CONSISTENCY.md +28 -25
  92. package/src/ports/scim-directory.ts +166 -0
  93. package/src/ports/session-store.ts +1 -5
  94. package/src/types/error.ts +11 -0
  95. package/src/types/idp.ts +13 -3
  96. package/src/types/result.ts +1 -2
  97. package/src/types/scim.ts +280 -0
  98. package/src/types/tenant.ts +12 -10
@@ -1,8 +1,15 @@
1
1
  // src/methods/saml-sp/sls.ts
2
2
  import { authError } from "../../types/error";
3
3
  import { isErr } from "../../types/result";
4
- import { buildSamlInstance, deriveSpEntityId } from "./saml-instance";
4
+ import { buildSamlInstance, resolveSpEntityId } from "./saml-instance";
5
5
  var SLO_REPLAY_HORIZON_MS = 10 * 60000;
6
+ function rawQueryString(requestUrl) {
7
+ const start = requestUrl.indexOf("?");
8
+ if (start < 0)
9
+ return "";
10
+ const fragment = requestUrl.indexOf("#", start);
11
+ return fragment < 0 ? requestUrl.slice(start + 1) : requestUrl.slice(start + 1, fragment);
12
+ }
6
13
  async function consumeSls(ctx, methodId, config) {
7
14
  if (!ctx.dispatch) {
8
15
  return {
@@ -16,9 +23,9 @@ async function consumeSls(ctx, methodId, config) {
16
23
  error: authError.internalError("saml-sp: /sls reached with no idp.sloUrl configured")
17
24
  };
18
25
  }
19
- const spEntityId = deriveSpEntityId(ctx.dispatch.issuerUrl, ctx.tenant.id, methodId);
26
+ const spEntityId = resolveSpEntityId(config, ctx.dispatch.issuerUrl, ctx.tenant.id, methodId);
20
27
  const url = new URL(ctx.request.url);
21
- const originalQuery = url.search.replace(/^\?/, "");
28
+ const originalQuery = rawQueryString(ctx.request.url);
22
29
  let samlRequest;
23
30
  let samlResponse;
24
31
  let relayState;
@@ -150,5 +157,6 @@ async function consumeSls(ctx, methodId, config) {
150
157
  };
151
158
  }
152
159
  export {
153
- consumeSls
160
+ consumeSls,
161
+ rawQueryString
154
162
  };
File without changes
@@ -54,6 +54,11 @@ var authError = {
54
54
  code: "invalid_target",
55
55
  description
56
56
  }),
57
+ conflict: (description, attribute) => ({
58
+ code: "conflict",
59
+ description,
60
+ ...attribute !== undefined ? { attribute } : {}
61
+ }),
57
62
  internalError: (description, cause) => ({
58
63
  code: "internal_error",
59
64
  description,
File without changes
@@ -0,0 +1,11 @@
1
+ export declare function serviceProviderConfig(baseUrl: string, maxResults: number): Record<string, unknown>;
2
+ /**
3
+ * `groups` reflects whether the host actually implemented the Group
4
+ * half of `ScimDirectory`. Advertising a resource type we answer 501 for
5
+ * would send a client straight into a failure it was told to expect to
6
+ * work — the same advertise-only-what-we-serve rule the SAML SP metadata
7
+ * endpoint follows.
8
+ */
9
+ export declare function resourceTypes(baseUrl: string, groups: boolean): Record<string, unknown>;
10
+ export declare function schemas(baseUrl: string, groups: boolean): Record<string, unknown>;
11
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../../src/domain/scim/discovery.ts"],"names":[],"mappings":"AA0BA,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyBzB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmCzB;AA0CD,wBAAgB,OAAO,CACrB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmHzB"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * SCIM filter parsing — the deliberately narrow subset (`SCIM-AD3`).
3
+ *
4
+ * RFC 7644 §3.4.2.2 defines a full expression language: grouping,
5
+ * precedence, `co`/`sw`/`ew`/`pr`/`gt`/`ge`/`lt`/`le`, complex attribute
6
+ * paths, `not`, and arbitrary nesting. Okta and Entra emit a sliver of
7
+ * it — overwhelmingly `userName eq "…"` for the existence check before a
8
+ * create.
9
+ *
10
+ * Implementing the rest would mean either a large parser plus a query
11
+ * interface no host could reasonably satisfy, or quietly returning wrong
12
+ * results. We support the observed subset and reject everything else
13
+ * with a message naming what works, so a gap is visible on day one
14
+ * rather than becoming silent provisioning drift.
15
+ *
16
+ * Supported:
17
+ *
18
+ * userName eq "alice@corp.example"
19
+ * externalId eq "00u1abc"
20
+ * id eq "usr_123"
21
+ * active eq true
22
+ * emails[type eq "work"].value eq "a@b.com" (Entra's shape)
23
+ * emails.value eq "a@b.com"
24
+ * <term> and <term> (two terms, no nesting)
25
+ *
26
+ * Pure: no I/O, no port access. Returns a `Result` so the caller renders
27
+ * the SCIM error envelope.
28
+ */
29
+ import type { ScimFilter, ScimFilterAttribute } from "../../types/scim";
30
+ import { type Result } from "../../types/result";
31
+ /** What we tell a client when their filter is outside the subset. */
32
+ export declare const SUPPORTED_FILTER_HELP: string;
33
+ export type ScimFilterError = {
34
+ detail: string;
35
+ };
36
+ /**
37
+ * Which attributes each resource type may be filtered on. Filtering a
38
+ * Group by `userName` is nonsense, and answering it with an empty list
39
+ * rather than a 400 would look like "no such group" — a wrong answer
40
+ * dressed as a valid one.
41
+ */
42
+ export declare const USER_FILTER_ATTRIBUTES: ReadonlySet<ScimFilterAttribute>;
43
+ export declare const GROUP_FILTER_ATTRIBUTES: ReadonlySet<ScimFilterAttribute>;
44
+ /**
45
+ * Parse a SCIM `filter` query parameter.
46
+ *
47
+ * Returns `ok(undefined)` for an absent or blank filter — an unfiltered
48
+ * list is legal and is what Okta sends when importing all users.
49
+ */
50
+ export declare function parseScimFilter(raw: string | null | undefined, allowed?: ReadonlySet<ScimFilterAttribute>): Result<ScimFilter | undefined, ScimFilterError>;
51
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/domain/scim/filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEzD,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,QAGT,CAAA;AAEzB,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAWhD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,mBAAmB,CAEnE,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,mBAAmB,CACvB,CAAA;AAoH9C;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9B,OAAO,GAAE,WAAW,CAAC,mBAAmB,CAA0B,GACjE,MAAM,CAAC,UAAU,GAAG,SAAS,EAAE,eAAe,CAAC,CAkDjD"}
@@ -0,0 +1,35 @@
1
+ import type { ScimDirectory } from "../../ports/scim-directory";
2
+ import type { TenantContext } from "../../types/tenant";
3
+ import { SUPPORTED_FILTER_HELP } from "./filter";
4
+ export type ScimResponse = {
5
+ status: number;
6
+ /** `null` for 204. Serialized as `application/scim+json` by the caller. */
7
+ body: Record<string, unknown> | null;
8
+ /**
9
+ * Extra response headers the HTTP layer should set. Used for
10
+ * `Location` on a create, which RFC 7644 §3.1 requires and Okta's
11
+ * validator checks for.
12
+ */
13
+ headers?: Record<string, string>;
14
+ };
15
+ export type ScimRequestInput = {
16
+ tenant: TenantContext;
17
+ /** Upper-case HTTP method. */
18
+ method: string;
19
+ /** Path **within** the SCIM mount, e.g. `"/Users/abc"`. */
20
+ path: string;
21
+ query: URLSearchParams;
22
+ /** Parsed JSON body, or `null` for bodiless methods / unparseable input. */
23
+ body: unknown;
24
+ /** Raw `Authorization` header value. */
25
+ authorization: string | null;
26
+ /** Absolute base URL of the SCIM mount, e.g. `https://idp.example/scim/v2`. */
27
+ baseUrl: string;
28
+ directory: ScimDirectory;
29
+ };
30
+ /**
31
+ * Handle one SCIM request end to end.
32
+ */
33
+ export declare function handleScimRequest(input: ScimRequestInput): Promise<ScimResponse>;
34
+ export { SUPPORTED_FILTER_HELP };
35
+ //# sourceMappingURL=handle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../../../src/domain/scim/handle.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAQ/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGvD,OAAO,EAGL,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAsBjB,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACpC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,aAAa,CAAA;IACrB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,eAAe,CAAA;IACtB,4EAA4E;IAC5E,IAAI,EAAE,OAAO,CAAA;IACb,wCAAwC;IACxC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,aAAa,CAAA;CACzB,CAAA;AAibD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,YAAY,CAAC,CA2EvB;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * SCIM PATCH normalization (`SCIM-AD6`).
3
+ *
4
+ * `PATCH /Users/:id` carries a `PatchOp` whose `Operations` are the
5
+ * worst-specified part of SCIM, and Okta and Entra spell the same intent
6
+ * differently:
7
+ *
8
+ * Okta: { "op": "replace", "value": { "active": false } }
9
+ * Entra: { "op": "Replace", "path": "active", "value": "False" }
10
+ * Entra: { "op": "add", "path": "emails[type eq \"work\"].value", … }
11
+ *
12
+ * All three mean one thing to the host. This module resolves every
13
+ * supported shape — pathless object merges, dotted sub-attribute paths,
14
+ * multi-valued filter paths, the enterprise-extension URN prefix, and
15
+ * Entra's habit of sending booleans as the strings `"True"` / `"False"`
16
+ * — into a flat `ScimUserPatch` of fully resolved values.
17
+ *
18
+ * Resolution is done **against the current record**, which the caller
19
+ * has already fetched (it needs it for 404 semantics anyway). That means
20
+ * a targeted operation like `emails[type eq "work"].value` becomes a
21
+ * complete `emails` array, so the host implements exactly one semantic:
22
+ * present ⇒ set to this, `null` ⇒ clear, absent ⇒ leave alone. No merge
23
+ * logic and no path parsing ever reaches the host.
24
+ *
25
+ * Two kinds of "we can't do that" are treated very differently:
26
+ *
27
+ * - An attribute this Service Provider does not model at all (`title`,
28
+ * `nickName`, `locale`, …) is **skipped**. There is nowhere for it to
29
+ * go — `ScimUserPatch` has no field for it — so nothing drifts, and
30
+ * `parseUserWrite` already ignores the same attributes on POST/PUT.
31
+ * Rejecting them here would fail the whole request over an attribute
32
+ * we would have discarded anyway: Okta's default profile mappings
33
+ * push `title` in the *same* `PatchOp` as `active`, so a fatal
34
+ * unknown-attribute error takes the deactivation down with it, and
35
+ * Okta retries the identical payload forever.
36
+ * - A malformed operation on an attribute we **do** model (a
37
+ * non-boolean `active`, an unparseable path shape) stays an error.
38
+ * That one really would drift undetected.
39
+ *
40
+ * Pure: no I/O, no port access.
41
+ */
42
+ import type { ScimGroupPatch, ScimUserPatch, ScimUserRecord } from "../../types/scim";
43
+ import { type Result } from "../../types/result";
44
+ import { type ScimValidationError } from "./resource";
45
+ /**
46
+ * Normalize a `PatchOp` body into a `ScimUserPatch`, resolved against
47
+ * `current`.
48
+ */
49
+ export declare function normalizePatch(body: unknown, current: ScimUserRecord): Result<ScimUserPatch, ScimValidationError>;
50
+ /**
51
+ * Normalize a group `PatchOp`.
52
+ *
53
+ * Membership deliberately keeps the client's intent rather than being
54
+ * resolved to a final list (`SCIM-AD9`): "add one member" stays an add,
55
+ * so a host with a 20,000-member group issues one insert instead of
56
+ * rewriting the whole membership.
57
+ *
58
+ * A full replace still wins when one is present — subsequent
59
+ * adds/removes in the same request are folded into the replacement list,
60
+ * so the host never receives `members` alongside `addMembers` /
61
+ * `removeMembers` and needs no ordering rules of its own.
62
+ *
63
+ * Shapes handled:
64
+ *
65
+ * Okta: {op:"add", path:"members", value:[{value:"u1"}]}
66
+ * Okta: {op:"remove", path:"members[value eq \"u1\"]"}
67
+ * Entra: {op:"remove", path:"members", value:[{value:"u1"}]}
68
+ * both: {op:"replace", path:"members", value:[…]}
69
+ * both: {op:"replace", path:"displayName", value:"New"}
70
+ * both: {op:"replace", value:{displayName:"New"}}
71
+ */
72
+ export declare function normalizeGroupPatch(body: unknown): Result<ScimGroupPatch, ScimValidationError>;
73
+ //# sourceMappingURL=patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../../src/domain/scim/patch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,KAAK,EAEV,cAAc,EAGd,aAAa,EACb,cAAc,EACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEzD,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAA;AAqbnB;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,cAAc,GACtB,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAgF5C;AAcD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GACZ,MAAM,CAAC,cAAc,EAAE,mBAAmB,CAAC,CA4L7C"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * SCIM resource shapes — validation in, serialization out, and the
3
+ * error envelope.
4
+ *
5
+ * RFC 7643 defines the User schema; RFC 7644 defines the message
6
+ * envelopes. Both are picky in ways that are easy to get subtly wrong
7
+ * and that Okta's validator checks, so the details here are asserted in
8
+ * tests rather than assumed:
9
+ *
10
+ * - `status` in an Error is a **string**, not a number.
11
+ * - `ListResponse` uses `Resources` with a capital R.
12
+ * - `startIndex` is **1-based**.
13
+ * - `meta.location` must be an absolute URL; Okta reads it.
14
+ *
15
+ * Pure: no I/O, no port access.
16
+ */
17
+ import type { ScimGroupMember, ScimGroupRecord, ScimGroupWrite, ScimUserRecord, ScimUserWrite } from "../../types/scim";
18
+ import { type Result } from "../../types/result";
19
+ export declare const SCIM_USER_SCHEMA = "urn:ietf:params:scim:schemas:core:2.0:User";
20
+ export declare const SCIM_GROUP_SCHEMA = "urn:ietf:params:scim:schemas:core:2.0:Group";
21
+ export declare const SCIM_ENTERPRISE_SCHEMA = "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User";
22
+ export declare const SCIM_LIST_SCHEMA = "urn:ietf:params:scim:api:messages:2.0:ListResponse";
23
+ export declare const SCIM_ERROR_SCHEMA = "urn:ietf:params:scim:api:messages:2.0:Error";
24
+ export declare const SCIM_PATCH_SCHEMA = "urn:ietf:params:scim:api:messages:2.0:PatchOp";
25
+ /** RFC 7644 §3.12 `scimType` values we emit. */
26
+ export type ScimErrorType = "invalidFilter" | "invalidPath" | "invalidSyntax" | "invalidValue" | "mutability" | "noTarget" | "uniqueness" | "tooMany";
27
+ export type ScimValidationError = {
28
+ status: number;
29
+ detail: string;
30
+ scimType?: ScimErrorType;
31
+ };
32
+ /** RFC 7644 §3.12 error envelope. */
33
+ export declare function scimErrorBody(status: number, detail: string, scimType?: ScimErrorType): Record<string, unknown>;
34
+ /**
35
+ * Validate a `POST` / `PUT` user payload into a `ScimUserWrite`.
36
+ *
37
+ * Unknown attributes are ignored rather than rejected: SCIM clients send
38
+ * plenty the spec allows and we do not model, and failing the whole
39
+ * provisioning run over an extra field would be hostile. The two
40
+ * exceptions are hard errors — a missing `userName`, which leaves the
41
+ * record unidentifiable, and `password`, which we refuse to handle at
42
+ * all rather than accept and drop.
43
+ */
44
+ export declare function parseUserWrite(body: unknown): Result<ScimUserWrite, ScimValidationError>;
45
+ /** Serialize a host record into a SCIM User resource. */
46
+ export declare function serializeUser(user: ScimUserRecord, baseUrl: string): Record<string, unknown>;
47
+ /** RFC 7644 §3.4.2 ListResponse. */
48
+ export declare function serializeList(users: ScimUserRecord[], totalResults: number, startIndex: number, baseUrl: string): Record<string, unknown>;
49
+ declare function parseMembers(v: unknown): ScimGroupMember[] | undefined;
50
+ export { parseMembers };
51
+ /** Validate a `POST` / `PUT` group payload. */
52
+ export declare function parseGroupWrite(body: unknown): Result<ScimGroupWrite, ScimValidationError>;
53
+ /** Serialize a host group record into a SCIM Group resource. */
54
+ export declare function serializeGroup(group: ScimGroupRecord, baseUrl: string): Record<string, unknown>;
55
+ export declare function serializeGroupList(groups: ScimGroupRecord[], totalResults: number, startIndex: number, baseUrl: string): Record<string, unknown>;
56
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../../src/domain/scim/resource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAEV,eAAe,EACf,eAAe,EACf,cAAc,EAGd,cAAc,EACd,aAAa,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEzD,eAAO,MAAM,gBAAgB,+CAA+C,CAAA;AAC5E,eAAO,MAAM,iBAAiB,gDAAgD,CAAA;AAC9E,eAAO,MAAM,sBAAsB,+DAC2B,CAAA;AAC9D,eAAO,MAAM,gBAAgB,uDACyB,CAAA;AACtD,eAAO,MAAM,iBAAiB,gDAAgD,CAAA;AAC9E,eAAO,MAAM,iBAAiB,kDAAkD,CAAA;AAEhF,gDAAgD;AAChD,MAAM,MAAM,aAAa,GACrB,eAAe,GACf,aAAa,GACb,eAAe,GACf,cAAc,GACd,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,SAAS,CAAA;AAEb,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,aAAa,CAAA;CACzB,CAAA;AAED,qCAAqC;AACrC,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,aAAa,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AAsED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,GACZ,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAyD5C;AAKD,yDAAyD;AACzD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+BzB;AAED,oCAAoC;AACpC,wBAAgB,aAAa,CAC3B,KAAK,EAAE,cAAc,EAAE,EACvB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AAED,iBAAS,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,eAAe,EAAE,GAAG,SAAS,CAa/D;AAED,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,+CAA+C;AAC/C,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,GACZ,MAAM,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAuB7C;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2BzB;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EAAE,EACzB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB"}
@@ -10,6 +10,7 @@ import type { AuditLog } from "../ports/audit-log";
10
10
  import type { ConfigStore } from "../ports/config-store";
11
11
  import type { KeyStore } from "../ports/key-store";
12
12
  import type { MethodStore } from "../ports/method-store";
13
+ import type { ScimDirectory } from "../ports/scim-directory";
13
14
  import type { SessionStore } from "../ports/session-store";
14
15
  import type { TokenStore } from "../ports/token-store";
15
16
  import type { MethodCache } from "../domain/method-cache";
@@ -27,6 +28,8 @@ export type HttpDeps = {
27
28
  keyStore: KeyStore;
28
29
  methodStore?: MethodStore;
29
30
  auditLog?: AuditLog;
31
+ /** See `IdPOptions.scimDirectory`. Absent ⇒ `/scim/v2/*` answers 501. */
32
+ scimDirectory?: ScimDirectory;
30
33
  methodCache: MethodCache;
31
34
  stateKeys: StateKeyRing;
32
35
  /** Resolves the issuer URL — string or per-request function. */
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/http/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,eAAe,EAChB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kB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C,GAC3B,QAAQ,CAEV"}
@@ -1 +1 @@
1
- {"version":3,"file":"method-route.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/method-route.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGvD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,OAClC,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CA0JjD"}
1
+ {"version":3,"file":"method-route.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/method-route.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGvD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,OAClC,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAuJjD"}
@@ -0,0 +1,3 @@
1
+ import type { HttpContext, HttpDeps } from "../context";
2
+ export declare function makeScimHandler(deps: HttpDeps): (c: HttpContext) => Promise<Response>;
3
+ //# sourceMappingURL=scim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scim.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/scim.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwBvD,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,OAC3B,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAoEjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../../../src/http/middleware/tenant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;AAY7C,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAWnD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,GACb,iBAAiB,CAAC,OAAO,CAAC,CAS5B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAkD3E"}
1
+ {"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../../../src/http/middleware/tenant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;AAY7C,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAmDnD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,GACb,iBAAiB,CAAC,OAAO,CAAC,CAS5B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAwD3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/http/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAc3B,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAElD,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,CAmDzD"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/http/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAe3B,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAElD,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,CA2DzD"}
@@ -26,6 +26,8 @@ export type { AuditEvent, AuditLog } from "./ports/audit-log";
26
26
  export type { ConfigStore } from "./ports/config-store";
27
27
  export type { EncryptionKey, KeyStore, KeyWrapper, SigningKey, } from "./ports/key-store";
28
28
  export type { MethodStore } from "./ports/method-store";
29
+ export type { ScimDirectory } from "./ports/scim-directory";
30
+ export type { ScimConfig, ScimEnterpriseUser, ScimGroupMember, ScimGroupPatch, ScimGroupQuery, ScimGroupRecord, ScimGroupWrite, ScimFilter, ScimFilterAttribute, ScimMultiValue, ScimName, ScimPage, ScimUserPatch, ScimUserQuery, ScimUserRecord, ScimUserWrite, } from "./types/scim";
29
31
  export type { ParRecord, SessionRecord, SessionStore, } from "./ports/session-store";
30
32
  export type { TokenStore } from "./ports/token-store";
31
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AAErD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,YAAY,EACV,YAAY,EACZ,wBAAwB,EACxB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,GACZ,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,aAAa,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,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAqNtD"}
1
+ {"version":3,"file":"acs.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/acs.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AA2K1E,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CA8NtD"}
@@ -21,7 +21,12 @@ export type VerifiedProfile = {
21
21
  nameIDFormat: string;
22
22
  sessionIndex?: string;
23
23
  attributes: Record<string, unknown>;
24
+ /** `AuthnStatement/@AuthnInstant`, raw XSD dateTime. */
24
25
  authnInstant?: string;
26
+ /** `AuthnStatement/@SessionNotOnOrAfter`, already parsed to Unix ms. */
27
+ sessionNotOnOrAfter?: number;
28
+ /** `AuthnContext/AuthnContextClassRef` — what the IdP actually asserted. */
29
+ authnContextClassRef?: string;
25
30
  responseXml: string;
26
31
  };
27
32
  export type MappedSubject = {
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EACV,oBAAoB,EAGpB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,8DAA8D;AAC9D,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAA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
1
- {"version":3,"file":"authnrequest.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/authnrequest.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1E,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAyGtD"}
1
+ {"version":3,"file":"authnrequest.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/authnrequest.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1E,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CA0GtD"}