@schemavaults/auth-common 0.33.2 → 0.35.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.
@@ -0,0 +1,66 @@
1
+ /**
2
+ * API scopes: the OAuth 2.0 scope values (RFC 6749 §3.3) an API server
3
+ * (resource server) defines for itself, e.g. `notes:read` or
4
+ * `https://api.example.com/auth/drive`, each with a human readable
5
+ * description for consent screens. A client asks for them on an
6
+ * authorization request that names the API server as its RFC 8707
7
+ * `resource`; the auth server grants the requested scopes the API server
8
+ * defines and stamps them on the access tokens it mints for that API
9
+ * server, whose route guards enforce them (`requiredScopes`).
10
+ *
11
+ * The OIDC scope names (`OIDC_RESERVED_SCOPES`) can never be API scopes,
12
+ * so a granted scope string splits unambiguously into its OIDC and API
13
+ * parts (`partitionGrantedScopes`).
14
+ */
15
+ import { z } from "zod";
16
+ export declare const MAX_API_SCOPE_VALUE_LENGTH: 128;
17
+ export declare const MAX_API_SCOPE_DESCRIPTION_LENGTH: 256;
18
+ /** Upper bound on the scopes one API server may define. */
19
+ export declare const MAX_API_SCOPES_PER_API_SERVER: 100;
20
+ /**
21
+ * One RFC 6749 §3.3 scope-token: printable ASCII except SP, `"` and `\`.
22
+ */
23
+ export declare const API_SCOPE_VALUE_REGEX: RegExp;
24
+ /**
25
+ * A scope value an API server may define: a single RFC 6749 scope-token
26
+ * that is not one of the OIDC scope names.
27
+ */
28
+ export declare const apiScopeValueSchema: z.ZodString;
29
+ export type ApiScopeValue = z.infer<typeof apiScopeValueSchema>;
30
+ /** What a consent screen tells the user the scope allows. */
31
+ export declare const apiScopeDescriptionSchema: z.ZodString;
32
+ /**
33
+ * An RFC 8707 `resource` value carried through an authorization flow (the
34
+ * login / register / session code requests): an API server id or the URL
35
+ * of one of its registered domains. Only bounded here; the auth server
36
+ * resolves it, and ignores a value it cannot honour.
37
+ */
38
+ export declare const resourceIndicatorSchema: z.ZodString;
39
+ /** A scope defined by an API server. */
40
+ export declare const apiServerScopeSchema: z.ZodObject<{
41
+ api_server_scope_id: z.ZodGUID;
42
+ api_server_id: z.ZodString;
43
+ scope: z.ZodString;
44
+ description: z.ZodString;
45
+ allow_dynamic_clients: z.ZodBoolean;
46
+ created_at: z.ZodNumber;
47
+ created_by: z.ZodNullable<z.ZodGUID>;
48
+ }, z.core.$strict>;
49
+ export type ApiServerScope = z.infer<typeof apiServerScopeSchema>;
50
+ /** Body of a request defining a new scope on an API server. */
51
+ export declare const createApiServerScopeRequestSchema: z.ZodObject<{
52
+ scope: z.ZodString;
53
+ description: z.ZodString;
54
+ allow_dynamic_clients: z.ZodOptional<z.ZodBoolean>;
55
+ }, z.core.$strict>;
56
+ export type CreateApiServerScopeRequest = z.infer<typeof createApiServerScopeRequestSchema>;
57
+ /**
58
+ * Body of a request changing a scope's description and/or whether dynamic
59
+ * clients may be granted it. The scope value itself is immutable: tokens
60
+ * already carry it, so a rename is a new scope plus a deletion.
61
+ */
62
+ export declare const updateApiServerScopeRequestSchema: z.ZodObject<{
63
+ description: z.ZodOptional<z.ZodString>;
64
+ allow_dynamic_clients: z.ZodOptional<z.ZodBoolean>;
65
+ }, z.core.$strict>;
66
+ export type UpdateApiServerScopeRequest = z.infer<typeof updateApiServerScopeRequestSchema>;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * API scopes: the OAuth 2.0 scope values (RFC 6749 §3.3) an API server
3
+ * (resource server) defines for itself, e.g. `notes:read` or
4
+ * `https://api.example.com/auth/drive`, each with a human readable
5
+ * description for consent screens. A client asks for them on an
6
+ * authorization request that names the API server as its RFC 8707
7
+ * `resource`; the auth server grants the requested scopes the API server
8
+ * defines and stamps them on the access tokens it mints for that API
9
+ * server, whose route guards enforce them (`requiredScopes`).
10
+ *
11
+ * The OIDC scope names (`OIDC_RESERVED_SCOPES`) can never be API scopes,
12
+ * so a granted scope string splits unambiguously into its OIDC and API
13
+ * parts (`partitionGrantedScopes`).
14
+ */
15
+ import { z } from "zod";
16
+ import { apiServerIdSchema } from "@schemavaults/app-definitions";
17
+ import { isOidcReservedScope } from "../oidc/scope";
18
+ export const MAX_API_SCOPE_VALUE_LENGTH = 128;
19
+ export const MAX_API_SCOPE_DESCRIPTION_LENGTH = 256;
20
+ /** Upper bound on the scopes one API server may define. */
21
+ export const MAX_API_SCOPES_PER_API_SERVER = 100;
22
+ /**
23
+ * One RFC 6749 §3.3 scope-token: printable ASCII except SP, `"` and `\`.
24
+ */
25
+ export const API_SCOPE_VALUE_REGEX = /^[\x21\x23-\x5B\x5D-\x7E]+$/;
26
+ /**
27
+ * A scope value an API server may define: a single RFC 6749 scope-token
28
+ * that is not one of the OIDC scope names.
29
+ */
30
+ export const apiScopeValueSchema = z
31
+ .string()
32
+ .min(1)
33
+ .max(MAX_API_SCOPE_VALUE_LENGTH)
34
+ .regex(API_SCOPE_VALUE_REGEX, {
35
+ message: "A scope must be a single RFC 6749 scope-token: printable ASCII without spaces, '\"' or '\\'",
36
+ })
37
+ .refine((scope) => !isOidcReservedScope(scope), {
38
+ message: "OpenID Connect scope names (openid, profile, email, address, phone, offline_access) cannot be defined as API scopes",
39
+ });
40
+ /** What a consent screen tells the user the scope allows. */
41
+ export const apiScopeDescriptionSchema = z
42
+ .string()
43
+ .trim()
44
+ .min(1)
45
+ .max(MAX_API_SCOPE_DESCRIPTION_LENGTH);
46
+ /**
47
+ * An RFC 8707 `resource` value carried through an authorization flow (the
48
+ * login / register / session code requests): an API server id or the URL
49
+ * of one of its registered domains. Only bounded here; the auth server
50
+ * resolves it, and ignores a value it cannot honour.
51
+ */
52
+ export const resourceIndicatorSchema = z.string().min(1).max(2048);
53
+ /** A scope defined by an API server. */
54
+ export const apiServerScopeSchema = z
55
+ .object({
56
+ api_server_scope_id: z.guid(),
57
+ api_server_id: apiServerIdSchema,
58
+ // Format only (no reserved-name check), so a stored definition always
59
+ // parses on the way out.
60
+ scope: z
61
+ .string()
62
+ .min(1)
63
+ .max(MAX_API_SCOPE_VALUE_LENGTH)
64
+ .regex(API_SCOPE_VALUE_REGEX),
65
+ description: z.string().max(MAX_API_SCOPE_DESCRIPTION_LENGTH),
66
+ // Whether clients registered through RFC 7591 dynamic client
67
+ // registration (which have no app-to-API connection to carry an
68
+ // allowance) may be granted the scope. Only meaningful while the API
69
+ // server allows dynamic clients at all.
70
+ allow_dynamic_clients: z.boolean(),
71
+ created_at: z.number().nonnegative(),
72
+ created_by: z.guid().nullable(),
73
+ })
74
+ .strict();
75
+ /** Body of a request defining a new scope on an API server. */
76
+ export const createApiServerScopeRequestSchema = z
77
+ .object({
78
+ scope: apiScopeValueSchema,
79
+ description: apiScopeDescriptionSchema,
80
+ /** Defaults to true. */
81
+ allow_dynamic_clients: z.boolean().optional(),
82
+ })
83
+ .strict();
84
+ /**
85
+ * Body of a request changing a scope's description and/or whether dynamic
86
+ * clients may be granted it. The scope value itself is immutable: tokens
87
+ * already carry it, so a rename is a new scope plus a deletion.
88
+ */
89
+ export const updateApiServerScopeRequestSchema = z
90
+ .object({
91
+ description: apiScopeDescriptionSchema.optional(),
92
+ allow_dynamic_clients: z.boolean().optional(),
93
+ })
94
+ .strict()
95
+ .refine((update) => update.description !== undefined ||
96
+ update.allow_dynamic_clients !== undefined, "At least one of 'description' and 'allow_dynamic_clients' must be provided");
97
+ //# sourceMappingURL=api-server-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-server-scope.js","sourceRoot":"","sources":["../../src/api-scopes/api-server-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAY,CAAC;AACvD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAY,CAAC;AAC7D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,6BAA6B,GAA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EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE;IACpC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,+DAA+D;AAC/D,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,yBAAyB;IACtC,wBAAwB;IACxB,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC9C,CAAC;KACD,MAAM,EAAE,CAAC;AAMZ;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,WAAW,EAAE,yBAAyB,CAAC,QAAQ,EAAE;IACjD,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC9C,CAAC;KACD,MAAM,EAAE;KACR,MAAM,CACL,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,WAAW,KAAK,SAAS;IAChC,MAAM,CAAC,qBAAqB,KAAK,SAAS,EAC5C,4EAA4E,CAC7E,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Per-scope user consent: what a user has agreed to let a client
3
+ * application do with an API server, recorded per scope so the consent
4
+ * screen only asks again for what is new (incremental authorization) and
5
+ * the user can withdraw a single scope later.
6
+ */
7
+ import { z } from "zod";
8
+ /** A scope as a consent screen presents it. */
9
+ export declare const consentScopeSchema: z.ZodObject<{
10
+ api_server_scope_id: z.ZodGUID;
11
+ scope: z.ZodString;
12
+ description: z.ZodString;
13
+ }, z.core.$strict>;
14
+ export type ConsentScope = z.infer<typeof consentScopeSchema>;
15
+ /**
16
+ * What the signed-in user would be agreeing to for one authorization
17
+ * request (`GET /api/apps/{app_id}/check-authorization?scope=…&resource=…`).
18
+ */
19
+ export declare const appConsentStatusSchema: z.ZodObject<{
20
+ success: z.ZodLiteral<true>;
21
+ authorized: z.ZodBoolean;
22
+ consent_required: z.ZodBoolean;
23
+ requested_oidc_scopes: z.ZodArray<z.ZodString>;
24
+ api_server: z.ZodNullable<z.ZodObject<{
25
+ api_server_id: z.ZodString;
26
+ api_server_name: z.ZodString;
27
+ }, z.core.$strict>>;
28
+ granted_api_scopes: z.ZodArray<z.ZodObject<{
29
+ api_server_scope_id: z.ZodGUID;
30
+ scope: z.ZodString;
31
+ description: z.ZodString;
32
+ }, z.core.$strict>>;
33
+ pending_api_scopes: z.ZodArray<z.ZodObject<{
34
+ api_server_scope_id: z.ZodGUID;
35
+ scope: z.ZodString;
36
+ description: z.ZodString;
37
+ }, z.core.$strict>>;
38
+ }, z.core.$strict>;
39
+ export type AppConsentStatus = z.infer<typeof appConsentStatusSchema>;
40
+ /** The API scopes a user approved on the consent screen (a subset of the pending ones). */
41
+ export declare const approvedApiScopesSchema: z.ZodArray<z.ZodString>;
42
+ /** One API scope a user granted a connected app. */
43
+ export declare const connectedAppScopeSchema: z.ZodObject<{
44
+ api_server_id: z.ZodString;
45
+ api_server_name: z.ZodString;
46
+ api_server_scope_id: z.ZodGUID;
47
+ scope: z.ZodString;
48
+ description: z.ZodString;
49
+ granted_at: z.ZodNumber;
50
+ }, z.core.$strict>;
51
+ export type ConnectedAppScope = z.infer<typeof connectedAppScopeSchema>;
52
+ /** A third-party application the user authorized, with what it can access. */
53
+ export declare const connectedAppSchema: z.ZodObject<{
54
+ app_id: z.ZodString;
55
+ app_name: z.ZodString;
56
+ app_description: z.ZodString;
57
+ authorized_at: z.ZodNumber;
58
+ last_used_at: z.ZodNullable<z.ZodNumber>;
59
+ api_scopes: z.ZodArray<z.ZodObject<{
60
+ api_server_id: z.ZodString;
61
+ api_server_name: z.ZodString;
62
+ api_server_scope_id: z.ZodGUID;
63
+ scope: z.ZodString;
64
+ description: z.ZodString;
65
+ granted_at: z.ZodNumber;
66
+ }, z.core.$strict>>;
67
+ }, z.core.$strict>;
68
+ export type ConnectedApp = z.infer<typeof connectedAppSchema>;
69
+ export declare const listConnectedAppsResponseSchema: z.ZodObject<{
70
+ success: z.ZodLiteral<true>;
71
+ list: z.ZodArray<z.ZodObject<{
72
+ app_id: z.ZodString;
73
+ app_name: z.ZodString;
74
+ app_description: z.ZodString;
75
+ authorized_at: z.ZodNumber;
76
+ last_used_at: z.ZodNullable<z.ZodNumber>;
77
+ api_scopes: z.ZodArray<z.ZodObject<{
78
+ api_server_id: z.ZodString;
79
+ api_server_name: z.ZodString;
80
+ api_server_scope_id: z.ZodGUID;
81
+ scope: z.ZodString;
82
+ description: z.ZodString;
83
+ granted_at: z.ZodNumber;
84
+ }, z.core.$strict>>;
85
+ }, z.core.$strict>>;
86
+ }, z.core.$strict>;
87
+ export type ListConnectedAppsResponse = z.infer<typeof listConnectedAppsResponseSchema>;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Per-scope user consent: what a user has agreed to let a client
3
+ * application do with an API server, recorded per scope so the consent
4
+ * screen only asks again for what is new (incremental authorization) and
5
+ * the user can withdraw a single scope later.
6
+ */
7
+ import { z } from "zod";
8
+ import { apiServerIdSchema, appIdSchema } from "@schemavaults/app-definitions";
9
+ import { MAX_API_SCOPES_PER_API_SERVER, apiScopeValueSchema } from "./api-server-scope";
10
+ /** A scope as a consent screen presents it. */
11
+ export const consentScopeSchema = z
12
+ .object({
13
+ api_server_scope_id: z.guid(),
14
+ scope: z.string(),
15
+ description: z.string(),
16
+ })
17
+ .strict();
18
+ /**
19
+ * What the signed-in user would be agreeing to for one authorization
20
+ * request (`GET /api/apps/{app_id}/check-authorization?scope=…&resource=…`).
21
+ */
22
+ export const appConsentStatusSchema = z
23
+ .object({
24
+ success: z.literal(true),
25
+ /** Whether the user authorized the app at all (any earlier sign-in). */
26
+ authorized: z.boolean(),
27
+ /**
28
+ * Whether the consent screen must be shown: the app is not authorized
29
+ * yet, or the request asks for API scopes the user has not granted.
30
+ */
31
+ consent_required: z.boolean(),
32
+ /** The OpenID Connect scopes the request asks for (`openid`, `email`, `profile`). */
33
+ requested_oidc_scopes: z.array(z.string()),
34
+ /** The API server whose scopes the request asks for; null when none. */
35
+ api_server: z
36
+ .object({ api_server_id: apiServerIdSchema, api_server_name: z.string() })
37
+ .strict()
38
+ .nullable(),
39
+ /** The requested API scopes the user already granted the app. */
40
+ granted_api_scopes: z.array(consentScopeSchema),
41
+ /** The requested API scopes awaiting the user's decision. */
42
+ pending_api_scopes: z.array(consentScopeSchema),
43
+ })
44
+ .strict();
45
+ /** The API scopes a user approved on the consent screen (a subset of the pending ones). */
46
+ export const approvedApiScopesSchema = z
47
+ .array(apiScopeValueSchema)
48
+ .max(MAX_API_SCOPES_PER_API_SERVER);
49
+ /** One API scope a user granted a connected app. */
50
+ export const connectedAppScopeSchema = z
51
+ .object({
52
+ api_server_id: apiServerIdSchema,
53
+ api_server_name: z.string(),
54
+ api_server_scope_id: z.guid(),
55
+ scope: z.string(),
56
+ description: z.string(),
57
+ granted_at: z.number().nonnegative(),
58
+ })
59
+ .strict();
60
+ /** A third-party application the user authorized, with what it can access. */
61
+ export const connectedAppSchema = z
62
+ .object({
63
+ app_id: appIdSchema,
64
+ app_name: z.string(),
65
+ app_description: z.string(),
66
+ authorized_at: z.number().nonnegative(),
67
+ /** When the app was last issued a token for the user; null if never (or not tracked). */
68
+ last_used_at: z.number().nonnegative().nullable(),
69
+ api_scopes: z.array(connectedAppScopeSchema),
70
+ })
71
+ .strict();
72
+ export const listConnectedAppsResponseSchema = z
73
+ .object({ success: z.literal(true), list: z.array(connectedAppSchema) })
74
+ .strict();
75
+ //# sourceMappingURL=consent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent.js","sourceRoot":"","sources":["../../src/api-scopes/consent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,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AAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,mBAAmB,EAAE,CAAC,CAAC,IAAI,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE;CACrC,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE;IACvC,yFAAyF;IACzF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACjD,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC;CAC7C,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC;KACvE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { MAX_API_SCOPE_VALUE_LENGTH, MAX_API_SCOPE_DESCRIPTION_LENGTH, MAX_API_SCOPES_PER_API_SERVER, API_SCOPE_VALUE_REGEX, apiScopeValueSchema, apiScopeDescriptionSchema, resourceIndicatorSchema, apiServerScopeSchema, createApiServerScopeRequestSchema, updateApiServerScopeRequestSchema, } from "./api-server-scope";
2
+ export type { ApiScopeValue, ApiServerScope, CreateApiServerScopeRequest, UpdateApiServerScopeRequest, } from "./api-server-scope";
3
+ export { API_SCOPE_GRANTEES, apiScopeGranteeSchema, appApiScopePolicySchema, updateAppApiScopePolicyRequestSchema, } from "./scope-grants";
4
+ export type { ApiScopeGrantee, AppApiScopePolicy, UpdateAppApiScopePolicyRequest, } from "./scope-grants";
5
+ export { consentScopeSchema, appConsentStatusSchema, approvedApiScopesSchema, connectedAppScopeSchema, connectedAppSchema, listConnectedAppsResponseSchema, } from "./consent";
6
+ export type { ConsentScope, AppConsentStatus, ConnectedAppScope, ConnectedApp, ListConnectedAppsResponse, } from "./consent";
@@ -0,0 +1,4 @@
1
+ export { MAX_API_SCOPE_VALUE_LENGTH, MAX_API_SCOPE_DESCRIPTION_LENGTH, MAX_API_SCOPES_PER_API_SERVER, API_SCOPE_VALUE_REGEX, apiScopeValueSchema, apiScopeDescriptionSchema, resourceIndicatorSchema, apiServerScopeSchema, createApiServerScopeRequestSchema, updateApiServerScopeRequestSchema, } from "./api-server-scope";
2
+ export { API_SCOPE_GRANTEES, apiScopeGranteeSchema, appApiScopePolicySchema, updateAppApiScopePolicyRequestSchema, } from "./scope-grants";
3
+ export { consentScopeSchema, appConsentStatusSchema, approvedApiScopesSchema, connectedAppScopeSchema, connectedAppSchema, listConnectedAppsResponseSchema, } from "./consent";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api-scopes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,iCAAiC,EACjC,iCAAiC,GAClC,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,oCAAoC,GACrC,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,+BAA+B,GAChC,MAAM,WAAW,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Per-app scope allowances ("client grants"): which of an API server's
3
+ * scopes a connected client application may be granted.
4
+ *
5
+ * - `user` allowance: the scopes users may delegate to the app on an
6
+ * authorization request. By default unrestricted (every scope the API
7
+ * server defines; each user still consents per scope); an API server
8
+ * owner may restrict it to a list.
9
+ * - `service_account` allowance: the scopes the app's own service account
10
+ * gets on the client_credentials grant, where no user consents. Empty by
11
+ * default: machine-to-machine tokens carry an API scope only when the API
12
+ * server owner listed it for that app.
13
+ *
14
+ * Dynamically registered clients have no connection; they may be granted
15
+ * the scopes flagged `allow_dynamic_clients` on the API server.
16
+ */
17
+ import { z } from "zod";
18
+ export declare const API_SCOPE_GRANTEES: readonly ["user", "service_account"];
19
+ export type ApiScopeGrantee = (typeof API_SCOPE_GRANTEES)[number];
20
+ export declare const apiScopeGranteeSchema: z.ZodEnum<{
21
+ service_account: "service_account";
22
+ user: "user";
23
+ }>;
24
+ /** The scope allowances of one app-to-API connection. */
25
+ export declare const appApiScopePolicySchema: z.ZodObject<{
26
+ restrict_user_scopes: z.ZodBoolean;
27
+ user_scopes: z.ZodArray<z.ZodString>;
28
+ service_account_scopes: z.ZodArray<z.ZodString>;
29
+ }, z.core.$strict>;
30
+ export type AppApiScopePolicy = z.infer<typeof appApiScopePolicySchema>;
31
+ /** Body replacing the scope allowances of an app-to-API connection. */
32
+ export declare const updateAppApiScopePolicyRequestSchema: z.ZodObject<{
33
+ restrict_user_scopes: z.ZodBoolean;
34
+ user_scopes: z.ZodArray<z.ZodString>;
35
+ service_account_scopes: z.ZodArray<z.ZodString>;
36
+ }, z.core.$strict>;
37
+ export type UpdateAppApiScopePolicyRequest = z.infer<typeof updateAppApiScopePolicyRequestSchema>;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Per-app scope allowances ("client grants"): which of an API server's
3
+ * scopes a connected client application may be granted.
4
+ *
5
+ * - `user` allowance: the scopes users may delegate to the app on an
6
+ * authorization request. By default unrestricted (every scope the API
7
+ * server defines; each user still consents per scope); an API server
8
+ * owner may restrict it to a list.
9
+ * - `service_account` allowance: the scopes the app's own service account
10
+ * gets on the client_credentials grant, where no user consents. Empty by
11
+ * default: machine-to-machine tokens carry an API scope only when the API
12
+ * server owner listed it for that app.
13
+ *
14
+ * Dynamically registered clients have no connection; they may be granted
15
+ * the scopes flagged `allow_dynamic_clients` on the API server.
16
+ */
17
+ import { z } from "zod";
18
+ import { MAX_API_SCOPES_PER_API_SERVER, apiScopeValueSchema } from "./api-server-scope";
19
+ export const API_SCOPE_GRANTEES = ["user", "service_account"];
20
+ export const apiScopeGranteeSchema = z.enum(API_SCOPE_GRANTEES);
21
+ const scopeValueListSchema = z
22
+ .array(apiScopeValueSchema)
23
+ .max(MAX_API_SCOPES_PER_API_SERVER)
24
+ .refine((values) => new Set(values).size === values.length, {
25
+ message: "Scope values must be unique",
26
+ });
27
+ /** The scope allowances of one app-to-API connection. */
28
+ export const appApiScopePolicySchema = z
29
+ .object({
30
+ /**
31
+ * False (the default): users may grant the app every scope the API
32
+ * server defines. True: only `user_scopes`.
33
+ */
34
+ restrict_user_scopes: z.boolean(),
35
+ /** The scopes users may grant when `restrict_user_scopes` is on. */
36
+ user_scopes: z.array(z.string()),
37
+ /** The scopes the app's service account gets (client_credentials). */
38
+ service_account_scopes: z.array(z.string()),
39
+ })
40
+ .strict();
41
+ /** Body replacing the scope allowances of an app-to-API connection. */
42
+ export const updateAppApiScopePolicyRequestSchema = z
43
+ .object({
44
+ restrict_user_scopes: z.boolean(),
45
+ user_scopes: scopeValueListSchema,
46
+ service_account_scopes: scopeValueListSchema,
47
+ })
48
+ .strict();
49
+ //# sourceMappingURL=scope-grants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-grants.js","sourceRoot":"","sources":["../../src/api-scopes/scope-grants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAExF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAU,CAAC;AAEvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;AAEhE,MAAM,oBAAoB,GAAG,CAAC;KAC3B,KAAK,CAAC,mBAAmB,CAAC;KAC1B,GAAG,CAAC,6BAA6B,CAAC;KAClC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,EAAE;IAC1D,OAAO,EAAE,6BAA6B;CACvC,CAAC,CAAC;AAEL,yDAAyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN;;;OAGG;IACH,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE;IACjC,oEAAoE;IACpE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,sEAAsE;IACtE,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC5C,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,uEAAuE;AACvE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE;IACjC,WAAW,EAAE,oBAAoB;IACjC,sBAAsB,EAAE,oBAAoB;CAC7C,CAAC;KACD,MAAM,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ export * from "./pkce";
13
13
  export type * from "./pkce";
