@atcute/oauth-types 0.1.0 → 1.0.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.
- package/README.md +6 -5
- package/dist/build-client-metadata.d.ts +18 -160
- package/dist/build-client-metadata.d.ts.map +1 -1
- package/dist/build-client-metadata.js +73 -3
- package/dist/build-client-metadata.js.map +1 -1
- package/dist/index.d.ts +31 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/atcute-client-shared.d.ts +8 -0
- package/dist/schemas/atcute-client-shared.d.ts.map +1 -0
- package/dist/schemas/atcute-client-shared.js +15 -0
- package/dist/schemas/atcute-client-shared.js.map +1 -0
- package/dist/schemas/atcute-confidential-client-metadata.d.ts +228 -4
- package/dist/schemas/atcute-confidential-client-metadata.d.ts.map +1 -1
- package/dist/schemas/atcute-confidential-client-metadata.js +48 -88
- package/dist/schemas/atcute-confidential-client-metadata.js.map +1 -1
- package/dist/schemas/atcute-public-client-metadata.d.ts +95 -0
- package/dist/schemas/atcute-public-client-metadata.d.ts.map +1 -0
- package/dist/schemas/atcute-public-client-metadata.js +74 -0
- package/dist/schemas/atcute-public-client-metadata.js.map +1 -0
- package/dist/schemas/atproto-authorization-server-metadata.d.ts +786 -4
- package/dist/schemas/atproto-authorization-server-metadata.d.ts.map +1 -1
- package/dist/schemas/atproto-authorization-server-metadata.js +2 -18
- package/dist/schemas/atproto-authorization-server-metadata.js.map +1 -1
- package/dist/schemas/atproto-oauth-scope.d.ts +3 -3
- package/dist/schemas/atproto-oauth-scope.d.ts.map +1 -1
- package/dist/schemas/atproto-oauth-scope.js +2 -2
- package/dist/schemas/atproto-oauth-scope.js.map +1 -1
- package/dist/schemas/atproto-oauth-token-response.d.ts +17 -17
- package/dist/schemas/atproto-oauth-token-response.d.ts.map +1 -1
- package/dist/schemas/atproto-oauth-token-response.js +6 -6
- package/dist/schemas/atproto-oauth-token-response.js.map +1 -1
- package/dist/schemas/atproto-protected-resource-metadata.d.ts +100 -4
- package/dist/schemas/atproto-protected-resource-metadata.d.ts.map +1 -1
- package/dist/schemas/atproto-protected-resource-metadata.js +2 -11
- package/dist/schemas/atproto-protected-resource-metadata.js.map +1 -1
- package/dist/schemas/jwk.d.ts +4289 -42
- package/dist/schemas/jwk.d.ts.map +1 -1
- package/dist/schemas/jwk.js +58 -91
- package/dist/schemas/jwk.js.map +1 -1
- package/dist/schemas/jwks.d.ts +87 -42
- package/dist/schemas/jwks.d.ts.map +1 -1
- package/dist/schemas/jwks.js +13 -29
- package/dist/schemas/jwks.js.map +1 -1
- package/dist/schemas/oauth-authorization-details.d.ts +18 -18
- package/dist/schemas/oauth-authorization-details.d.ts.map +1 -1
- package/dist/schemas/oauth-authorization-details.js +7 -7
- package/dist/schemas/oauth-authorization-details.js.map +1 -1
- package/dist/schemas/oauth-authorization-server-metadata.d.ts +462 -48
- package/dist/schemas/oauth-authorization-server-metadata.d.ts.map +1 -1
- package/dist/schemas/oauth-authorization-server-metadata.js +46 -65
- package/dist/schemas/oauth-authorization-server-metadata.js.map +1 -1
- package/dist/schemas/oauth-client-id-discoverable.d.ts +2 -2
- package/dist/schemas/oauth-client-id-discoverable.d.ts.map +1 -1
- package/dist/schemas/oauth-client-id-discoverable.js +20 -22
- package/dist/schemas/oauth-client-id-discoverable.js.map +1 -1
- package/dist/schemas/oauth-client-id.d.ts +3 -3
- package/dist/schemas/oauth-client-id.d.ts.map +1 -1
- package/dist/schemas/oauth-client-id.js +2 -2
- package/dist/schemas/oauth-client-id.js.map +1 -1
- package/dist/schemas/oauth-client-metadata.d.ts +73 -51
- package/dist/schemas/oauth-client-metadata.d.ts.map +1 -1
- package/dist/schemas/oauth-client-metadata.js +33 -40
- package/dist/schemas/oauth-client-metadata.js.map +1 -1
- package/dist/schemas/oauth-code-challenge-method.d.ts +3 -3
- package/dist/schemas/oauth-code-challenge-method.d.ts.map +1 -1
- package/dist/schemas/oauth-code-challenge-method.js +2 -2
- package/dist/schemas/oauth-code-challenge-method.js.map +1 -1
- package/dist/schemas/oauth-endpoint-auth-method.d.ts +3 -3
- package/dist/schemas/oauth-endpoint-auth-method.d.ts.map +1 -1
- package/dist/schemas/oauth-endpoint-auth-method.js +10 -2
- package/dist/schemas/oauth-endpoint-auth-method.js.map +1 -1
- package/dist/schemas/oauth-grant-type.d.ts +3 -3
- package/dist/schemas/oauth-grant-type.d.ts.map +1 -1
- package/dist/schemas/oauth-grant-type.js +10 -3
- package/dist/schemas/oauth-grant-type.js.map +1 -1
- package/dist/schemas/oauth-issuer-identifier.d.ts +3 -3
- package/dist/schemas/oauth-issuer-identifier.d.ts.map +1 -1
- package/dist/schemas/oauth-issuer-identifier.js +16 -9
- package/dist/schemas/oauth-issuer-identifier.js.map +1 -1
- package/dist/schemas/oauth-par-response.d.ts +5 -5
- package/dist/schemas/oauth-par-response.d.ts.map +1 -1
- package/dist/schemas/oauth-par-response.js +3 -3
- package/dist/schemas/oauth-par-response.js.map +1 -1
- package/dist/schemas/oauth-prompt.d.ts +3 -3
- package/dist/schemas/oauth-prompt.d.ts.map +1 -1
- package/dist/schemas/oauth-prompt.js +2 -2
- package/dist/schemas/oauth-prompt.js.map +1 -1
- package/dist/schemas/oauth-protected-resource-metadata.d.ts +88 -16
- package/dist/schemas/oauth-protected-resource-metadata.d.ts.map +1 -1
- package/dist/schemas/oauth-protected-resource-metadata.js +14 -26
- package/dist/schemas/oauth-protected-resource-metadata.js.map +1 -1
- package/dist/schemas/oauth-redirect-uri.d.ts +5 -5
- package/dist/schemas/oauth-redirect-uri.d.ts.map +1 -1
- package/dist/schemas/oauth-redirect-uri.js +3 -16
- package/dist/schemas/oauth-redirect-uri.js.map +1 -1
- package/dist/schemas/oauth-response-mode.d.ts +3 -3
- package/dist/schemas/oauth-response-mode.d.ts.map +1 -1
- package/dist/schemas/oauth-response-mode.js +2 -2
- package/dist/schemas/oauth-response-mode.js.map +1 -1
- package/dist/schemas/oauth-response-type.d.ts +3 -3
- package/dist/schemas/oauth-response-type.d.ts.map +1 -1
- package/dist/schemas/oauth-response-type.js +13 -7
- package/dist/schemas/oauth-response-type.js.map +1 -1
- package/dist/schemas/oauth-scope.d.ts +3 -3
- package/dist/schemas/oauth-scope.d.ts.map +1 -1
- package/dist/schemas/oauth-scope.js +2 -2
- package/dist/schemas/oauth-scope.js.map +1 -1
- package/dist/schemas/oauth-token-response.d.ts +17 -17
- package/dist/schemas/oauth-token-response.d.ts.map +1 -1
- package/dist/schemas/oauth-token-response.js +7 -7
- package/dist/schemas/oauth-token-response.js.map +1 -1
- package/dist/schemas/oauth-token-type.d.ts +3 -3
- package/dist/schemas/oauth-token-type.d.ts.map +1 -1
- package/dist/schemas/oauth-token-type.js +8 -7
- package/dist/schemas/oauth-token-type.js.map +1 -1
- package/dist/schemas/uri.d.ts +7 -7
- package/dist/schemas/uri.d.ts.map +1 -1
- package/dist/schemas/uri.js +44 -44
- package/dist/schemas/uri.js.map +1 -1
- package/dist/schemas/utils.d.ts.map +1 -1
- package/dist/schemas/utils.js.map +1 -1
- package/dist/scope.d.ts.map +1 -1
- package/dist/scope.js.map +1 -1
- package/lib/build-client-metadata.ts +92 -6
- package/lib/index.ts +38 -30
- package/lib/schemas/atcute-client-shared.ts +25 -0
- package/lib/schemas/atcute-confidential-client-metadata.ts +81 -111
- package/lib/schemas/atcute-public-client-metadata.ts +101 -0
- package/lib/schemas/atproto-authorization-server-metadata.ts +22 -23
- package/lib/schemas/atproto-oauth-scope.ts +8 -5
- package/lib/schemas/atproto-oauth-token-response.ts +10 -9
- package/lib/schemas/atproto-protected-resource-metadata.ts +15 -15
- package/lib/schemas/jwk.ts +104 -120
- package/lib/schemas/jwks.ts +28 -40
- package/lib/schemas/oauth-authorization-details.ts +10 -10
- package/lib/schemas/oauth-authorization-server-metadata.ts +72 -74
- package/lib/schemas/oauth-client-id-discoverable.ts +43 -48
- package/lib/schemas/oauth-client-id.ts +3 -3
- package/lib/schemas/oauth-client-metadata.ts +45 -49
- package/lib/schemas/oauth-code-challenge-method.ts +3 -3
- package/lib/schemas/oauth-endpoint-auth-method.ts +11 -11
- package/lib/schemas/oauth-grant-type.ts +11 -11
- package/lib/schemas/oauth-issuer-identifier.ts +35 -27
- package/lib/schemas/oauth-par-response.ts +4 -4
- package/lib/schemas/oauth-prompt.ts +3 -9
- package/lib/schemas/oauth-protected-resource-metadata.ts +26 -35
- package/lib/schemas/oauth-redirect-uri.ts +15 -23
- package/lib/schemas/oauth-response-mode.ts +3 -7
- package/lib/schemas/oauth-response-type.ts +12 -12
- package/lib/schemas/oauth-scope.ts +3 -3
- package/lib/schemas/oauth-token-response.ts +10 -10
- package/lib/schemas/oauth-token-type.ts +16 -12
- package/lib/schemas/uri.ts +89 -76
- package/package.json +9 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as v from '
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
import { jwksPubSchema } from './jwks.js';
|
|
3
3
|
import { oauthClientIdSchema } from './oauth-client-id.js';
|
|
4
4
|
import { oauthEndpointAuthMethodSchema } from './oauth-endpoint-auth-method.js';
|
|
@@ -7,8 +7,8 @@ import { oauthRedirectUriSchema } from './oauth-redirect-uri.js';
|
|
|
7
7
|
import { oauthResponseTypeSchema } from './oauth-response-type.js';
|
|
8
8
|
import { oauthScopeSchema } from './oauth-scope.js';
|
|
9
9
|
import { webUriSchema } from './uri.js';
|
|
10
|
-
const oauthApplicationTypeSchema = v.
|
|
11
|
-
const oauthSubjectTypeSchema = v.
|
|
10
|
+
const oauthApplicationTypeSchema = v.picklist(['web', 'native']);
|
|
11
|
+
const oauthSubjectTypeSchema = v.picklist(['public', 'pairwise']);
|
|
12
12
|
// simple email validation
|
|
13
13
|
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
14
14
|
/**
|
|
@@ -17,44 +17,37 @@ const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
|
17
17
|
* @see {@link https://openid.net/specs/openid-connect-registration-1_0.html}
|
|
18
18
|
* @see {@link https://datatracker.ietf.org/doc/html/rfc7591}
|
|
19
19
|
*/
|
|
20
|
-
export const oauthClientMetadataSchema = v.
|
|
20
|
+
export const oauthClientMetadataSchema = v.looseObject({
|
|
21
21
|
// https://www.rfc-editor.org/rfc/rfc7591.html#section-2
|
|
22
|
-
redirect_uris: v
|
|
23
|
-
|
|
24
|
-
.assert((arr) => arr.length > 0, `must have at least one redirect URI`),
|
|
25
|
-
response_types: v.array(oauthResponseTypeSchema).optional(),
|
|
22
|
+
redirect_uris: v.pipe(v.array(oauthRedirectUriSchema), v.minLength(1, `must have at least one redirect URI`)),
|
|
23
|
+
response_types: v.optional(v.array(oauthResponseTypeSchema)),
|
|
26
24
|
// > If omitted, the default is that the client will use only the "code"
|
|
27
25
|
// > response type.
|
|
28
|
-
|
|
29
|
-
grant_types: v.array(oauthGrantTypeSchema).optional(),
|
|
26
|
+
grant_types: v.optional(v.array(oauthGrantTypeSchema)),
|
|
30
27
|
// > If omitted, the default behavior is that the client will use only the
|
|
31
28
|
// > "authorization_code" Grant Type.
|
|
32
|
-
|
|
33
|
-
scope: oauthScopeSchema.optional(),
|
|
29
|
+
scope: v.optional(oauthScopeSchema),
|
|
34
30
|
// https://www.rfc-editor.org/rfc/rfc7591.html#section-2
|
|
35
|
-
token_endpoint_auth_method:
|
|
31
|
+
token_endpoint_auth_method: v.optional(oauthEndpointAuthMethodSchema),
|
|
36
32
|
// > If unspecified or omitted, the default is "client_secret_basic" [...].
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
policy_uri: webUriSchema.optional(),
|
|
56
|
-
tos_uri: webUriSchema.optional(),
|
|
57
|
-
logo_uri: webUriSchema.optional(),
|
|
33
|
+
token_endpoint_auth_signing_alg: v.optional(v.string()),
|
|
34
|
+
userinfo_signed_response_alg: v.optional(v.string()),
|
|
35
|
+
userinfo_encrypted_response_alg: v.optional(v.string()),
|
|
36
|
+
jwks_uri: v.optional(webUriSchema),
|
|
37
|
+
jwks: v.optional(jwksPubSchema),
|
|
38
|
+
application_type: v.optional(oauthApplicationTypeSchema),
|
|
39
|
+
subject_type: v.optional(oauthSubjectTypeSchema),
|
|
40
|
+
request_object_signing_alg: v.optional(v.string()),
|
|
41
|
+
id_token_signed_response_alg: v.optional(v.string()),
|
|
42
|
+
authorization_signed_response_alg: v.optional(v.string()),
|
|
43
|
+
authorization_encrypted_response_enc: v.optional(v.literal('A128CBC-HS256')),
|
|
44
|
+
authorization_encrypted_response_alg: v.optional(v.string()),
|
|
45
|
+
client_id: v.optional(oauthClientIdSchema),
|
|
46
|
+
client_name: v.optional(v.string()),
|
|
47
|
+
client_uri: v.optional(webUriSchema),
|
|
48
|
+
policy_uri: v.optional(webUriSchema),
|
|
49
|
+
tos_uri: v.optional(webUriSchema),
|
|
50
|
+
logo_uri: v.optional(webUriSchema),
|
|
58
51
|
/**
|
|
59
52
|
* default Maximum Authentication Age. specifies that the End-User MUST be
|
|
60
53
|
* actively authenticated if the End-User was authenticated longer ago than
|
|
@@ -62,13 +55,13 @@ export const oauthClientMetadataSchema = v.object({
|
|
|
62
55
|
* this default value. if omitted, no default Maximum Authentication Age is
|
|
63
56
|
* specified.
|
|
64
57
|
*/
|
|
65
|
-
default_max_age: v.
|
|
66
|
-
require_auth_time: v.
|
|
67
|
-
contacts: v.array(v.
|
|
68
|
-
tls_client_certificate_bound_access_tokens: v.
|
|
58
|
+
default_max_age: v.optional(v.number()),
|
|
59
|
+
require_auth_time: v.optional(v.boolean()),
|
|
60
|
+
contacts: v.optional(v.array(v.pipe(v.string(), v.regex(EMAIL_RE, `must be a valid email`)))),
|
|
61
|
+
tls_client_certificate_bound_access_tokens: v.optional(v.boolean()),
|
|
69
62
|
// https://datatracker.ietf.org/doc/html/rfc9449#section-5.2
|
|
70
|
-
dpop_bound_access_tokens: v.
|
|
63
|
+
dpop_bound_access_tokens: v.optional(v.boolean()),
|
|
71
64
|
// https://datatracker.ietf.org/doc/html/rfc9396#section-14.5
|
|
72
|
-
authorization_details_types: v.array(v.string())
|
|
65
|
+
authorization_details_types: v.optional(v.array(v.string())),
|
|
73
66
|
});
|
|
74
67
|
//# sourceMappingURL=oauth-client-metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-client-metadata.js","sourceRoot":"","sources":["../../lib/schemas/oauth-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-client-metadata.js","sourceRoot":"","sources":["../../lib/schemas/oauth-client-metadata.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export declare const oauthCodeChallengeMethodSchema: v.
|
|
3
|
-
export type OAuthCodeChallengeMethod = v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const oauthCodeChallengeMethodSchema: v.PicklistSchema<["S256", "plain"], undefined>;
|
|
3
|
+
export type OAuthCodeChallengeMethod = v.InferOutput<typeof oauthCodeChallengeMethodSchema>;
|
|
4
4
|
//# sourceMappingURL=oauth-code-challenge-method.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-code-challenge-method.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-code-challenge-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-code-challenge-method.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-code-challenge-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,8BAA8B,gDAAgC,CAAC;AAE5E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export const oauthCodeChallengeMethodSchema = v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export const oauthCodeChallengeMethodSchema = v.picklist(['S256', 'plain']);
|
|
3
3
|
//# sourceMappingURL=oauth-code-challenge-method.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-code-challenge-method.js","sourceRoot":"","sources":["../../lib/schemas/oauth-code-challenge-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-code-challenge-method.js","sourceRoot":"","sources":["../../lib/schemas/oauth-code-challenge-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export declare const oauthEndpointAuthMethodSchema: v.
|
|
3
|
-
export type OAuthEndpointAuthMethod = v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const oauthEndpointAuthMethodSchema: v.PicklistSchema<["client_secret_basic", "client_secret_jwt", "client_secret_post", "none", "private_key_jwt", "self_signed_tls_client_auth", "tls_client_auth"], undefined>;
|
|
3
|
+
export type OAuthEndpointAuthMethod = v.InferOutput<typeof oauthEndpointAuthMethodSchema>;
|
|
4
4
|
//# sourceMappingURL=oauth-endpoint-auth-method.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-endpoint-auth-method.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-endpoint-auth-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-endpoint-auth-method.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-endpoint-auth-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,6BAA6B,8KAQxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export const oauthEndpointAuthMethodSchema = v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export const oauthEndpointAuthMethodSchema = v.picklist([
|
|
3
|
+
'client_secret_basic',
|
|
4
|
+
'client_secret_jwt',
|
|
5
|
+
'client_secret_post',
|
|
6
|
+
'none',
|
|
7
|
+
'private_key_jwt',
|
|
8
|
+
'self_signed_tls_client_auth',
|
|
9
|
+
'tls_client_auth',
|
|
10
|
+
]);
|
|
3
11
|
//# sourceMappingURL=oauth-endpoint-auth-method.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-endpoint-auth-method.js","sourceRoot":"","sources":["../../lib/schemas/oauth-endpoint-auth-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-endpoint-auth-method.js","sourceRoot":"","sources":["../../lib/schemas/oauth-endpoint-auth-method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,QAAQ,CAAC;IACvD,qBAAqB;IACrB,mBAAmB;IACnB,oBAAoB;IACpB,MAAM;IACN,iBAAiB;IACjB,6BAA6B;IAC7B,iBAAiB;CACjB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export declare const oauthGrantTypeSchema: v.
|
|
3
|
-
export type OAuthGrantType = v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const oauthGrantTypeSchema: v.PicklistSchema<["authorization_code", "implicit", "refresh_token", "password", "client_credentials", "urn:ietf:params:oauth:grant-type:jwt-bearer", "urn:ietf:params:oauth:grant-type:saml2-bearer"], undefined>;
|
|
3
|
+
export type OAuthGrantType = v.InferOutput<typeof oauthGrantTypeSchema>;
|
|
4
4
|
//# sourceMappingURL=oauth-grant-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-grant-type.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-grant-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-grant-type.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-grant-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,oBAAoB,oNAQ/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export const oauthGrantTypeSchema = v.
|
|
3
|
-
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export const oauthGrantTypeSchema = v.picklist([
|
|
3
|
+
'authorization_code',
|
|
4
|
+
'implicit',
|
|
5
|
+
'refresh_token',
|
|
6
|
+
'password', // not part of OAuth 2.1
|
|
7
|
+
'client_credentials',
|
|
8
|
+
'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
|
9
|
+
'urn:ietf:params:oauth:grant-type:saml2-bearer',
|
|
10
|
+
]);
|
|
4
11
|
//# sourceMappingURL=oauth-grant-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-grant-type.js","sourceRoot":"","sources":["../../lib/schemas/oauth-grant-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-grant-type.js","sourceRoot":"","sources":["../../lib/schemas/oauth-grant-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,QAAQ,CAAC;IAC9C,oBAAoB;IACpB,UAAU;IACV,eAAe;IACf,UAAU,EAAE,wBAAwB;IACpC,oBAAoB;IACpB,6CAA6C;IAC7C,+CAA+C;CAC/C,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export declare const oauthIssuerIdentifierSchema: v.
|
|
3
|
-
export type OAuthIssuerIdentifier = v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const oauthIssuerIdentifierSchema: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, v.RawCheckAction<string>]>;
|
|
3
|
+
export type OAuthIssuerIdentifier = v.InferOutput<typeof oauthIssuerIdentifierSchema>;
|
|
4
4
|
//# sourceMappingURL=oauth-issuer-identifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-issuer-identifier.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-issuer-identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-issuer-identifier.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-issuer-identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAI7B,eAAO,MAAM,2BAA2B,2aA+BvC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import * as v from '
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
import { webUriSchema } from './uri.js';
|
|
3
|
-
export const oauthIssuerIdentifierSchema =
|
|
4
|
-
|
|
3
|
+
export const oauthIssuerIdentifierSchema = v.pipe(webUriSchema,
|
|
4
|
+
// validate the issuer (MIX-UP attacks)
|
|
5
|
+
v.rawCheck(({ dataset, addIssue }) => {
|
|
6
|
+
if (!dataset.typed) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const input = dataset.value;
|
|
5
10
|
if (input.endsWith('/')) {
|
|
6
|
-
|
|
11
|
+
addIssue({ message: `issuer URL must not end with a slash` });
|
|
12
|
+
return;
|
|
7
13
|
}
|
|
8
14
|
const url = new URL(input);
|
|
9
15
|
if (url.username || url.password) {
|
|
10
|
-
|
|
16
|
+
addIssue({ message: `issuer URL must not contain a username or password` });
|
|
17
|
+
return;
|
|
11
18
|
}
|
|
12
19
|
if (url.hash || url.search) {
|
|
13
|
-
|
|
20
|
+
addIssue({ message: `issuer URL must not contain a query or fragment` });
|
|
21
|
+
return;
|
|
14
22
|
}
|
|
15
23
|
const canonicalValue = url.pathname === '/' ? url.origin : url.href;
|
|
16
24
|
if (input !== canonicalValue) {
|
|
17
|
-
|
|
25
|
+
addIssue({ message: `issuer URL must be in the canonical form` });
|
|
18
26
|
}
|
|
19
|
-
|
|
20
|
-
});
|
|
27
|
+
}));
|
|
21
28
|
//# sourceMappingURL=oauth-issuer-identifier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-issuer-identifier.js","sourceRoot":"","sources":["../../lib/schemas/oauth-issuer-identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-issuer-identifier.js","sourceRoot":"","sources":["../../lib/schemas/oauth-issuer-identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAChD,YAAY;AACZ,uCAAuC;AACvC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO;IACR,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAE5B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC,CAAC;QAC9D,OAAO;IACR,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAE3B,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QAClC,QAAQ,CAAC,EAAE,OAAO,EAAE,oDAAoD,EAAE,CAAC,CAAC;QAC5E,OAAO;IACR,CAAC;IAED,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QAC5B,QAAQ,CAAC,EAAE,OAAO,EAAE,iDAAiD,EAAE,CAAC,CAAC;QACzE,OAAO;IACR,CAAC;IAED,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACpE,IAAI,KAAK,KAAK,cAAc,EAAE,CAAC;QAC9B,QAAQ,CAAC,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC,CAAC;IACnE,CAAC;AACF,CAAC,CAAC,CACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export declare const oauthParResponseSchema: v.
|
|
3
|
-
request_uri: v.
|
|
4
|
-
expires_in: v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const oauthParResponseSchema: v.LooseObjectSchema<{
|
|
3
|
+
readonly request_uri: v.StringSchema<undefined>;
|
|
4
|
+
readonly expires_in: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.CheckAction<number, "must be a positive integer">]>;
|
|
5
5
|
}, undefined>;
|
|
6
|
-
export type OAuthParResponse = v.
|
|
6
|
+
export type OAuthParResponse = v.InferOutput<typeof oauthParResponseSchema>;
|
|
7
7
|
//# sourceMappingURL=oauth-par-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-par-response.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-par-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-par-response.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-par-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAI7B,eAAO,MAAM,sBAAsB;;;aAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as v from '
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
const isPositiveInteger = (n) => Number.isInteger(n) && n > 0;
|
|
3
|
-
export const oauthParResponseSchema = v.
|
|
3
|
+
export const oauthParResponseSchema = v.looseObject({
|
|
4
4
|
request_uri: v.string(),
|
|
5
|
-
expires_in: v.number().
|
|
5
|
+
expires_in: v.pipe(v.number(), v.check(isPositiveInteger, `must be a positive integer`)),
|
|
6
6
|
});
|
|
7
7
|
//# sourceMappingURL=oauth-par-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-par-response.js","sourceRoot":"","sources":["../../lib/schemas/oauth-par-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-par-response.js","sourceRoot":"","sources":["../../lib/schemas/oauth-par-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,MAAM,iBAAiB,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC;IACnD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,EAAE,4BAA4B,CAAC,CAAC;CACxF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as v from '
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
/**
|
|
3
3
|
* OAuth prompt mode values.
|
|
4
4
|
*
|
|
@@ -8,6 +8,6 @@ import * as v from '@badrap/valita';
|
|
|
8
8
|
* - `select_account`: force account selection
|
|
9
9
|
* - `create`: force user registration screen
|
|
10
10
|
*/
|
|
11
|
-
export declare const oauthPromptSchema: v.
|
|
12
|
-
export type OAuthPrompt = v.
|
|
11
|
+
export declare const oauthPromptSchema: v.PicklistSchema<["none", "login", "consent", "select_account", "create"], undefined>;
|
|
12
|
+
export type OAuthPrompt = v.InferOutput<typeof oauthPromptSchema>;
|
|
13
13
|
//# sourceMappingURL=oauth-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-prompt.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-prompt.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,uFAAuE,CAAC;AAEtG,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as v from '
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
/**
|
|
3
3
|
* OAuth prompt mode values.
|
|
4
4
|
*
|
|
@@ -8,5 +8,5 @@ import * as v from '@badrap/valita';
|
|
|
8
8
|
* - `select_account`: force account selection
|
|
9
9
|
* - `create`: force user registration screen
|
|
10
10
|
*/
|
|
11
|
-
export const oauthPromptSchema = v.
|
|
11
|
+
export const oauthPromptSchema = v.picklist(['none', 'login', 'consent', 'select_account', 'create']);
|
|
12
12
|
//# sourceMappingURL=oauth-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-prompt.js","sourceRoot":"","sources":["../../lib/schemas/oauth-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-prompt.js","sourceRoot":"","sources":["../../lib/schemas/oauth-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC"}
|
|
@@ -1,57 +1,127 @@
|
|
|
1
|
-
import * as v from '
|
|
2
|
-
export declare const oauthBearerMethodSchema: v.
|
|
3
|
-
export type OAuthBearerMethod = v.
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const oauthBearerMethodSchema: v.PicklistSchema<["header", "body", "query"], undefined>;
|
|
3
|
+
export type OAuthBearerMethod = v.InferOutput<typeof oauthBearerMethodSchema>;
|
|
4
4
|
/**
|
|
5
5
|
* @see {@link https://www.rfc-editor.org/rfc/rfc9728.html#section-3.2}
|
|
6
6
|
*/
|
|
7
|
-
export declare const oauthProtectedResourceMetadataSchema: v.
|
|
7
|
+
export declare const oauthProtectedResourceMetadataSchema: v.LooseObjectSchema<{
|
|
8
8
|
/**
|
|
9
9
|
* REQUIRED. the protected resource's resource identifier, which is a URL that
|
|
10
10
|
* uses the https scheme and has no query or fragment components.
|
|
11
11
|
*/
|
|
12
|
-
resource: v.
|
|
12
|
+
readonly resource: v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">;
|
|
13
13
|
/**
|
|
14
14
|
* OPTIONAL. JSON array containing a list of OAuth authorization server issuer
|
|
15
15
|
* identifiers, as defined in RFC8414, for authorization servers that can be
|
|
16
16
|
* used with this protected resource.
|
|
17
17
|
*/
|
|
18
|
-
authorization_servers: v.
|
|
18
|
+
readonly authorization_servers: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, v.RawCheckAction<string>]>, undefined>, undefined>;
|
|
19
19
|
/**
|
|
20
20
|
* OPTIONAL. URL of the protected resource's JWK Set document.
|
|
21
21
|
*/
|
|
22
|
-
jwks_uri: v.
|
|
22
|
+
readonly jwks_uri: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
23
23
|
/**
|
|
24
24
|
* RECOMMENDED. JSON array containing a list of the OAuth 2.0 scope values that
|
|
25
25
|
* are used in authorization requests to request access to this protected resource.
|
|
26
26
|
*/
|
|
27
|
-
scopes_supported: v.
|
|
27
|
+
readonly scopes_supported: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
28
28
|
/**
|
|
29
29
|
* OPTIONAL. JSON array containing a list of the supported methods of sending
|
|
30
30
|
* an OAuth 2.0 Bearer Token to the protected resource.
|
|
31
31
|
*/
|
|
32
|
-
bearer_methods_supported: v.
|
|
32
|
+
readonly bearer_methods_supported: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["header", "body", "query"], undefined>, undefined>, undefined>;
|
|
33
33
|
/**
|
|
34
34
|
* OPTIONAL. JSON array containing a list of the JWS signing algorithms
|
|
35
35
|
* supported by the protected resource for signing resource responses.
|
|
36
36
|
*/
|
|
37
|
-
resource_signing_alg_values_supported: v.
|
|
37
|
+
readonly resource_signing_alg_values_supported: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
38
38
|
/**
|
|
39
39
|
* OPTIONAL. URL of a page containing human-readable information that
|
|
40
40
|
* developers might want or need to know when using the protected resource.
|
|
41
41
|
*/
|
|
42
|
-
resource_documentation: v.
|
|
42
|
+
readonly resource_documentation: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
43
43
|
/**
|
|
44
44
|
* OPTIONAL. URL that the protected resource provides to read about the
|
|
45
45
|
* protected resource's requirements on how the client can use the data.
|
|
46
46
|
*/
|
|
47
|
-
resource_policy_uri: v.
|
|
47
|
+
readonly resource_policy_uri: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
48
48
|
/**
|
|
49
49
|
* OPTIONAL. URL that the protected resource provides to read about the
|
|
50
50
|
* protected resource's terms of service.
|
|
51
51
|
*/
|
|
52
|
-
resource_tos_uri: v.
|
|
52
|
+
readonly resource_tos_uri: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
53
53
|
}, undefined>;
|
|
54
|
-
export declare const oauthProtectedResourceMetadataValidator: v.
|
|
54
|
+
export declare const oauthProtectedResourceMetadataValidator: v.SchemaWithPipe<readonly [v.LooseObjectSchema<{
|
|
55
|
+
/**
|
|
56
|
+
* REQUIRED. the protected resource's resource identifier, which is a URL that
|
|
57
|
+
* uses the https scheme and has no query or fragment components.
|
|
58
|
+
*/
|
|
59
|
+
readonly resource: v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">;
|
|
60
|
+
/**
|
|
61
|
+
* OPTIONAL. JSON array containing a list of OAuth authorization server issuer
|
|
62
|
+
* identifiers, as defined in RFC8414, for authorization servers that can be
|
|
63
|
+
* used with this protected resource.
|
|
64
|
+
*/
|
|
65
|
+
readonly authorization_servers: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, v.RawCheckAction<string>]>, undefined>, undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* OPTIONAL. URL of the protected resource's JWK Set document.
|
|
68
|
+
*/
|
|
69
|
+
readonly jwks_uri: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* RECOMMENDED. JSON array containing a list of the OAuth 2.0 scope values that
|
|
72
|
+
* are used in authorization requests to request access to this protected resource.
|
|
73
|
+
*/
|
|
74
|
+
readonly scopes_supported: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* OPTIONAL. JSON array containing a list of the supported methods of sending
|
|
77
|
+
* an OAuth 2.0 Bearer Token to the protected resource.
|
|
78
|
+
*/
|
|
79
|
+
readonly bearer_methods_supported: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["header", "body", "query"], undefined>, undefined>, undefined>;
|
|
80
|
+
/**
|
|
81
|
+
* OPTIONAL. JSON array containing a list of the JWS signing algorithms
|
|
82
|
+
* supported by the protected resource for signing resource responses.
|
|
83
|
+
*/
|
|
84
|
+
readonly resource_signing_alg_values_supported: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
85
|
+
/**
|
|
86
|
+
* OPTIONAL. URL of a page containing human-readable information that
|
|
87
|
+
* developers might want or need to know when using the protected resource.
|
|
88
|
+
*/
|
|
89
|
+
readonly resource_documentation: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
90
|
+
/**
|
|
91
|
+
* OPTIONAL. URL that the protected resource provides to read about the
|
|
92
|
+
* protected resource's requirements on how the client can use the data.
|
|
93
|
+
*/
|
|
94
|
+
readonly resource_policy_uri: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
95
|
+
/**
|
|
96
|
+
* OPTIONAL. URL that the protected resource provides to read about the
|
|
97
|
+
* protected resource's terms of service.
|
|
98
|
+
*/
|
|
99
|
+
readonly resource_tos_uri: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>, v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be a valid url">]>, v.RawCheckAction<string>]>], "url must use http: or https: protocol">, undefined>;
|
|
100
|
+
}, undefined>, v.BaseValidation<{
|
|
101
|
+
resource: string;
|
|
102
|
+
authorization_servers?: string[] | undefined;
|
|
103
|
+
jwks_uri?: string | undefined;
|
|
104
|
+
scopes_supported?: string[] | undefined;
|
|
105
|
+
bearer_methods_supported?: ("body" | "header" | "query")[] | undefined;
|
|
106
|
+
resource_signing_alg_values_supported?: string[] | undefined;
|
|
107
|
+
resource_documentation?: string | undefined;
|
|
108
|
+
resource_policy_uri?: string | undefined;
|
|
109
|
+
resource_tos_uri?: string | undefined;
|
|
110
|
+
} & {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
}, {
|
|
113
|
+
resource: string;
|
|
114
|
+
authorization_servers?: string[] | undefined;
|
|
115
|
+
jwks_uri?: string | undefined;
|
|
116
|
+
scopes_supported?: string[] | undefined;
|
|
117
|
+
bearer_methods_supported?: ("body" | "header" | "query")[] | undefined;
|
|
118
|
+
resource_signing_alg_values_supported?: string[] | undefined;
|
|
119
|
+
resource_documentation?: string | undefined;
|
|
120
|
+
resource_policy_uri?: string | undefined;
|
|
121
|
+
resource_tos_uri?: string | undefined;
|
|
122
|
+
} & {
|
|
123
|
+
[key: string]: unknown;
|
|
124
|
+
}, v.CheckIssue<{
|
|
55
125
|
resource: string;
|
|
56
126
|
authorization_servers?: string[] | undefined;
|
|
57
127
|
jwks_uri?: string | undefined;
|
|
@@ -61,6 +131,8 @@ export declare const oauthProtectedResourceMetadataValidator: v.Type<{
|
|
|
61
131
|
resource_documentation?: string | undefined;
|
|
62
132
|
resource_policy_uri?: string | undefined;
|
|
63
133
|
resource_tos_uri?: string | undefined;
|
|
64
|
-
}
|
|
65
|
-
|
|
134
|
+
} & {
|
|
135
|
+
[key: string]: unknown;
|
|
136
|
+
}>>]>;
|
|
137
|
+
export type OAuthProtectedResourceMetadata = v.InferOutput<typeof oauthProtectedResourceMetadataSchema>;
|
|
66
138
|
//# sourceMappingURL=oauth-protected-resource-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-protected-resource-metadata.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-protected-resource-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-protected-resource-metadata.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-protected-resource-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAK7B,eAAO,MAAM,uBAAuB,0DAA0C,CAAC;AAE/E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,oCAAoC;IAChD;;;OAGG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;aAEF,CAAC;AAEH,eAAO,MAAM,uCAAuC;IAvDnD;;;OAGG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAaH,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oCAAoC,CAAC,CAAC"}
|