@atproto/oauth-types 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +12 -0
- package/LICENSE.txt +7 -0
- package/README.md +3 -0
- package/dist/access-token.d.ts +4 -0
- package/dist/access-token.d.ts.map +1 -0
- package/dist/access-token.js +6 -0
- package/dist/access-token.js.map +1 -0
- package/dist/atproto-loopback-client-metadata.d.ts +3 -0
- package/dist/atproto-loopback-client-metadata.d.ts.map +1 -0
- package/dist/atproto-loopback-client-metadata.js +26 -0
- package/dist/atproto-loopback-client-metadata.js.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +11 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/oauth-authentication-request-parameters.d.ts +128 -0
- package/dist/oauth-authentication-request-parameters.d.ts.map +1 -0
- package/dist/oauth-authentication-request-parameters.js +76 -0
- package/dist/oauth-authentication-request-parameters.js.map +1 -0
- package/dist/oauth-authorization-details.d.ts +54 -0
- package/dist/oauth-authorization-details.d.ts.map +1 -0
- package/dist/oauth-authorization-details.js +20 -0
- package/dist/oauth-authorization-details.js.map +1 -0
- package/dist/oauth-authorization-server-metadata.d.ts +428 -0
- package/dist/oauth-authorization-server-metadata.d.ts.map +1 -0
- package/dist/oauth-authorization-server-metadata.js +88 -0
- package/dist/oauth-authorization-server-metadata.js.map +1 -0
- package/dist/oauth-client-credentials.d.ts +66 -0
- package/dist/oauth-client-credentials.d.ts.map +1 -0
- package/dist/oauth-client-credentials.js +30 -0
- package/dist/oauth-client-credentials.js.map +1 -0
- package/dist/oauth-client-id-discoverable.d.ts +8 -0
- package/dist/oauth-client-id-discoverable.d.ts.map +1 -0
- package/dist/oauth-client-id-discoverable.js +48 -0
- package/dist/oauth-client-id-discoverable.js.map +1 -0
- package/dist/oauth-client-id-loopback.d.ts +5 -0
- package/dist/oauth-client-id-loopback.d.ts.map +1 -0
- package/dist/oauth-client-id-loopback.js +44 -0
- package/dist/oauth-client-id-loopback.js.map +1 -0
- package/dist/oauth-client-id-url.d.ts +3 -0
- package/dist/oauth-client-id-url.d.ts.map +1 -0
- package/dist/oauth-client-id-url.js +21 -0
- package/dist/oauth-client-id-url.js.map +1 -0
- package/dist/oauth-client-id.d.ts +4 -0
- package/dist/oauth-client-id.d.ts.map +1 -0
- package/dist/oauth-client-id.js +6 -0
- package/dist/oauth-client-id.js.map +1 -0
- package/dist/oauth-client-identification.d.ts +31 -0
- package/dist/oauth-client-identification.d.ts.map +1 -0
- package/dist/oauth-client-identification.js +12 -0
- package/dist/oauth-client-identification.js.map +1 -0
- package/dist/oauth-client-metadata.d.ts +1576 -0
- package/dist/oauth-client-metadata.d.ts.map +1 -0
- package/dist/oauth-client-metadata.js +70 -0
- package/dist/oauth-client-metadata.js.map +1 -0
- package/dist/oauth-endpoint-auth-method.d.ts +4 -0
- package/dist/oauth-endpoint-auth-method.d.ts.map +1 -0
- package/dist/oauth-endpoint-auth-method.js +14 -0
- package/dist/oauth-endpoint-auth-method.js.map +1 -0
- package/dist/oauth-endpoint-name.d.ts +2 -0
- package/dist/oauth-endpoint-name.d.ts.map +1 -0
- package/dist/oauth-endpoint-name.js +3 -0
- package/dist/oauth-endpoint-name.js.map +1 -0
- package/dist/oauth-grant-type.d.ts +4 -0
- package/dist/oauth-grant-type.d.ts.map +1 -0
- package/dist/oauth-grant-type.js +14 -0
- package/dist/oauth-grant-type.js.map +1 -0
- package/dist/oauth-issuer-identifier.d.ts +3 -0
- package/dist/oauth-issuer-identifier.d.ts.map +1 -0
- package/dist/oauth-issuer-identifier.js +59 -0
- package/dist/oauth-issuer-identifier.js.map +1 -0
- package/dist/oauth-par-response.d.ts +10 -0
- package/dist/oauth-par-response.d.ts.map +1 -0
- package/dist/oauth-par-response.js +8 -0
- package/dist/oauth-par-response.js.map +1 -0
- package/dist/oauth-protected-resource-metadata.d.ts +90 -0
- package/dist/oauth-protected-resource-metadata.d.ts.map +1 -0
- package/dist/oauth-protected-resource-metadata.js +75 -0
- package/dist/oauth-protected-resource-metadata.js.map +1 -0
- package/dist/oauth-response-mode.d.ts +4 -0
- package/dist/oauth-response-mode.d.ts.map +1 -0
- package/dist/oauth-response-mode.js +10 -0
- package/dist/oauth-response-mode.js.map +1 -0
- package/dist/oauth-response-type.d.ts +4 -0
- package/dist/oauth-response-type.d.ts.map +1 -0
- package/dist/oauth-response-type.js +17 -0
- package/dist/oauth-response-type.js.map +1 -0
- package/dist/oauth-token-response.d.ts +103 -0
- package/dist/oauth-token-response.d.ts.map +1 -0
- package/dist/oauth-token-response.js +26 -0
- package/dist/oauth-token-response.js.map +1 -0
- package/dist/oauth-token-type.d.ts +4 -0
- package/dist/oauth-token-type.d.ts.map +1 -0
- package/dist/oauth-token-type.js +16 -0
- package/dist/oauth-token-type.js.map +1 -0
- package/dist/oidc-claims-parameter.d.ts +4 -0
- package/dist/oidc-claims-parameter.d.ts.map +1 -0
- package/dist/oidc-claims-parameter.js +36 -0
- package/dist/oidc-claims-parameter.js.map +1 -0
- package/dist/oidc-claims-properties.d.ts +16 -0
- package/dist/oidc-claims-properties.d.ts.map +1 -0
- package/dist/oidc-claims-properties.js +11 -0
- package/dist/oidc-claims-properties.js.map +1 -0
- package/dist/oidc-entity-type.d.ts +4 -0
- package/dist/oidc-entity-type.d.ts.map +1 -0
- package/dist/oidc-entity-type.js +6 -0
- package/dist/oidc-entity-type.js.map +1 -0
- package/dist/util.d.ts +5 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +23 -0
- package/dist/util.js.map +1 -0
- package/package.json +37 -0
- package/src/access-token.ts +4 -0
- package/src/atproto-loopback-client-metadata.ts +30 -0
- package/src/constants.ts +9 -0
- package/src/index.ts +27 -0
- package/src/oauth-authentication-request-parameters.ts +104 -0
- package/src/oauth-authorization-details.ts +28 -0
- package/src/oauth-authorization-server-metadata.ts +106 -0
- package/src/oauth-client-credentials.ts +34 -0
- package/src/oauth-client-id-discoverable.ts +66 -0
- package/src/oauth-client-id-loopback.ts +58 -0
- package/src/oauth-client-id-url.ts +25 -0
- package/src/oauth-client-id.ts +4 -0
- package/src/oauth-client-identification.ts +14 -0
- package/src/oauth-client-metadata.ts +75 -0
- package/src/oauth-endpoint-auth-method.ts +13 -0
- package/src/oauth-endpoint-name.ts +5 -0
- package/src/oauth-grant-type.ts +13 -0
- package/src/oauth-issuer-identifier.ts +61 -0
- package/src/oauth-par-response.ts +7 -0
- package/src/oauth-protected-resource-metadata.ts +85 -0
- package/src/oauth-response-mode.ts +9 -0
- package/src/oauth-response-type.ts +17 -0
- package/src/oauth-token-response.ts +29 -0
- package/src/oauth-token-type.ts +15 -0
- package/src/oidc-claims-parameter.ts +40 -0
- package/src/oidc-claims-properties.ts +11 -0
- package/src/oidc-entity-type.ts +5 -0
- package/src/util.ts +20 -0
- package/tsconfig.build.json +8 -0
- package/tsconfig.json +4 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-client-metadata.d.ts","sourceRoot":"","sources":["../src/oauth-client-metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWH,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC3E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthClientMetadataSchema = void 0;
|
4
|
+
const jwk_1 = require("@atproto/jwk");
|
5
|
+
const zod_1 = require("zod");
|
6
|
+
const oauth_client_id_js_1 = require("./oauth-client-id.js");
|
7
|
+
const oauth_endpoint_auth_method_js_1 = require("./oauth-endpoint-auth-method.js");
|
8
|
+
const oauth_grant_type_js_1 = require("./oauth-grant-type.js");
|
9
|
+
const oauth_response_type_js_1 = require("./oauth-response-type.js");
|
10
|
+
// https://openid.net/specs/openid-connect-registration-1_0.html
|
11
|
+
// https://datatracker.ietf.org/doc/html/rfc7591
|
12
|
+
exports.oauthClientMetadataSchema = zod_1.z.object({
|
13
|
+
redirect_uris: zod_1.z.array(zod_1.z.string().url()).nonempty(),
|
14
|
+
response_types: zod_1.z
|
15
|
+
.array(oauth_response_type_js_1.oauthResponseTypeSchema)
|
16
|
+
.nonempty()
|
17
|
+
// > If omitted, the default is that the client will use only the "code"
|
18
|
+
// > response type.
|
19
|
+
.default(['code']),
|
20
|
+
grant_types: zod_1.z
|
21
|
+
.array(oauth_grant_type_js_1.oauthGrantTypeSchema)
|
22
|
+
.nonempty()
|
23
|
+
// > If omitted, the default behavior is that the client will use only the
|
24
|
+
// > "authorization_code" Grant Type.
|
25
|
+
.default(['authorization_code']),
|
26
|
+
scope: zod_1.z.string().optional(),
|
27
|
+
token_endpoint_auth_method: oauth_endpoint_auth_method_js_1.oauthEndpointAuthMethod
|
28
|
+
.default('none')
|
29
|
+
.optional(),
|
30
|
+
token_endpoint_auth_signing_alg: zod_1.z.string().optional(),
|
31
|
+
introspection_endpoint_auth_method: oauth_endpoint_auth_method_js_1.oauthEndpointAuthMethod.optional(),
|
32
|
+
introspection_endpoint_auth_signing_alg: zod_1.z.string().optional(),
|
33
|
+
revocation_endpoint_auth_method: oauth_endpoint_auth_method_js_1.oauthEndpointAuthMethod.optional(),
|
34
|
+
revocation_endpoint_auth_signing_alg: zod_1.z.string().optional(),
|
35
|
+
pushed_authorization_request_endpoint_auth_method: oauth_endpoint_auth_method_js_1.oauthEndpointAuthMethod.optional(),
|
36
|
+
pushed_authorization_request_endpoint_auth_signing_alg: zod_1.z.string().optional(),
|
37
|
+
userinfo_signed_response_alg: zod_1.z.string().optional(),
|
38
|
+
userinfo_encrypted_response_alg: zod_1.z.string().optional(),
|
39
|
+
jwks_uri: zod_1.z.string().url().optional(),
|
40
|
+
jwks: jwk_1.jwksPubSchema.optional(),
|
41
|
+
application_type: zod_1.z.enum(['web', 'native']).default('web').optional(), // default, per spec, is "web"
|
42
|
+
subject_type: zod_1.z.enum(['public', 'pairwise']).default('public').optional(),
|
43
|
+
request_object_signing_alg: zod_1.z.string().optional(),
|
44
|
+
id_token_signed_response_alg: zod_1.z.string().optional(),
|
45
|
+
authorization_signed_response_alg: zod_1.z.string().default('RS256').optional(),
|
46
|
+
authorization_encrypted_response_enc: zod_1.z.enum(['A128CBC-HS256']).optional(),
|
47
|
+
authorization_encrypted_response_alg: zod_1.z.string().optional(),
|
48
|
+
client_id: oauth_client_id_js_1.oauthClientIdSchema.optional(),
|
49
|
+
client_name: zod_1.z.string().optional(),
|
50
|
+
client_uri: zod_1.z.string().url().optional(),
|
51
|
+
policy_uri: zod_1.z.string().url().optional(),
|
52
|
+
tos_uri: zod_1.z.string().url().optional(),
|
53
|
+
logo_uri: zod_1.z.string().url().optional(),
|
54
|
+
/**
|
55
|
+
* Default Maximum Authentication Age. Specifies that the End-User MUST be
|
56
|
+
* actively authenticated if the End-User was authenticated longer ago than
|
57
|
+
* the specified number of seconds. The max_age request parameter overrides
|
58
|
+
* this default value. If omitted, no default Maximum Authentication Age is
|
59
|
+
* specified.
|
60
|
+
*/
|
61
|
+
default_max_age: zod_1.z.number().optional(),
|
62
|
+
require_auth_time: zod_1.z.boolean().optional(),
|
63
|
+
contacts: zod_1.z.array(zod_1.z.string().email()).optional(),
|
64
|
+
tls_client_certificate_bound_access_tokens: zod_1.z.boolean().optional(),
|
65
|
+
// https://datatracker.ietf.org/doc/html/rfc9449#section-5.2
|
66
|
+
dpop_bound_access_tokens: zod_1.z.boolean().optional(),
|
67
|
+
// https://datatracker.ietf.org/doc/html/rfc9396#section-14.5
|
68
|
+
authorization_details_types: zod_1.z.array(zod_1.z.string()).optional(),
|
69
|
+
});
|
70
|
+
//# sourceMappingURL=oauth-client-metadata.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-client-metadata.js","sourceRoot":"","sources":["../src/oauth-client-metadata.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAC5C,6BAAuB;AAEvB,6DAA0D;AAC1D,mFAAyE;AACzE,+DAA4D;AAC5D,qEAAkE;AAElE,gEAAgE;AAChE,gDAAgD;AACnC,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,aAAa,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;IACnD,cAAc,EAAE,OAAC;SACd,KAAK,CAAC,gDAAuB,CAAC;SAC9B,QAAQ,EAAE;QACX,wEAAwE;QACxE,mBAAmB;SAClB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IACpB,WAAW,EAAE,OAAC;SAC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,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC,CAAA"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const oauthEndpointAuthMethod: z.ZodEnum<["client_secret_basic", "client_secret_jwt", "client_secret_post", "none", "private_key_jwt", "self_signed_tls_client_auth", "tls_client_auth"]>;
|
3
|
+
export type OauthEndpointAuthMethod = z.infer<typeof oauthEndpointAuthMethod>;
|
4
|
+
//# sourceMappingURL=oauth-endpoint-auth-method.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-endpoint-auth-method.d.ts","sourceRoot":"","sources":["../src/oauth-endpoint-auth-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,uBAAuB,4JAQlC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthEndpointAuthMethod = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.oauthEndpointAuthMethod = zod_1.z.enum([
|
6
|
+
'client_secret_basic',
|
7
|
+
'client_secret_jwt',
|
8
|
+
'client_secret_post',
|
9
|
+
'none',
|
10
|
+
'private_key_jwt',
|
11
|
+
'self_signed_tls_client_auth',
|
12
|
+
'tls_client_auth',
|
13
|
+
]);
|
14
|
+
//# sourceMappingURL=oauth-endpoint-auth-method.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-endpoint-auth-method.js","sourceRoot":"","sources":["../src/oauth-endpoint-auth-method.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5C,qBAAqB;IACrB,mBAAmB;IACnB,oBAAoB;IACpB,MAAM;IACN,iBAAiB;IACjB,6BAA6B;IAC7B,iBAAiB;CAClB,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-endpoint-name.d.ts","sourceRoot":"","sources":["../src/oauth-endpoint-name.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACzB,OAAO,GACP,YAAY,GACZ,eAAe,GACf,8BAA8B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-endpoint-name.js","sourceRoot":"","sources":["../src/oauth-endpoint-name.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const oauthGrantTypeSchema: z.ZodEnum<["authorization_code", "implicit", "refresh_token", "password", "client_credentials", "urn:ietf:params:oauth:grant-type:jwt-bearer", "urn:ietf:params:oauth:grant-type:saml2-bearer"]>;
|
3
|
+
export type OAuthGrantType = z.infer<typeof oauthGrantTypeSchema>;
|
4
|
+
//# sourceMappingURL=oauth-grant-type.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-grant-type.d.ts","sourceRoot":"","sources":["../src/oauth-grant-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,oBAAoB,kMAQ/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthGrantTypeSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.oauthGrantTypeSchema = zod_1.z.enum([
|
6
|
+
'authorization_code',
|
7
|
+
'implicit',
|
8
|
+
'refresh_token',
|
9
|
+
'password', // Not part of OAuth 2.1
|
10
|
+
'client_credentials',
|
11
|
+
'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
12
|
+
'urn:ietf:params:oauth:grant-type:saml2-bearer',
|
13
|
+
]);
|
14
|
+
//# sourceMappingURL=oauth-grant-type.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-grant-type.js","sourceRoot":"","sources":["../src/oauth-grant-type.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,oBAAoB,GAAG,OAAC,CAAC,IAAI,CAAC;IACzC,oBAAoB;IACpB,UAAU;IACV,eAAe;IACf,UAAU,EAAE,wBAAwB;IACpC,oBAAoB;IACpB,6CAA6C;IAC7C,+CAA+C;CAChD,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-issuer-identifier.d.ts","sourceRoot":"","sources":["../src/oauth-issuer-identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAavB,eAAO,MAAM,2BAA2B,2CA+CpC,CAAA"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthIssuerIdentifierSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
// try/catch to support running in a browser, including when process.env is
|
6
|
+
// shimmed (e.g. by webpack)
|
7
|
+
const ALLOW_INSECURE = (() => {
|
8
|
+
try {
|
9
|
+
const env = process.env.NODE_ENV;
|
10
|
+
return env === 'development' || env === 'test';
|
11
|
+
}
|
12
|
+
catch {
|
13
|
+
return false;
|
14
|
+
}
|
15
|
+
})();
|
16
|
+
exports.oauthIssuerIdentifierSchema = zod_1.z
|
17
|
+
.string()
|
18
|
+
.url()
|
19
|
+
.superRefine((value, ctx) => {
|
20
|
+
// Validate the issuer (MIX-UP attacks)
|
21
|
+
if (value.endsWith('/')) {
|
22
|
+
ctx.addIssue({
|
23
|
+
code: zod_1.z.ZodIssueCode.custom,
|
24
|
+
message: 'Issuer URL must not end with a slash',
|
25
|
+
});
|
26
|
+
}
|
27
|
+
const url = new URL(value);
|
28
|
+
if (url.protocol !== 'https:') {
|
29
|
+
if (ALLOW_INSECURE && url.protocol === 'http:') {
|
30
|
+
// We'll allow HTTP in development mode
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
ctx.addIssue({
|
34
|
+
code: zod_1.z.ZodIssueCode.custom,
|
35
|
+
message: 'Issuer must be an HTTPS URL',
|
36
|
+
});
|
37
|
+
}
|
38
|
+
}
|
39
|
+
if (url.username || url.password) {
|
40
|
+
ctx.addIssue({
|
41
|
+
code: zod_1.z.ZodIssueCode.custom,
|
42
|
+
message: 'Issuer URL must not contain a username or password',
|
43
|
+
});
|
44
|
+
}
|
45
|
+
if (url.hash || url.search) {
|
46
|
+
ctx.addIssue({
|
47
|
+
code: zod_1.z.ZodIssueCode.custom,
|
48
|
+
message: 'Issuer URL must not contain a query or fragment',
|
49
|
+
});
|
50
|
+
}
|
51
|
+
const canonicalValue = url.pathname === '/' ? url.origin : url.href;
|
52
|
+
if (value !== canonicalValue) {
|
53
|
+
ctx.addIssue({
|
54
|
+
code: zod_1.z.ZodIssueCode.custom,
|
55
|
+
message: 'Issuer URL must be in the canonical form',
|
56
|
+
});
|
57
|
+
}
|
58
|
+
});
|
59
|
+
//# sourceMappingURL=oauth-issuer-identifier.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-issuer-identifier.js","sourceRoot":"","sources":["../src/oauth-issuer-identifier.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,2EAA2E;AAC3E,4BAA4B;AAC5B,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;QAChC,OAAO,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,MAAM,CAAA;IAChD,CA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,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAA;IACnE,IAAI,KAAK,KAAK,cAAc,EAAE,CAAC;QAC7B,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,0CAA0C;SACpD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const oauthParResponseSchema: z.ZodObject<{
|
3
|
+
request_uri: z.ZodString;
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
5
|
+
request_uri: string;
|
6
|
+
}, {
|
7
|
+
request_uri: string;
|
8
|
+
}>;
|
9
|
+
export type OAuthParResponse = z.infer<typeof oauthParResponseSchema>;
|
10
|
+
//# sourceMappingURL=oauth-par-response.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-par-response.d.ts","sourceRoot":"","sources":["../src/oauth-par-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthParResponseSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.oauthParResponseSchema = zod_1.z.object({
|
6
|
+
request_uri: zod_1.z.string(),
|
7
|
+
});
|
8
|
+
//# sourceMappingURL=oauth-par-response.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-par-response.js","sourceRoot":"","sources":["../src/oauth-par-response.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAA"}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
/**
|
3
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-resource-metadata-05#name-protected-resource-metadata-r}
|
4
|
+
*/
|
5
|
+
export declare const oauthProtectedResourceMetadataSchema: z.ZodObject<{
|
6
|
+
/**
|
7
|
+
* REQUIRED. The protected resource's resource identifier, which is a URL that
|
8
|
+
* uses the https scheme and has no query or fragment components. Using these
|
9
|
+
* well-known resources is described in Section 3.
|
10
|
+
*/
|
11
|
+
resource: z.ZodString;
|
12
|
+
/**
|
13
|
+
* OPTIONAL. JSON array containing a list of OAuth authorization server issuer
|
14
|
+
* identifiers, as defined in [RFC8414], for authorization servers that can be
|
15
|
+
* used with this protected resource. Protected resources MAY choose not to
|
16
|
+
* advertise some supported authorization servers even when this parameter is
|
17
|
+
* used. In some use cases, the set of authorization servers will not be
|
18
|
+
* enumerable, in which case this metadata parameter would not be used.
|
19
|
+
*/
|
20
|
+
authorization_servers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
21
|
+
/**
|
22
|
+
* OPTIONAL. URL of the protected resource's JWK Set [JWK] document. This
|
23
|
+
* contains public keys belonging to the protected resource, such as signing
|
24
|
+
* key(s) that the resource server uses to sign resource responses. This URL
|
25
|
+
* MUST use the https scheme. When both signing and encryption keys are made
|
26
|
+
* available, a use (public key use) parameter value is REQUIRED for all keys
|
27
|
+
* in the referenced JWK Set to indicate each key's intended usage.
|
28
|
+
*/
|
29
|
+
jwks_uri: z.ZodOptional<z.ZodString>;
|
30
|
+
/**
|
31
|
+
* RECOMMENDED. JSON array containing a list of the OAuth 2.0 [RFC6749] scope
|
32
|
+
* values that are used in authorization requests to request access to this
|
33
|
+
* protected resource. Protected resources MAY choose not to advertise some
|
34
|
+
* scope values supported even when this parameter is used.
|
35
|
+
*/
|
36
|
+
scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
37
|
+
/**
|
38
|
+
* OPTIONAL. JSON array containing a list of the supported methods of sending
|
39
|
+
* an OAuth 2.0 Bearer Token [RFC6750] to the protected resource. Defined
|
40
|
+
* values are ["header", "body", "query"], corresponding to Sections 2.1, 2.2,
|
41
|
+
* and 2.3 of RFC 6750.
|
42
|
+
*/
|
43
|
+
bearer_methods_supported: z.ZodOptional<z.ZodArray<z.ZodEnum<["header", "body", "query"]>, "many">>;
|
44
|
+
/**
|
45
|
+
* OPTIONAL. JSON array containing a list of the JWS [JWS] signing algorithms
|
46
|
+
* (alg values) [JWA] supported by the protected resource for signing resource
|
47
|
+
* responses, for instance, as described in [FAPI.MessageSigning]. No default
|
48
|
+
* algorithms are implied if this entry is omitted. The value none MUST NOT be
|
49
|
+
* used.
|
50
|
+
*/
|
51
|
+
resource_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
52
|
+
/**
|
53
|
+
* OPTIONAL. URL of a page containing human-readable information that
|
54
|
+
* developers might want or need to know when using the protected resource
|
55
|
+
*/
|
56
|
+
resource_documentation: z.ZodOptional<z.ZodString>;
|
57
|
+
/**
|
58
|
+
* OPTIONAL. URL that the protected resource provides to read about the
|
59
|
+
* protected resource's requirements on how the client can use the data
|
60
|
+
* provided by the protected resource
|
61
|
+
*/
|
62
|
+
resource_policy_uri: z.ZodOptional<z.ZodString>;
|
63
|
+
/**
|
64
|
+
* OPTIONAL. URL that the protected resource provides to read about the
|
65
|
+
* protected resource's terms of service
|
66
|
+
*/
|
67
|
+
resource_tos_uri: z.ZodOptional<z.ZodString>;
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
69
|
+
resource: string;
|
70
|
+
jwks_uri?: string | undefined;
|
71
|
+
scopes_supported?: string[] | undefined;
|
72
|
+
authorization_servers?: string[] | undefined;
|
73
|
+
bearer_methods_supported?: ("query" | "header" | "body")[] | undefined;
|
74
|
+
resource_signing_alg_values_supported?: string[] | undefined;
|
75
|
+
resource_documentation?: string | undefined;
|
76
|
+
resource_policy_uri?: string | undefined;
|
77
|
+
resource_tos_uri?: string | undefined;
|
78
|
+
}, {
|
79
|
+
resource: string;
|
80
|
+
jwks_uri?: string | undefined;
|
81
|
+
scopes_supported?: string[] | undefined;
|
82
|
+
authorization_servers?: string[] | undefined;
|
83
|
+
bearer_methods_supported?: ("query" | "header" | "body")[] | undefined;
|
84
|
+
resource_signing_alg_values_supported?: string[] | undefined;
|
85
|
+
resource_documentation?: string | undefined;
|
86
|
+
resource_policy_uri?: string | undefined;
|
87
|
+
resource_tos_uri?: string | undefined;
|
88
|
+
}>;
|
89
|
+
export type OAuthProtectedResourceMetadata = z.infer<typeof oauthProtectedResourceMetadataSchema>;
|
90
|
+
//# sourceMappingURL=oauth-protected-resource-metadata.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-protected-resource-metadata.d.ts","sourceRoot":"","sources":["../src/oauth-protected-resource-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;GAEG;AACH,eAAO,MAAM,oCAAoC;IAC/C;;;;OAIG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAKH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAA;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAA"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthProtectedResourceMetadataSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const oauth_issuer_identifier_js_1 = require("./oauth-issuer-identifier.js");
|
6
|
+
/**
|
7
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-resource-metadata-05#name-protected-resource-metadata-r}
|
8
|
+
*/
|
9
|
+
exports.oauthProtectedResourceMetadataSchema = zod_1.z.object({
|
10
|
+
/**
|
11
|
+
* REQUIRED. The protected resource's resource identifier, which is a URL that
|
12
|
+
* uses the https scheme and has no query or fragment components. Using these
|
13
|
+
* well-known resources is described in Section 3.
|
14
|
+
*/
|
15
|
+
resource: zod_1.z.string().url(),
|
16
|
+
/**
|
17
|
+
* OPTIONAL. JSON array containing a list of OAuth authorization server issuer
|
18
|
+
* identifiers, as defined in [RFC8414], for authorization servers that can be
|
19
|
+
* used with this protected resource. Protected resources MAY choose not to
|
20
|
+
* advertise some supported authorization servers even when this parameter is
|
21
|
+
* used. In some use cases, the set of authorization servers will not be
|
22
|
+
* enumerable, in which case this metadata parameter would not be used.
|
23
|
+
*/
|
24
|
+
authorization_servers: zod_1.z.array(oauth_issuer_identifier_js_1.oauthIssuerIdentifierSchema).optional(),
|
25
|
+
/**
|
26
|
+
* OPTIONAL. URL of the protected resource's JWK Set [JWK] document. This
|
27
|
+
* contains public keys belonging to the protected resource, such as signing
|
28
|
+
* key(s) that the resource server uses to sign resource responses. This URL
|
29
|
+
* MUST use the https scheme. When both signing and encryption keys are made
|
30
|
+
* available, a use (public key use) parameter value is REQUIRED for all keys
|
31
|
+
* in the referenced JWK Set to indicate each key's intended usage.
|
32
|
+
*/
|
33
|
+
jwks_uri: zod_1.z.string().url().optional(),
|
34
|
+
/**
|
35
|
+
* RECOMMENDED. JSON array containing a list of the OAuth 2.0 [RFC6749] scope
|
36
|
+
* values that are used in authorization requests to request access to this
|
37
|
+
* protected resource. Protected resources MAY choose not to advertise some
|
38
|
+
* scope values supported even when this parameter is used.
|
39
|
+
*/
|
40
|
+
scopes_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
41
|
+
/**
|
42
|
+
* OPTIONAL. JSON array containing a list of the supported methods of sending
|
43
|
+
* an OAuth 2.0 Bearer Token [RFC6750] to the protected resource. Defined
|
44
|
+
* values are ["header", "body", "query"], corresponding to Sections 2.1, 2.2,
|
45
|
+
* and 2.3 of RFC 6750.
|
46
|
+
*/
|
47
|
+
bearer_methods_supported: zod_1.z
|
48
|
+
.array(zod_1.z.enum(['header', 'body', 'query']))
|
49
|
+
.optional(),
|
50
|
+
/**
|
51
|
+
* OPTIONAL. JSON array containing a list of the JWS [JWS] signing algorithms
|
52
|
+
* (alg values) [JWA] supported by the protected resource for signing resource
|
53
|
+
* responses, for instance, as described in [FAPI.MessageSigning]. No default
|
54
|
+
* algorithms are implied if this entry is omitted. The value none MUST NOT be
|
55
|
+
* used.
|
56
|
+
*/
|
57
|
+
resource_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(),
|
58
|
+
/**
|
59
|
+
* OPTIONAL. URL of a page containing human-readable information that
|
60
|
+
* developers might want or need to know when using the protected resource
|
61
|
+
*/
|
62
|
+
resource_documentation: zod_1.z.string().url().optional(),
|
63
|
+
/**
|
64
|
+
* OPTIONAL. URL that the protected resource provides to read about the
|
65
|
+
* protected resource's requirements on how the client can use the data
|
66
|
+
* provided by the protected resource
|
67
|
+
*/
|
68
|
+
resource_policy_uri: zod_1.z.string().url().optional(),
|
69
|
+
/**
|
70
|
+
* OPTIONAL. URL that the protected resource provides to read about the
|
71
|
+
* protected resource's terms of service
|
72
|
+
*/
|
73
|
+
resource_tos_uri: zod_1.z.string().url().optional(),
|
74
|
+
});
|
75
|
+
//# sourceMappingURL=oauth-protected-resource-metadata.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-protected-resource-metadata.js","sourceRoot":"","sources":["../src/oauth-protected-resource-metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,6EAA0E;AAE1E;;GAEG;AACU,QAAA,oCAAoC,GAAG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C,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthResponseModeSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.oauthResponseModeSchema = zod_1.z.enum([
|
6
|
+
'query',
|
7
|
+
'fragment',
|
8
|
+
'form_post',
|
9
|
+
]);
|
10
|
+
//# sourceMappingURL=oauth-response-mode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-response-mode.js","sourceRoot":"","sources":["../src/oauth-response-mode.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5C,OAAO;IACP,UAAU;IACV,WAAW;CACZ,CAAC,CAAA"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const oauthResponseTypeSchema: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
|
3
|
+
export type OAuthResponseType = z.infer<typeof oauthResponseTypeSchema>;
|
4
|
+
//# sourceMappingURL=oauth-response-type.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-response-type.d.ts","sourceRoot":"","sources":["../src/oauth-response-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,uBAAuB,0HAYlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthResponseTypeSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.oauthResponseTypeSchema = zod_1.z.enum([
|
6
|
+
// OAuth
|
7
|
+
'code', // Authorization Code Grant
|
8
|
+
'token', // Implicit Grant
|
9
|
+
// OpenID
|
10
|
+
'none',
|
11
|
+
'code id_token token',
|
12
|
+
'code id_token',
|
13
|
+
'code token',
|
14
|
+
'id_token token',
|
15
|
+
'id_token',
|
16
|
+
]);
|
17
|
+
//# sourceMappingURL=oauth-response-type.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-response-type.js","sourceRoot":"","sources":["../src/oauth-response-type.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5C,QAAQ;IACR,MAAM,EAAE,2BAA2B;IACnC,OAAO,EAAE,iBAAiB;IAE1B,SAAS;IACT,MAAM;IACN,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,UAAU;CACX,CAAC,CAAA"}
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
/**
|
3
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc6749.html#section-5.1 | RFC 6749 (OAuth2), Section 5.1}
|
4
|
+
*/
|
5
|
+
export declare const oauthTokenResponseSchema: z.ZodObject<{
|
6
|
+
access_token: z.ZodString;
|
7
|
+
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
|
8
|
+
issuer: z.ZodOptional<z.ZodString>;
|
9
|
+
sub: z.ZodOptional<z.ZodString>;
|
10
|
+
scope: z.ZodOptional<z.ZodString>;
|
11
|
+
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
12
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
13
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
14
|
+
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
15
|
+
type: z.ZodString;
|
16
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
17
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
18
|
+
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
19
|
+
identifier: z.ZodOptional<z.ZodString>;
|
20
|
+
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
22
|
+
type: string;
|
23
|
+
locations?: string[] | undefined;
|
24
|
+
actions?: string[] | undefined;
|
25
|
+
datatypes?: string[] | undefined;
|
26
|
+
identifier?: string | undefined;
|
27
|
+
privileges?: string[] | undefined;
|
28
|
+
}, {
|
29
|
+
type: string;
|
30
|
+
locations?: string[] | undefined;
|
31
|
+
actions?: string[] | undefined;
|
32
|
+
datatypes?: string[] | undefined;
|
33
|
+
identifier?: string | undefined;
|
34
|
+
privileges?: string[] | undefined;
|
35
|
+
}>, "many">>;
|
36
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
37
|
+
access_token: z.ZodString;
|
38
|
+
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
|
39
|
+
issuer: z.ZodOptional<z.ZodString>;
|
40
|
+
sub: z.ZodOptional<z.ZodString>;
|
41
|
+
scope: z.ZodOptional<z.ZodString>;
|
42
|
+
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
43
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
44
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
45
|
+
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
46
|
+
type: z.ZodString;
|
47
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
48
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
49
|
+
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
50
|
+
identifier: z.ZodOptional<z.ZodString>;
|
51
|
+
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
53
|
+
type: string;
|
54
|
+
locations?: string[] | undefined;
|
55
|
+
actions?: string[] | undefined;
|
56
|
+
datatypes?: string[] | undefined;
|
57
|
+
identifier?: string | undefined;
|
58
|
+
privileges?: string[] | undefined;
|
59
|
+
}, {
|
60
|
+
type: string;
|
61
|
+
locations?: string[] | undefined;
|
62
|
+
actions?: string[] | undefined;
|
63
|
+
datatypes?: string[] | undefined;
|
64
|
+
identifier?: string | undefined;
|
65
|
+
privileges?: string[] | undefined;
|
66
|
+
}>, "many">>;
|
67
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
68
|
+
access_token: z.ZodString;
|
69
|
+
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
|
70
|
+
issuer: z.ZodOptional<z.ZodString>;
|
71
|
+
sub: z.ZodOptional<z.ZodString>;
|
72
|
+
scope: z.ZodOptional<z.ZodString>;
|
73
|
+
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
74
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
75
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
76
|
+
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
77
|
+
type: z.ZodString;
|
78
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
79
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
80
|
+
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
81
|
+
identifier: z.ZodOptional<z.ZodString>;
|
82
|
+
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
84
|
+
type: string;
|
85
|
+
locations?: string[] | undefined;
|
86
|
+
actions?: string[] | undefined;
|
87
|
+
datatypes?: string[] | undefined;
|
88
|
+
identifier?: string | undefined;
|
89
|
+
privileges?: string[] | undefined;
|
90
|
+
}, {
|
91
|
+
type: string;
|
92
|
+
locations?: string[] | undefined;
|
93
|
+
actions?: string[] | undefined;
|
94
|
+
datatypes?: string[] | undefined;
|
95
|
+
identifier?: string | undefined;
|
96
|
+
privileges?: string[] | undefined;
|
97
|
+
}>, "many">>;
|
98
|
+
}, z.ZodTypeAny, "passthrough">>;
|
99
|
+
/**
|
100
|
+
* @see {@link oauthTokenResponseSchema}
|
101
|
+
*/
|
102
|
+
export type OAuthTokenResponse = z.infer<typeof oauthTokenResponseSchema>;
|
103
|
+
//# sourceMappingURL=oauth-token-response.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"oauth-token-response.d.ts","sourceRoot":"","sources":["../src/oauth-token-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAcrB,CAAA;AAEhB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oauthTokenResponseSchema = void 0;
|
4
|
+
const jwk_1 = require("@atproto/jwk");
|
5
|
+
const zod_1 = require("zod");
|
6
|
+
const oauth_authorization_details_js_1 = require("./oauth-authorization-details.js");
|
7
|
+
const oauth_token_type_js_1 = require("./oauth-token-type.js");
|
8
|
+
/**
|
9
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc6749.html#section-5.1 | RFC 6749 (OAuth2), Section 5.1}
|
10
|
+
*/
|
11
|
+
exports.oauthTokenResponseSchema = zod_1.z
|
12
|
+
.object({
|
13
|
+
access_token: zod_1.z.string(),
|
14
|
+
token_type: oauth_token_type_js_1.oauthTokenTypeSchema,
|
15
|
+
issuer: zod_1.z.string().url().optional(),
|
16
|
+
sub: zod_1.z.string().optional(),
|
17
|
+
scope: zod_1.z.string().optional(),
|
18
|
+
id_token: jwk_1.signedJwtSchema.optional(),
|
19
|
+
refresh_token: zod_1.z.string().optional(),
|
20
|
+
expires_in: zod_1.z.number().optional(),
|
21
|
+
authorization_details: oauth_authorization_details_js_1.oauthAuthorizationDetailsSchema.optional(),
|
22
|
+
})
|
23
|
+
// https://www.rfc-editor.org/rfc/rfc6749.html#section-5.1
|
24
|
+
// > The client MUST ignore unrecognized value names in the response.
|
25
|
+
.passthrough();
|
26
|
+
//# sourceMappingURL=oauth-token-response.js.map
|