14
14
  export * from "./oidc";
15
15
  export type * from "./oidc";
16
+ export * from "./api-scopes";
17
+ export type * from "./api-scopes";
16
18
  export { sha256_base64url } from "./sha256_digest";
17
19
  export { authenticateResultSchema, authenticatedAuthenticateResultSchema, mfaRequiredAuthenticateResultSchema, authenticateFailureResultSchema, challengeExpiredAuthenticateResultSchema, emailVerificationRequiredAuthenticateResultSchema, availableMfaFactorSchema, collapseWebauthnFactors, type AuthenticateResult, type AuthenticatedAuthenticateResult, type MfaRequiredAuthenticateResult, type AuthenticateFailureResult, type ChallengeExpiredAuthenticateResult, type EmailVerificationRequiredAuthenticateResult, type AvailableMfaFactor, } from "./authenticate_result";
18
20
  export * from "./mfa";
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export * from "./token-data";
7
7
  export * from "./middleware";
8
8
  export * from "./pkce";
9
9
  export * from "./oidc";
10
+ export * from "./api-scopes";
10
11
  export { sha256_base64url } from "./sha256_digest";
11
12
  export { authenticateResultSchema, authenticatedAuthenticateResultSchema, mfaRequiredAuthenticateResultSchema, authenticateFailureResultSchema, challengeExpiredAuthenticateResultSchema, emailVerificationRequiredAuthenticateResultSchema, availableMfaFactorSchema, collapseWebauthnFactors, } from "./authenticate_result";
12
13
  export * from "./mfa";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,GACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,mCAAmC,EACnC,qCAAqC,GACtC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EAIvB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,EAC9B,yBAAyB,GAK1B,MAAM,aAAa,CAAC;AAErB,cAAc,eAAe,CAAC;AAG9B,mBAAmB;AACnB,cAAc,cA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qB,EACrB,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AAEtG,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAE9F,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC"}
@@ -1,5 +1,5 @@
1
- export { OIDC_OPENID_SCOPE, OIDC_SUPPORTED_SCOPES, DEFAULT_AUTH_SCOPE, OIDC_SCOPE_REGEX, oidcScopeSchema, parseAndGrantScopes, serializeOidcScopes, serializeOidcScopesOrNull, } from "./scope";
2
- export type { OidcSupportedScope, OidcScope, ParsedOidcScopes, } from "./scope";
1
+ export { OIDC_OPENID_SCOPE, OIDC_SUPPORTED_SCOPES, OIDC_RESERVED_SCOPES, isOidcReservedScope, DEFAULT_AUTH_SCOPE, OIDC_SCOPE_REGEX, oidcScopeSchema, parseAndGrantScopes, grantRequestedScopes, partitionGrantedScopes, serializeOidcScopes, serializeOidcScopesOrNull, } from "./scope";
2
+ export type { OidcSupportedScope, OidcScope, ParsedOidcScopes, GrantedScopes, } from "./scope";
3
3
  export { oidcNonceSchema, OIDC_NONCE_VSCHAR_REGEX, parseOidcNonce, OidcNonceValidationError, } from "./nonce";
4
4
  export type { OidcNonce } from "./nonce";
5
5
  export { OIDC_SUB_CLAIM_DELIMITER, formatOidcSubClaim, parseOidcSubClaim, } from "./sub-claim";
@@ -1,4 +1,4 @@
1
- export { OIDC_OPENID_SCOPE, OIDC_SUPPORTED_SCOPES, DEFAULT_AUTH_SCOPE, OIDC_SCOPE_REGEX, oidcScopeSchema, parseAndGrantScopes, serializeOidcScopes, serializeOidcScopesOrNull, } from "./scope";
1
+ export { OIDC_OPENID_SCOPE, OIDC_SUPPORTED_SCOPES, OIDC_RESERVED_SCOPES, isOidcReservedScope, DEFAULT_AUTH_SCOPE, OIDC_SCOPE_REGEX, oidcScopeSchema, parseAndGrantScopes, grantRequestedScopes, partitionGrantedScopes, serializeOidcScopes, serializeOidcScopesOrNull, } from "./scope";
2
2
  export { oidcNonceSchema, OIDC_NONCE_VSCHAR_REGEX, parseOidcNonce, OidcNonceValidationError, } from "./nonce";
3
3
  export { OIDC_SUB_CLAIM_DELIMITER, formatOidcSubClaim, parseOidcSubClaim, } from "./sub-claim";
4
4
  export { buildOidcProfileClaims } from "./profile-claims";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oidc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AAOjB,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAM1D,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,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MhE,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,0CAA0C,EAC1C,oCAAoC,EACpC,uCAAuC,EACvC,qCAAqC,EACrC,gCAAgC,EAChC,sCAAsC,GACvC,MAAM,+BAA+B,CAAC"}
@@ -17,10 +17,25 @@
17
17
  * granted set is echoed back in the token response, so RPs that
18
18
  * hardcode e.g. "openid profile email address" still interoperate, and
19
19
  * a request naming only unknown scopes degrades to a plain OAuth grant).
20
+ *
21
+ * API scopes: an API server (resource server) may define its own scope
22
+ * values (e.g. `notes:read`, see `api-scopes/`). They are granted only
23
+ * when the authorization request names that API server as its RFC 8707
24
+ * `resource` (`grantRequestedScopes`); without a resource they are
25
+ * unknown scopes and dropped exactly as before.
20
26
  */
21
27
  import { z } from "zod";
22
28
  export declare const OIDC_OPENID_SCOPE: "openid";
23
29
  export declare const OIDC_SUPPORTED_SCOPES: readonly ["openid", "email", "profile"];
30
+ /**
31
+ * The scope values OpenID Connect Core §5.4 / §11 standardize. No API
32
+ * server may define one of them as an API scope (even those this server
33
+ * does not support yet), so a granted scope string always splits
34
+ * unambiguously into its OIDC part and its API part
35
+ * (`partitionGrantedScopes`).
36
+ */
37
+ export declare const OIDC_RESERVED_SCOPES: readonly ["openid", "profile", "email", "address", "phone", "offline_access"];
38
+ export declare function isOidcReservedScope(scope: string): boolean;
24
39
  /**
25
40
  * Scope requested by default when a flow does not name one explicitly:
26
41
  * the SDK's `authenticateWithRedirect`/`sendAuthenticateRequest`
@@ -71,6 +86,39 @@ export interface ParsedOidcScopes {
71
86
  * malformed value from an absent one check `oidcScopeSchema` first.
72
87
  */
73
88
  export declare function parseAndGrantScopes(raw: unknown): ParsedOidcScopes;
89
+ export interface GrantedScopes {
90
+ /**
91
+ * Every granted scope (OIDC and API scopes), deduplicated, in request
92
+ * order.
93
+ */
94
+ granted: string[];
95
+ /** The OIDC scopes among `granted` (see `parseAndGrantScopes`). */
96
+ oidc: OidcSupportedScope[];
97
+ /** The API scopes among `granted`. */
98
+ api: string[];
99
+ /** Whether `granted` includes `openid`. */
100
+ hasOpenid: boolean;
101
+ }
102
+ /**
103
+ * Like `parseAndGrantScopes`, but also grants the requested scopes that
104
+ * `api_scopes` lists: the scope values defined by the API server the
105
+ * grant's RFC 8707 `resource` resolved to. Every other scope is still
106
+ * dropped (RFC 6749 §3.3), and so is any OIDC reserved name in
107
+ * `api_scopes`. With no `api_scopes` the result grants exactly what
108
+ * `parseAndGrantScopes` grants.
109
+ */
110
+ export declare function grantRequestedScopes(raw: unknown, api_scopes?: Iterable<string>): GrantedScopes;
111
+ /**
112
+ * Splits a granted scope string (an authorization code row, a token's
113
+ * `scope` claim) into its OIDC scopes and its API scopes. Only granted
114
+ * sets are stored, and API scopes can never take an OIDC reserved name,
115
+ * so every token that is not a supported OIDC scope is an API scope.
116
+ * Null / empty is the empty grant (a plain OAuth 2.1 grant).
117
+ */
118
+ export declare function partitionGrantedScopes(scope: string | null | undefined): {
119
+ oidc: OidcSupportedScope[];
120
+ api: string[];
121
+ };
74
122
  /**
75
123
  * Serializes granted scopes back to the space-delimited wire format for
76
124
  * the token response `scope` field and the AUTHORIZATION_CODES row.
@@ -17,10 +17,34 @@
17
17
  * granted set is echoed back in the token response, so RPs that
18
18
  * hardcode e.g. "openid profile email address" still interoperate, and
19
19
  * a request naming only unknown scopes degrades to a plain OAuth grant).
20
+ *
21
+ * API scopes: an API server (resource server) may define its own scope
22
+ * values (e.g. `notes:read`, see `api-scopes/`). They are granted only
23
+ * when the authorization request names that API server as its RFC 8707
24
+ * `resource` (`grantRequestedScopes`); without a resource they are
25
+ * unknown scopes and dropped exactly as before.
20
26
  */
21
27
  import { z } from "zod";
22
28
  export const OIDC_OPENID_SCOPE = "openid";
23
29
  export const OIDC_SUPPORTED_SCOPES = ["openid", "email", "profile"];
30
+ /**
31
+ * The scope values OpenID Connect Core §5.4 / §11 standardize. No API
32
+ * server may define one of them as an API scope (even those this server
33
+ * does not support yet), so a granted scope string always splits
34
+ * unambiguously into its OIDC part and its API part
35
+ * (`partitionGrantedScopes`).
36
+ */
37
+ export const OIDC_RESERVED_SCOPES = [
38
+ "openid",
39
+ "profile",
40
+ "email",
41
+ "address",
42
+ "phone",
43
+ "offline_access",
44
+ ];
45
+ export function isOidcReservedScope(scope) {
46
+ return OIDC_RESERVED_SCOPES.includes(scope);
47
+ }
24
48
  /**
25
49
  * Scope requested by default when a flow does not name one explicitly:
26
50
  * the SDK's `authenticateWithRedirect`/`sendAuthenticateRequest`
@@ -85,6 +109,68 @@ export function parseAndGrantScopes(raw) {
85
109
  }
86
110
  return { granted, hasOpenid: granted.includes(OIDC_OPENID_SCOPE) };
87
111
  }
112
+ /**
113
+ * Like `parseAndGrantScopes`, but also grants the requested scopes that
114
+ * `api_scopes` lists: the scope values defined by the API server the
115
+ * grant's RFC 8707 `resource` resolved to. Every other scope is still
116
+ * dropped (RFC 6749 §3.3), and so is any OIDC reserved name in
117
+ * `api_scopes`. With no `api_scopes` the result grants exactly what
118
+ * `parseAndGrantScopes` grants.
119
+ */
120
+ export function grantRequestedScopes(raw, api_scopes = []) {
121
+ const { granted: oidc, hasOpenid } = parseAndGrantScopes(raw);
122
+ const grantable_api_scopes = new Set();
123
+ for (const scope of api_scopes) {
124
+ if (typeof scope === "string" && !isOidcReservedScope(scope)) {
125
+ grantable_api_scopes.add(scope);
126
+ }
127
+ }
128
+ if (grantable_api_scopes.size === 0 ||
129
+ typeof raw !== "string" ||
130
+ !oidcScopeSchema.safeParse(raw).success) {
131
+ return { granted: [...oidc], oidc, api: [], hasOpenid };
132
+ }
133
+ const granted = [];
134
+ const api = [];
135
+ for (const token of raw.split(" ")) {
136
+ if (!token || granted.includes(token))
137
+ continue;
138
+ if (oidc.includes(token)) {
139
+ granted.push(token);
140
+ }
141
+ else if (grantable_api_scopes.has(token)) {
142
+ granted.push(token);
143
+ api.push(token);
144
+ }
145
+ }
146
+ return { granted, oidc, api, hasOpenid };
147
+ }
148
+ /**
149
+ * Splits a granted scope string (an authorization code row, a token's
150
+ * `scope` claim) into its OIDC scopes and its API scopes. Only granted
151
+ * sets are stored, and API scopes can never take an OIDC reserved name,
152
+ * so every token that is not a supported OIDC scope is an API scope.
153
+ * Null / empty is the empty grant (a plain OAuth 2.1 grant).
154
+ */
155
+ export function partitionGrantedScopes(scope) {
156
+ const oidc = [];
157
+ const api = [];
158
+ if (typeof scope !== "string") {
159
+ return { oidc, api };
160
+ }
161
+ for (const token of scope.split(" ")) {
162
+ if (!token)
163
+ continue;
164
+ if (isSupportedOidcScope(token)) {
165
+ if (!oidc.includes(token))
166
+ oidc.push(token);
167
+ }
168
+ else if (!isOidcReservedScope(token) && !api.includes(token)) {
169
+ api.push(token);
170
+ }
171
+ }
172
+ return { oidc, api };
173
+ }
88
174
  /**
89
175
  * Serializes granted scopes back to the space-delimited wire format for
90
176
  * the token response `scope` field and the AUTHORIZATION_CODES row.
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/oidc/scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAiB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAA+B,CAAC;AAElE,MAAM,qBAAqB,GAAG,GAAY,CAAC;AAE3C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,4DAA4D,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,qBAAqB,CAAC;KAC1B,KAAK,CAAC,gBAAgB,EAAE;IACvB,OAAO,EACL,sEAAsE;CACzE,C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;IACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;aAAM,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/D,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAyB;IAC3D,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAyB;IAEzB,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAClE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@schemavaults/auth-common",
3
3
  "description": "Types and utility functions for authentication and authorization",
4
- "version": "0.33.2",
4
+ "version": "0.35.0",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "repository": {