@atproto/oauth-provider 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +45 -0
- package/dist/account/account-store.d.ts +2 -2
- package/dist/assets/app/bundle-manifest.json +3 -3
- package/dist/assets/app/main.css +1 -1
- package/dist/assets/app/main.js +3 -3
- package/dist/assets/app/main.js.map +1 -1
- package/dist/assets/assets-middleware.d.ts.map +1 -1
- package/dist/assets/assets-middleware.js +4 -2
- package/dist/assets/assets-middleware.js.map +1 -1
- package/dist/client/client-manager.d.ts.map +1 -1
- package/dist/client/client-manager.js +127 -118
- package/dist/client/client-manager.js.map +1 -1
- package/dist/client/client-utils.d.ts +1 -2
- package/dist/client/client-utils.d.ts.map +1 -1
- package/dist/client/client-utils.js +3 -12
- package/dist/client/client-utils.js.map +1 -1
- package/dist/client/client.d.ts +8 -3
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +70 -1
- package/dist/client/client.js.map +1 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -2
- package/dist/constants.js.map +1 -1
- package/dist/errors/access-denied-error.d.ts +4 -4
- package/dist/errors/access-denied-error.d.ts.map +1 -1
- package/dist/errors/access-denied-error.js +2 -2
- package/dist/errors/access-denied-error.js.map +1 -1
- package/dist/errors/account-selection-required-error.d.ts +2 -2
- package/dist/errors/account-selection-required-error.d.ts.map +1 -1
- package/dist/errors/account-selection-required-error.js.map +1 -1
- package/dist/errors/consent-required-error.d.ts +2 -2
- package/dist/errors/consent-required-error.d.ts.map +1 -1
- package/dist/errors/consent-required-error.js.map +1 -1
- package/dist/errors/invalid-authorization-details-error.d.ts +2 -2
- package/dist/errors/invalid-authorization-details-error.d.ts.map +1 -1
- package/dist/errors/invalid-authorization-details-error.js.map +1 -1
- package/dist/errors/invalid-client-id-error.d.ts +1 -1
- package/dist/errors/invalid-client-id-error.d.ts.map +1 -1
- package/dist/errors/invalid-client-id-error.js +12 -6
- package/dist/errors/invalid-client-id-error.js.map +1 -1
- package/dist/errors/invalid-client-metadata-error.d.ts +1 -1
- package/dist/errors/invalid-client-metadata-error.d.ts.map +1 -1
- package/dist/errors/invalid-client-metadata-error.js +11 -3
- package/dist/errors/invalid-client-metadata-error.js.map +1 -1
- package/dist/errors/invalid-parameters-error.d.ts +2 -2
- package/dist/errors/invalid-parameters-error.d.ts.map +1 -1
- package/dist/errors/invalid-parameters-error.js.map +1 -1
- package/dist/errors/invalid-scope-error.d.ts +9 -0
- package/dist/errors/invalid-scope-error.d.ts.map +1 -0
- package/dist/errors/invalid-scope-error.js +14 -0
- package/dist/errors/invalid-scope-error.js.map +1 -0
- package/dist/errors/login-required-error.d.ts +2 -2
- package/dist/errors/login-required-error.d.ts.map +1 -1
- package/dist/errors/login-required-error.js.map +1 -1
- package/dist/lib/html/html.d.ts +1 -1
- package/dist/lib/html/html.d.ts.map +1 -1
- package/dist/lib/html/html.js +14 -11
- package/dist/lib/html/html.js.map +1 -1
- package/dist/lib/http/parser.d.ts +9 -2
- package/dist/lib/http/parser.d.ts.map +1 -1
- package/dist/lib/http/parser.js +15 -7
- package/dist/lib/http/parser.js.map +1 -1
- package/dist/lib/http/request.d.ts +0 -23
- package/dist/lib/http/request.d.ts.map +1 -1
- package/dist/lib/http/request.js +1 -11
- package/dist/lib/http/request.js.map +1 -1
- package/dist/lib/http/stream.d.ts +28 -6
- package/dist/lib/http/stream.d.ts.map +1 -1
- package/dist/lib/http/stream.js +21 -32
- package/dist/lib/http/stream.js.map +1 -1
- package/dist/lib/util/authorization-header.d.ts.map +1 -1
- package/dist/lib/util/authorization-header.js +1 -1
- package/dist/lib/util/authorization-header.js.map +1 -1
- package/dist/lib/util/hostname.d.ts +3 -2
- package/dist/lib/util/hostname.d.ts.map +1 -1
- package/dist/lib/util/hostname.js +12 -8
- package/dist/lib/util/hostname.js.map +1 -1
- package/dist/metadata/build-metadata.d.ts.map +1 -1
- package/dist/metadata/build-metadata.js +2 -1
- package/dist/metadata/build-metadata.js.map +1 -1
- package/dist/oauth-errors.d.ts +1 -0
- package/dist/oauth-errors.d.ts.map +1 -1
- package/dist/oauth-errors.js +3 -1
- package/dist/oauth-errors.js.map +1 -1
- package/dist/oauth-hooks.d.ts +3 -3
- package/dist/oauth-hooks.d.ts.map +1 -1
- package/dist/oauth-provider.d.ts +20 -22
- package/dist/oauth-provider.d.ts.map +1 -1
- package/dist/oauth-provider.js +234 -176
- package/dist/oauth-provider.js.map +1 -1
- package/dist/oauth-verifier.d.ts +2 -2
- package/dist/oauth-verifier.d.ts.map +1 -1
- package/dist/oauth-verifier.js.map +1 -1
- package/dist/output/build-authorize-data.d.ts +2 -2
- package/dist/output/build-authorize-data.d.ts.map +1 -1
- package/dist/output/send-authorize-redirect.d.ts +2 -4
- package/dist/output/send-authorize-redirect.d.ts.map +1 -1
- package/dist/output/send-authorize-redirect.js +5 -2
- package/dist/output/send-authorize-redirect.js.map +1 -1
- package/dist/request/request-data.d.ts +2 -2
- package/dist/request/request-data.d.ts.map +1 -1
- package/dist/request/request-info.d.ts +2 -2
- package/dist/request/request-info.d.ts.map +1 -1
- package/dist/request/request-manager.d.ts +4 -4
- package/dist/request/request-manager.d.ts.map +1 -1
- package/dist/request/request-manager.js +94 -60
- package/dist/request/request-manager.js.map +1 -1
- package/dist/signer/signed-token-payload.d.ts +122 -122
- package/dist/signer/signer.d.ts +41 -40
- package/dist/signer/signer.d.ts.map +1 -1
- package/dist/signer/signer.js +13 -15
- package/dist/signer/signer.js.map +1 -1
- package/dist/token/token-claims.d.ts +121 -121
- package/dist/token/token-data.d.ts +3 -3
- package/dist/token/token-data.d.ts.map +1 -1
- package/dist/token/token-manager.d.ts +4 -5
- package/dist/token/token-manager.d.ts.map +1 -1
- package/dist/token/token-manager.js +96 -72
- package/dist/token/token-manager.js.map +1 -1
- package/dist/token/verify-token-claims.d.ts +3 -3
- package/dist/token/verify-token-claims.d.ts.map +1 -1
- package/dist/token/verify-token-claims.js.map +1 -1
- package/package.json +5 -4
- package/src/assets/app/components/accept-form.tsx +6 -2
- package/src/assets/app/components/client-name.tsx +10 -11
- package/src/assets/app/components/sign-in-form.tsx +31 -2
- package/src/assets/assets-middleware.ts +4 -2
- package/src/client/client-manager.ts +163 -161
- package/src/client/client-utils.ts +7 -12
- package/src/client/client.ts +112 -3
- package/src/constants.ts +0 -2
- package/src/errors/access-denied-error.ts +10 -4
- package/src/errors/account-selection-required-error.ts +2 -2
- package/src/errors/consent-required-error.ts +2 -2
- package/src/errors/invalid-authorization-details-error.ts +2 -2
- package/src/errors/invalid-client-id-error.ts +15 -4
- package/src/errors/invalid-client-metadata-error.ts +15 -3
- package/src/errors/invalid-parameters-error.ts +2 -2
- package/src/errors/invalid-scope-error.ts +15 -0
- package/src/errors/login-required-error.ts +2 -2
- package/src/lib/html/html.ts +14 -12
- package/src/lib/http/parser.ts +21 -8
- package/src/lib/http/request.ts +1 -23
- package/src/lib/http/stream.ts +29 -60
- package/src/lib/util/authorization-header.ts +5 -2
- package/src/lib/util/hostname.ts +9 -5
- package/src/metadata/build-metadata.ts +3 -1
- package/src/oauth-errors.ts +1 -0
- package/src/oauth-hooks.ts +3 -3
- package/src/oauth-provider.ts +368 -269
- package/src/oauth-verifier.ts +2 -2
- package/src/output/build-authorize-data.ts +2 -2
- package/src/output/send-authorize-redirect.ts +7 -6
- package/src/request/request-data.ts +2 -2
- package/src/request/request-info.ts +2 -2
- package/src/request/request-manager.ts +129 -103
- package/src/signer/signer.ts +24 -25
- package/src/token/token-data.ts +3 -3
- package/src/token/token-manager.ts +141 -99
- package/src/token/verify-token-claims.ts +3 -3
- package/dist/request/types.d.ts +0 -328
- package/dist/request/types.d.ts.map +0 -1
- package/dist/request/types.js +0 -27
- package/dist/request/types.js.map +0 -1
- package/dist/token/types.d.ts +0 -250
- package/dist/token/types.d.ts.map +0 -1
- package/dist/token/types.js +0 -36
- package/dist/token/types.js.map +0 -1
- package/src/request/types.ts +0 -48
- package/src/token/types.ts +0 -86
package/dist/request/types.d.ts
DELETED
@@ -1,328 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
export declare const authorizationRequestJarSchema: z.ZodObject<{
|
3
|
-
/**
|
4
|
-
* AuthorizationRequest inside a JWT:
|
5
|
-
* - "iat" is required and **MUST** be less than one minute
|
6
|
-
*
|
7
|
-
* @see {@link https://datatracker.ietf.org/doc/html/rfc9101}
|
8
|
-
*/
|
9
|
-
request: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}`, string>]>;
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
11
|
-
request: `${string}.${string}.${string}` | `${string}.${string}`;
|
12
|
-
}, {
|
13
|
-
request: string;
|
14
|
-
}>;
|
15
|
-
export type AuthorizationRequestJar = z.infer<typeof authorizationRequestJarSchema>;
|
16
|
-
export declare const pushedAuthorizationRequestSchema: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
17
|
-
client_id: z.ZodString;
|
18
|
-
client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
|
19
|
-
client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
21
|
-
client_id: string;
|
22
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
23
|
-
client_assertion: `${string}.${string}.${string}`;
|
24
|
-
}, {
|
25
|
-
client_id: string;
|
26
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
27
|
-
client_assertion: string;
|
28
|
-
}>, z.ZodObject<{
|
29
|
-
client_id: z.ZodString;
|
30
|
-
client_secret: z.ZodString;
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
32
|
-
client_id: string;
|
33
|
-
client_secret: string;
|
34
|
-
}, {
|
35
|
-
client_id: string;
|
36
|
-
client_secret: string;
|
37
|
-
}>]>, z.ZodObject<{
|
38
|
-
client_id: z.ZodString;
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
40
|
-
client_id: string;
|
41
|
-
}, {
|
42
|
-
client_id: string;
|
43
|
-
}>]>, z.ZodUnion<[z.ZodObject<{
|
44
|
-
client_id: z.ZodString;
|
45
|
-
state: z.ZodOptional<z.ZodString>;
|
46
|
-
nonce: z.ZodOptional<z.ZodString>;
|
47
|
-
dpop_jkt: z.ZodOptional<z.ZodString>;
|
48
|
-
response_type: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
|
49
|
-
response_mode: z.ZodOptional<z.ZodEnum<["query", "fragment", "form_post"]>>;
|
50
|
-
code_challenge: z.ZodOptional<z.ZodString>;
|
51
|
-
code_challenge_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["S256", "plain"]>>>;
|
52
|
-
redirect_uri: z.ZodOptional<z.ZodString>;
|
53
|
-
scope: z.ZodOptional<z.ZodString>;
|
54
|
-
max_age: z.ZodOptional<z.ZodNumber>;
|
55
|
-
claims: z.ZodOptional<z.ZodRecord<z.ZodEnum<["userinfo", "id_token"]>, z.ZodRecord<z.ZodEnum<["auth_time", "nonce", "acr", "name", "family_name", "given_name", "middle_name", "nickname", "preferred_username", "gender", "picture", "profile", "website", "birthdate", "zoneinfo", "locale", "updated_at", "email", "email_verified", "phone_number", "phone_number_verified", "address"]>, z.ZodUnion<[z.ZodLiteral<null>, z.ZodObject<{
|
56
|
-
essential: z.ZodOptional<z.ZodBoolean>;
|
57
|
-
value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
58
|
-
values: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
|
59
|
-
}, "strip", z.ZodTypeAny, {
|
60
|
-
values?: (string | number | boolean)[] | undefined;
|
61
|
-
value?: string | number | boolean | undefined;
|
62
|
-
essential?: boolean | undefined;
|
63
|
-
}, {
|
64
|
-
values?: (string | number | boolean)[] | undefined;
|
65
|
-
value?: string | number | boolean | undefined;
|
66
|
-
essential?: boolean | undefined;
|
67
|
-
}>]>>>>;
|
68
|
-
login_hint: z.ZodOptional<z.ZodString>;
|
69
|
-
ui_locales: z.ZodOptional<z.ZodString>;
|
70
|
-
id_token_hint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
71
|
-
display: z.ZodOptional<z.ZodEnum<["page", "popup", "touch"]>>;
|
72
|
-
prompt: z.ZodOptional<z.ZodEnum<["none", "login", "consent", "select_account"]>>;
|
73
|
-
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
74
|
-
type: z.ZodString;
|
75
|
-
locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
76
|
-
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
77
|
-
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
78
|
-
identifier: z.ZodOptional<z.ZodString>;
|
79
|
-
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
80
|
-
}, "strip", z.ZodTypeAny, {
|
81
|
-
type: string;
|
82
|
-
locations?: string[] | undefined;
|
83
|
-
actions?: string[] | undefined;
|
84
|
-
datatypes?: string[] | undefined;
|
85
|
-
identifier?: string | undefined;
|
86
|
-
privileges?: string[] | undefined;
|
87
|
-
}, {
|
88
|
-
type: string;
|
89
|
-
locations?: string[] | undefined;
|
90
|
-
actions?: string[] | undefined;
|
91
|
-
datatypes?: string[] | undefined;
|
92
|
-
identifier?: string | undefined;
|
93
|
-
privileges?: string[] | undefined;
|
94
|
-
}>, "many">>;
|
95
|
-
}, "strip", z.ZodTypeAny, {
|
96
|
-
client_id: string;
|
97
|
-
response_type: "none" | "code" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
98
|
-
scope?: string | undefined;
|
99
|
-
redirect_uri?: string | undefined;
|
100
|
-
nonce?: string | undefined;
|
101
|
-
state?: string | undefined;
|
102
|
-
dpop_jkt?: string | undefined;
|
103
|
-
response_mode?: "query" | "fragment" | "form_post" | undefined;
|
104
|
-
code_challenge?: string | undefined;
|
105
|
-
code_challenge_method?: "S256" | "plain" | undefined;
|
106
|
-
max_age?: number | undefined;
|
107
|
-
claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"nonce" | "name" | "preferred_username" | "email" | "email_verified" | "picture" | "acr" | "auth_time" | "family_name" | "given_name" | "middle_name" | "nickname" | "gender" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "phone_number" | "phone_number_verified" | "address", {
|
108
|
-
values?: (string | number | boolean)[] | undefined;
|
109
|
-
value?: string | number | boolean | undefined;
|
110
|
-
essential?: boolean | undefined;
|
111
|
-
} | null>>>> | undefined;
|
112
|
-
login_hint?: string | undefined;
|
113
|
-
ui_locales?: string | undefined;
|
114
|
-
id_token_hint?: `${string}.${string}.${string}` | undefined;
|
115
|
-
display?: "page" | "popup" | "touch" | undefined;
|
116
|
-
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
117
|
-
authorization_details?: {
|
118
|
-
type: string;
|
119
|
-
locations?: string[] | undefined;
|
120
|
-
actions?: string[] | undefined;
|
121
|
-
datatypes?: string[] | undefined;
|
122
|
-
identifier?: string | undefined;
|
123
|
-
privileges?: string[] | undefined;
|
124
|
-
}[] | undefined;
|
125
|
-
}, {
|
126
|
-
client_id: string;
|
127
|
-
response_type: "none" | "code" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
128
|
-
scope?: string | undefined;
|
129
|
-
redirect_uri?: string | undefined;
|
130
|
-
nonce?: string | undefined;
|
131
|
-
state?: string | undefined;
|
132
|
-
dpop_jkt?: string | undefined;
|
133
|
-
response_mode?: "query" | "fragment" | "form_post" | undefined;
|
134
|
-
code_challenge?: string | undefined;
|
135
|
-
code_challenge_method?: "S256" | "plain" | undefined;
|
136
|
-
max_age?: number | undefined;
|
137
|
-
claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"nonce" | "name" | "preferred_username" | "email" | "email_verified" | "picture" | "acr" | "auth_time" | "family_name" | "given_name" | "middle_name" | "nickname" | "gender" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "phone_number" | "phone_number_verified" | "address", {
|
138
|
-
values?: (string | number | boolean)[] | undefined;
|
139
|
-
value?: string | number | boolean | undefined;
|
140
|
-
essential?: boolean | undefined;
|
141
|
-
} | null>>>> | undefined;
|
142
|
-
login_hint?: string | undefined;
|
143
|
-
ui_locales?: string | undefined;
|
144
|
-
id_token_hint?: string | undefined;
|
145
|
-
display?: "page" | "popup" | "touch" | undefined;
|
146
|
-
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
147
|
-
authorization_details?: {
|
148
|
-
type: string;
|
149
|
-
locations?: string[] | undefined;
|
150
|
-
actions?: string[] | undefined;
|
151
|
-
datatypes?: string[] | undefined;
|
152
|
-
identifier?: string | undefined;
|
153
|
-
privileges?: string[] | undefined;
|
154
|
-
}[] | undefined;
|
155
|
-
}>, z.ZodObject<{
|
156
|
-
/**
|
157
|
-
* AuthorizationRequest inside a JWT:
|
158
|
-
* - "iat" is required and **MUST** be less than one minute
|
159
|
-
*
|
160
|
-
* @see {@link https://datatracker.ietf.org/doc/html/rfc9101}
|
161
|
-
*/
|
162
|
-
request: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}`, string>]>;
|
163
|
-
}, "strip", z.ZodTypeAny, {
|
164
|
-
request: `${string}.${string}.${string}` | `${string}.${string}`;
|
165
|
-
}, {
|
166
|
-
request: string;
|
167
|
-
}>]>>;
|
168
|
-
export type PushedAuthorizationRequest = z.infer<typeof pushedAuthorizationRequestSchema>;
|
169
|
-
export declare const authorizationRequestQuerySchema: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
170
|
-
client_id: z.ZodString;
|
171
|
-
client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
|
172
|
-
client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
|
173
|
-
}, "strip", z.ZodTypeAny, {
|
174
|
-
client_id: string;
|
175
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
176
|
-
client_assertion: `${string}.${string}.${string}`;
|
177
|
-
}, {
|
178
|
-
client_id: string;
|
179
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
180
|
-
client_assertion: string;
|
181
|
-
}>, z.ZodObject<{
|
182
|
-
client_id: z.ZodString;
|
183
|
-
client_secret: z.ZodString;
|
184
|
-
}, "strip", z.ZodTypeAny, {
|
185
|
-
client_id: string;
|
186
|
-
client_secret: string;
|
187
|
-
}, {
|
188
|
-
client_id: string;
|
189
|
-
client_secret: string;
|
190
|
-
}>]>, z.ZodObject<{
|
191
|
-
client_id: z.ZodString;
|
192
|
-
}, "strip", z.ZodTypeAny, {
|
193
|
-
client_id: string;
|
194
|
-
}, {
|
195
|
-
client_id: string;
|
196
|
-
}>]>, z.ZodUnion<[z.ZodObject<{
|
197
|
-
client_id: z.ZodString;
|
198
|
-
state: z.ZodOptional<z.ZodString>;
|
199
|
-
nonce: z.ZodOptional<z.ZodString>;
|
200
|
-
dpop_jkt: z.ZodOptional<z.ZodString>;
|
201
|
-
response_type: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
|
202
|
-
response_mode: z.ZodOptional<z.ZodEnum<["query", "fragment", "form_post"]>>;
|
203
|
-
code_challenge: z.ZodOptional<z.ZodString>;
|
204
|
-
code_challenge_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["S256", "plain"]>>>;
|
205
|
-
redirect_uri: z.ZodOptional<z.ZodString>;
|
206
|
-
scope: z.ZodOptional<z.ZodString>;
|
207
|
-
max_age: z.ZodOptional<z.ZodNumber>;
|
208
|
-
claims: z.ZodOptional<z.ZodRecord<z.ZodEnum<["userinfo", "id_token"]>, z.ZodRecord<z.ZodEnum<["auth_time", "nonce", "acr", "name", "family_name", "given_name", "middle_name", "nickname", "preferred_username", "gender", "picture", "profile", "website", "birthdate", "zoneinfo", "locale", "updated_at", "email", "email_verified", "phone_number", "phone_number_verified", "address"]>, z.ZodUnion<[z.ZodLiteral<null>, z.ZodObject<{
|
209
|
-
essential: z.ZodOptional<z.ZodBoolean>;
|
210
|
-
value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
211
|
-
values: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
|
212
|
-
}, "strip", z.ZodTypeAny, {
|
213
|
-
values?: (string | number | boolean)[] | undefined;
|
214
|
-
value?: string | number | boolean | undefined;
|
215
|
-
essential?: boolean | undefined;
|
216
|
-
}, {
|
217
|
-
values?: (string | number | boolean)[] | undefined;
|
218
|
-
value?: string | number | boolean | undefined;
|
219
|
-
essential?: boolean | undefined;
|
220
|
-
}>]>>>>;
|
221
|
-
login_hint: z.ZodOptional<z.ZodString>;
|
222
|
-
ui_locales: z.ZodOptional<z.ZodString>;
|
223
|
-
id_token_hint: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
224
|
-
display: z.ZodOptional<z.ZodEnum<["page", "popup", "touch"]>>;
|
225
|
-
prompt: z.ZodOptional<z.ZodEnum<["none", "login", "consent", "select_account"]>>;
|
226
|
-
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
227
|
-
type: z.ZodString;
|
228
|
-
locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
229
|
-
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
230
|
-
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
231
|
-
identifier: z.ZodOptional<z.ZodString>;
|
232
|
-
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
233
|
-
}, "strip", z.ZodTypeAny, {
|
234
|
-
type: string;
|
235
|
-
locations?: string[] | undefined;
|
236
|
-
actions?: string[] | undefined;
|
237
|
-
datatypes?: string[] | undefined;
|
238
|
-
identifier?: string | undefined;
|
239
|
-
privileges?: string[] | undefined;
|
240
|
-
}, {
|
241
|
-
type: string;
|
242
|
-
locations?: string[] | undefined;
|
243
|
-
actions?: string[] | undefined;
|
244
|
-
datatypes?: string[] | undefined;
|
245
|
-
identifier?: string | undefined;
|
246
|
-
privileges?: string[] | undefined;
|
247
|
-
}>, "many">>;
|
248
|
-
}, "strip", z.ZodTypeAny, {
|
249
|
-
client_id: string;
|
250
|
-
response_type: "none" | "code" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
251
|
-
scope?: string | undefined;
|
252
|
-
redirect_uri?: string | undefined;
|
253
|
-
nonce?: string | undefined;
|
254
|
-
state?: string | undefined;
|
255
|
-
dpop_jkt?: string | undefined;
|
256
|
-
response_mode?: "query" | "fragment" | "form_post" | undefined;
|
257
|
-
code_challenge?: string | undefined;
|
258
|
-
code_challenge_method?: "S256" | "plain" | undefined;
|
259
|
-
max_age?: number | undefined;
|
260
|
-
claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"nonce" | "name" | "preferred_username" | "email" | "email_verified" | "picture" | "acr" | "auth_time" | "family_name" | "given_name" | "middle_name" | "nickname" | "gender" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "phone_number" | "phone_number_verified" | "address", {
|
261
|
-
values?: (string | number | boolean)[] | undefined;
|
262
|
-
value?: string | number | boolean | undefined;
|
263
|
-
essential?: boolean | undefined;
|
264
|
-
} | null>>>> | undefined;
|
265
|
-
login_hint?: string | undefined;
|
266
|
-
ui_locales?: string | undefined;
|
267
|
-
id_token_hint?: `${string}.${string}.${string}` | undefined;
|
268
|
-
display?: "page" | "popup" | "touch" | undefined;
|
269
|
-
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
270
|
-
authorization_details?: {
|
271
|
-
type: string;
|
272
|
-
locations?: string[] | undefined;
|
273
|
-
actions?: string[] | undefined;
|
274
|
-
datatypes?: string[] | undefined;
|
275
|
-
identifier?: string | undefined;
|
276
|
-
privileges?: string[] | undefined;
|
277
|
-
}[] | undefined;
|
278
|
-
}, {
|
279
|
-
client_id: string;
|
280
|
-
response_type: "none" | "code" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
281
|
-
scope?: string | undefined;
|
282
|
-
redirect_uri?: string | undefined;
|
283
|
-
nonce?: string | undefined;
|
284
|
-
state?: string | undefined;
|
285
|
-
dpop_jkt?: string | undefined;
|
286
|
-
response_mode?: "query" | "fragment" | "form_post" | undefined;
|
287
|
-
code_challenge?: string | undefined;
|
288
|
-
code_challenge_method?: "S256" | "plain" | undefined;
|
289
|
-
max_age?: number | undefined;
|
290
|
-
claims?: Partial<Record<"id_token" | "userinfo", Partial<Record<"nonce" | "name" | "preferred_username" | "email" | "email_verified" | "picture" | "acr" | "auth_time" | "family_name" | "given_name" | "middle_name" | "nickname" | "gender" | "profile" | "website" | "birthdate" | "zoneinfo" | "locale" | "updated_at" | "phone_number" | "phone_number_verified" | "address", {
|
291
|
-
values?: (string | number | boolean)[] | undefined;
|
292
|
-
value?: string | number | boolean | undefined;
|
293
|
-
essential?: boolean | undefined;
|
294
|
-
} | null>>>> | undefined;
|
295
|
-
login_hint?: string | undefined;
|
296
|
-
ui_locales?: string | undefined;
|
297
|
-
id_token_hint?: string | undefined;
|
298
|
-
display?: "page" | "popup" | "touch" | undefined;
|
299
|
-
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
300
|
-
authorization_details?: {
|
301
|
-
type: string;
|
302
|
-
locations?: string[] | undefined;
|
303
|
-
actions?: string[] | undefined;
|
304
|
-
datatypes?: string[] | undefined;
|
305
|
-
identifier?: string | undefined;
|
306
|
-
privileges?: string[] | undefined;
|
307
|
-
}[] | undefined;
|
308
|
-
}>, z.ZodObject<{
|
309
|
-
/**
|
310
|
-
* AuthorizationRequest inside a JWT:
|
311
|
-
* - "iat" is required and **MUST** be less than one minute
|
312
|
-
*
|
313
|
-
* @see {@link https://datatracker.ietf.org/doc/html/rfc9101}
|
314
|
-
*/
|
315
|
-
request: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}`, string>]>;
|
316
|
-
}, "strip", z.ZodTypeAny, {
|
317
|
-
request: `${string}.${string}.${string}` | `${string}.${string}`;
|
318
|
-
}, {
|
319
|
-
request: string;
|
320
|
-
}>, z.ZodObject<{
|
321
|
-
request_uri: z.ZodEffects<z.ZodString, `urn:ietf:params:oauth:request_uri:req-${string}`, string>;
|
322
|
-
}, "strip", z.ZodTypeAny, {
|
323
|
-
request_uri: `urn:ietf:params:oauth:request_uri:req-${string}`;
|
324
|
-
}, {
|
325
|
-
request_uri: string;
|
326
|
-
}>]>>;
|
327
|
-
export type AuthorizationRequestQuery = z.infer<typeof authorizationRequestQuerySchema>;
|
328
|
-
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/request/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,6BAA6B;IACxC;;;;;OAKG;;;;;;EAEH,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAA;AAED,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAb3C;;;;;OAKG;;;;;;KAeJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAA;AAED,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA1B1C;;;;;OAKG;;;;;;;;;;;;KA4BJ,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA"}
|
package/dist/request/types.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.authorizationRequestQuerySchema = exports.pushedAuthorizationRequestSchema = exports.authorizationRequestJarSchema = void 0;
|
4
|
-
const jwk_1 = require("@atproto/jwk");
|
5
|
-
const oauth_types_1 = require("@atproto/oauth-types");
|
6
|
-
const zod_1 = require("zod");
|
7
|
-
const request_uri_js_1 = require("./request-uri.js");
|
8
|
-
exports.authorizationRequestJarSchema = zod_1.z.object({
|
9
|
-
/**
|
10
|
-
* AuthorizationRequest inside a JWT:
|
11
|
-
* - "iat" is required and **MUST** be less than one minute
|
12
|
-
*
|
13
|
-
* @see {@link https://datatracker.ietf.org/doc/html/rfc9101}
|
14
|
-
*/
|
15
|
-
request: zod_1.z.union([jwk_1.signedJwtSchema, jwk_1.unsignedJwtSchema]),
|
16
|
-
});
|
17
|
-
exports.pushedAuthorizationRequestSchema = zod_1.z.intersection(oauth_types_1.oauthClientIdentificationSchema, zod_1.z.union([
|
18
|
-
oauth_types_1.oauthAuthenticationRequestParametersSchema,
|
19
|
-
exports.authorizationRequestJarSchema,
|
20
|
-
//
|
21
|
-
]));
|
22
|
-
exports.authorizationRequestQuerySchema = zod_1.z.intersection(oauth_types_1.oauthClientIdentificationSchema, zod_1.z.union([
|
23
|
-
oauth_types_1.oauthAuthenticationRequestParametersSchema,
|
24
|
-
exports.authorizationRequestJarSchema,
|
25
|
-
zod_1.z.object({ request_uri: request_uri_js_1.requestUriSchema }),
|
26
|
-
]));
|
27
|
-
//# sourceMappingURL=types.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/request/types.ts"],"names":[],"mappings":";;;AAAA,sCAAiE;AACjE,sDAG6B;AAC7B,6BAAuB;AAEvB,qDAAmD;AAEtC,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD;;;;;OAKG;IACH,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,qBAAe,EAAE,uBAAiB,CAAC,CAAC;CACvD,CAAC,CAAA;AAMW,QAAA,gCAAgC,GAAG,OAAC,CAAC,YAAY,CAC5D,6CAA+B,EAC/B,OAAC,CAAC,KAAK,CAAC;IACN,wDAA0C;IAC1C,qCAA6B;IAC7B,EAAE;CACH,CAAC,CACH,CAAA;AAMY,QAAA,+BAA+B,GAAG,OAAC,CAAC,YAAY,CAC3D,6CAA+B,EAC/B,OAAC,CAAC,KAAK,CAAC;IACN,wDAA0C;IAC1C,qCAA6B;IAC7B,OAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iCAAgB,EAAE,CAAC;CAC5C,CAAC,CACH,CAAA"}
|
package/dist/token/types.d.ts
DELETED
@@ -1,250 +0,0 @@
|
|
1
|
-
import { OAuthAuthorizationDetails, OAuthTokenType } from '@atproto/oauth-types';
|
2
|
-
import { z } from 'zod';
|
3
|
-
export declare const codeGrantRequestSchema: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
4
|
-
client_id: z.ZodString;
|
5
|
-
client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
|
6
|
-
client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
8
|
-
client_id: string;
|
9
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
10
|
-
client_assertion: `${string}.${string}.${string}`;
|
11
|
-
}, {
|
12
|
-
client_id: string;
|
13
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
14
|
-
client_assertion: string;
|
15
|
-
}>, z.ZodObject<{
|
16
|
-
client_id: z.ZodString;
|
17
|
-
client_secret: z.ZodString;
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
19
|
-
client_id: string;
|
20
|
-
client_secret: string;
|
21
|
-
}, {
|
22
|
-
client_id: string;
|
23
|
-
client_secret: string;
|
24
|
-
}>]>, z.ZodObject<{
|
25
|
-
client_id: z.ZodString;
|
26
|
-
}, "strip", z.ZodTypeAny, {
|
27
|
-
client_id: string;
|
28
|
-
}, {
|
29
|
-
client_id: string;
|
30
|
-
}>]>, z.ZodObject<{
|
31
|
-
grant_type: z.ZodLiteral<"authorization_code">;
|
32
|
-
code: z.ZodEffects<z.ZodString, `cod-${string}`, string>;
|
33
|
-
/** @see {@link https://datatracker.ietf.org/doc/html/rfc7636#section-4.1} */
|
34
|
-
code_verifier: z.ZodString;
|
35
|
-
redirect_uri: z.ZodString;
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
37
|
-
code: `cod-${string}`;
|
38
|
-
redirect_uri: string;
|
39
|
-
grant_type: "authorization_code";
|
40
|
-
code_verifier: string;
|
41
|
-
}, {
|
42
|
-
code: string;
|
43
|
-
redirect_uri: string;
|
44
|
-
grant_type: "authorization_code";
|
45
|
-
code_verifier: string;
|
46
|
-
}>>;
|
47
|
-
export type CodeGrantRequest = z.infer<typeof codeGrantRequestSchema>;
|
48
|
-
export declare const refreshGrantRequestSchema: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
49
|
-
client_id: z.ZodString;
|
50
|
-
client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
|
51
|
-
client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
|
52
|
-
}, "strip", z.ZodTypeAny, {
|
53
|
-
client_id: string;
|
54
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
55
|
-
client_assertion: `${string}.${string}.${string}`;
|
56
|
-
}, {
|
57
|
-
client_id: string;
|
58
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
59
|
-
client_assertion: string;
|
60
|
-
}>, z.ZodObject<{
|
61
|
-
client_id: z.ZodString;
|
62
|
-
client_secret: z.ZodString;
|
63
|
-
}, "strip", z.ZodTypeAny, {
|
64
|
-
client_id: string;
|
65
|
-
client_secret: string;
|
66
|
-
}, {
|
67
|
-
client_id: string;
|
68
|
-
client_secret: string;
|
69
|
-
}>]>, z.ZodObject<{
|
70
|
-
client_id: z.ZodString;
|
71
|
-
}, "strip", z.ZodTypeAny, {
|
72
|
-
client_id: string;
|
73
|
-
}, {
|
74
|
-
client_id: string;
|
75
|
-
}>]>, z.ZodObject<{
|
76
|
-
grant_type: z.ZodLiteral<"refresh_token">;
|
77
|
-
refresh_token: z.ZodEffects<z.ZodString, `ref-${string}`, string>;
|
78
|
-
client_id: z.ZodString;
|
79
|
-
}, "strip", z.ZodTypeAny, {
|
80
|
-
refresh_token: `ref-${string}`;
|
81
|
-
client_id: string;
|
82
|
-
grant_type: "refresh_token";
|
83
|
-
}, {
|
84
|
-
refresh_token: string;
|
85
|
-
client_id: string;
|
86
|
-
grant_type: "refresh_token";
|
87
|
-
}>>;
|
88
|
-
export type RefreshGrantRequest = z.infer<typeof refreshGrantRequestSchema>;
|
89
|
-
export declare const tokenRequestSchema: z.ZodUnion<[z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
90
|
-
client_id: z.ZodString;
|
91
|
-
client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
|
92
|
-
client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
|
93
|
-
}, "strip", z.ZodTypeAny, {
|
94
|
-
client_id: string;
|
95
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
96
|
-
client_assertion: `${string}.${string}.${string}`;
|
97
|
-
}, {
|
98
|
-
client_id: string;
|
99
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
100
|
-
client_assertion: string;
|
101
|
-
}>, z.ZodObject<{
|
102
|
-
client_id: z.ZodString;
|
103
|
-
client_secret: z.ZodString;
|
104
|
-
}, "strip", z.ZodTypeAny, {
|
105
|
-
client_id: string;
|
106
|
-
client_secret: string;
|
107
|
-
}, {
|
108
|
-
client_id: string;
|
109
|
-
client_secret: string;
|
110
|
-
}>]>, z.ZodObject<{
|
111
|
-
client_id: z.ZodString;
|
112
|
-
}, "strip", z.ZodTypeAny, {
|
113
|
-
client_id: string;
|
114
|
-
}, {
|
115
|
-
client_id: string;
|
116
|
-
}>]>, z.ZodObject<{
|
117
|
-
grant_type: z.ZodLiteral<"authorization_code">;
|
118
|
-
code: z.ZodEffects<z.ZodString, `cod-${string}`, string>;
|
119
|
-
/** @see {@link https://datatracker.ietf.org/doc/html/rfc7636#section-4.1} */
|
120
|
-
code_verifier: z.ZodString;
|
121
|
-
redirect_uri: z.ZodString;
|
122
|
-
}, "strip", z.ZodTypeAny, {
|
123
|
-
code: `cod-${string}`;
|
124
|
-
redirect_uri: string;
|
125
|
-
grant_type: "authorization_code";
|
126
|
-
code_verifier: string;
|
127
|
-
}, {
|
128
|
-
code: string;
|
129
|
-
redirect_uri: string;
|
130
|
-
grant_type: "authorization_code";
|
131
|
-
code_verifier: string;
|
132
|
-
}>>, z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
133
|
-
client_id: z.ZodString;
|
134
|
-
client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
|
135
|
-
client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
|
136
|
-
}, "strip", z.ZodTypeAny, {
|
137
|
-
client_id: string;
|
138
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
139
|
-
client_assertion: `${string}.${string}.${string}`;
|
140
|
-
}, {
|
141
|
-
client_id: string;
|
142
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
143
|
-
client_assertion: string;
|
144
|
-
}>, z.ZodObject<{
|
145
|
-
client_id: z.ZodString;
|
146
|
-
client_secret: z.ZodString;
|
147
|
-
}, "strip", z.ZodTypeAny, {
|
148
|
-
client_id: string;
|
149
|
-
client_secret: string;
|
150
|
-
}, {
|
151
|
-
client_id: string;
|
152
|
-
client_secret: string;
|
153
|
-
}>]>, z.ZodObject<{
|
154
|
-
client_id: z.ZodString;
|
155
|
-
}, "strip", z.ZodTypeAny, {
|
156
|
-
client_id: string;
|
157
|
-
}, {
|
158
|
-
client_id: string;
|
159
|
-
}>]>, z.ZodObject<{
|
160
|
-
grant_type: z.ZodLiteral<"refresh_token">;
|
161
|
-
refresh_token: z.ZodEffects<z.ZodString, `ref-${string}`, string>;
|
162
|
-
client_id: z.ZodString;
|
163
|
-
}, "strip", z.ZodTypeAny, {
|
164
|
-
refresh_token: `ref-${string}`;
|
165
|
-
client_id: string;
|
166
|
-
grant_type: "refresh_token";
|
167
|
-
}, {
|
168
|
-
refresh_token: string;
|
169
|
-
client_id: string;
|
170
|
-
grant_type: "refresh_token";
|
171
|
-
}>>]>;
|
172
|
-
export type TokenRequest = z.infer<typeof tokenRequestSchema>;
|
173
|
-
export declare const tokenIdentification: z.ZodObject<{
|
174
|
-
token: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `ref-${string}`, string>]>;
|
175
|
-
token_type_hint: z.ZodOptional<z.ZodEnum<["access_token", "refresh_token"]>>;
|
176
|
-
}, "strip", z.ZodTypeAny, {
|
177
|
-
token: string;
|
178
|
-
token_type_hint?: "refresh_token" | "access_token" | undefined;
|
179
|
-
}, {
|
180
|
-
token: string;
|
181
|
-
token_type_hint?: "refresh_token" | "access_token" | undefined;
|
182
|
-
}>;
|
183
|
-
export type TokenIdentification = z.infer<typeof tokenIdentification>;
|
184
|
-
export declare const revokeSchema: z.ZodObject<{
|
185
|
-
token: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `ref-${string}`, string>]>;
|
186
|
-
token_type_hint: z.ZodOptional<z.ZodEnum<["access_token", "refresh_token"]>>;
|
187
|
-
}, "strip", z.ZodTypeAny, {
|
188
|
-
token: string;
|
189
|
-
token_type_hint?: "refresh_token" | "access_token" | undefined;
|
190
|
-
}, {
|
191
|
-
token: string;
|
192
|
-
token_type_hint?: "refresh_token" | "access_token" | undefined;
|
193
|
-
}>;
|
194
|
-
export type Revoke = z.infer<typeof revokeSchema>;
|
195
|
-
export declare const introspectSchema: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
196
|
-
client_id: z.ZodString;
|
197
|
-
client_assertion_type: z.ZodLiteral<"urn:ietf:params:oauth:client-assertion-type:jwt-bearer">;
|
198
|
-
client_assertion: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>;
|
199
|
-
}, "strip", z.ZodTypeAny, {
|
200
|
-
client_id: string;
|
201
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
202
|
-
client_assertion: `${string}.${string}.${string}`;
|
203
|
-
}, {
|
204
|
-
client_id: string;
|
205
|
-
client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
206
|
-
client_assertion: string;
|
207
|
-
}>, z.ZodObject<{
|
208
|
-
client_id: z.ZodString;
|
209
|
-
client_secret: z.ZodString;
|
210
|
-
}, "strip", z.ZodTypeAny, {
|
211
|
-
client_id: string;
|
212
|
-
client_secret: string;
|
213
|
-
}, {
|
214
|
-
client_id: string;
|
215
|
-
client_secret: string;
|
216
|
-
}>]>, z.ZodObject<{
|
217
|
-
client_id: z.ZodString;
|
218
|
-
}, "strip", z.ZodTypeAny, {
|
219
|
-
client_id: string;
|
220
|
-
}, {
|
221
|
-
client_id: string;
|
222
|
-
}>]>, z.ZodObject<{
|
223
|
-
token: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `ref-${string}`, string>]>;
|
224
|
-
token_type_hint: z.ZodOptional<z.ZodEnum<["access_token", "refresh_token"]>>;
|
225
|
-
}, "strip", z.ZodTypeAny, {
|
226
|
-
token: string;
|
227
|
-
token_type_hint?: "refresh_token" | "access_token" | undefined;
|
228
|
-
}, {
|
229
|
-
token: string;
|
230
|
-
token_type_hint?: "refresh_token" | "access_token" | undefined;
|
231
|
-
}>>;
|
232
|
-
export type Introspect = z.infer<typeof introspectSchema>;
|
233
|
-
export type IntrospectionResponse = {
|
234
|
-
active: false;
|
235
|
-
} | {
|
236
|
-
active: true;
|
237
|
-
scope?: string;
|
238
|
-
client_id?: string;
|
239
|
-
username?: string;
|
240
|
-
token_type?: OAuthTokenType;
|
241
|
-
authorization_details?: OAuthAuthorizationDetails;
|
242
|
-
aud?: string | [string, ...string[]];
|
243
|
-
exp?: number;
|
244
|
-
iat?: number;
|
245
|
-
iss?: string;
|
246
|
-
jti?: string;
|
247
|
-
nbf?: number;
|
248
|
-
sub?: string;
|
249
|
-
};
|
250
|
-
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/token/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,cAAc,EAGf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK/B,6EAA6E;;;;;;;;;;;;;GAShF,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOrC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAxB3B,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B/E,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE,eAAO,MAAM,YAAY;;;;;;;;;EAAsB,CAAA;AAE/C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAG5B,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAGzD,MAAM,MAAM,qBAAqB,GAC7B;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GACjB;IACE,MAAM,EAAE,IAAI,CAAA;IAEZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,qBAAqB,CAAC,EAAE,yBAAyB,CAAA;IAEjD,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA"}
|
package/dist/token/types.js
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.introspectSchema = exports.revokeSchema = exports.tokenIdentification = exports.tokenRequestSchema = exports.refreshGrantRequestSchema = exports.codeGrantRequestSchema = void 0;
|
4
|
-
const oauth_types_1 = require("@atproto/oauth-types");
|
5
|
-
const zod_1 = require("zod");
|
6
|
-
const client_id_js_1 = require("../client/client-id.js");
|
7
|
-
const code_js_1 = require("../request/code.js");
|
8
|
-
const refresh_token_js_1 = require("./refresh-token.js");
|
9
|
-
exports.codeGrantRequestSchema = zod_1.z.intersection(oauth_types_1.oauthClientIdentificationSchema, zod_1.z.object({
|
10
|
-
grant_type: zod_1.z.literal('authorization_code'),
|
11
|
-
code: code_js_1.codeSchema,
|
12
|
-
/** @see {@link https://datatracker.ietf.org/doc/html/rfc7636#section-4.1} */
|
13
|
-
code_verifier: zod_1.z
|
14
|
-
.string()
|
15
|
-
.min(43)
|
16
|
-
.max(128)
|
17
|
-
.regex(/^[a-zA-Z0-9-._~]+$/),
|
18
|
-
redirect_uri: zod_1.z.string().url(),
|
19
|
-
// request_uri ???
|
20
|
-
}));
|
21
|
-
exports.refreshGrantRequestSchema = zod_1.z.intersection(oauth_types_1.oauthClientIdentificationSchema, zod_1.z.object({
|
22
|
-
grant_type: zod_1.z.literal('refresh_token'),
|
23
|
-
refresh_token: refresh_token_js_1.refreshTokenSchema,
|
24
|
-
client_id: client_id_js_1.clientIdSchema,
|
25
|
-
}));
|
26
|
-
exports.tokenRequestSchema = zod_1.z.union([
|
27
|
-
exports.codeGrantRequestSchema,
|
28
|
-
exports.refreshGrantRequestSchema,
|
29
|
-
]);
|
30
|
-
exports.tokenIdentification = zod_1.z.object({
|
31
|
-
token: zod_1.z.union([oauth_types_1.accessTokenSchema, refresh_token_js_1.refreshTokenSchema]),
|
32
|
-
token_type_hint: zod_1.z.enum(['access_token', 'refresh_token']).optional(),
|
33
|
-
});
|
34
|
-
exports.revokeSchema = exports.tokenIdentification;
|
35
|
-
exports.introspectSchema = zod_1.z.intersection(oauth_types_1.oauthClientIdentificationSchema, exports.tokenIdentification);
|
36
|
-
//# sourceMappingURL=types.js.map
|
package/dist/token/types.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/token/types.ts"],"names":[],"mappings":";;;AAAA,sDAK6B;AAC7B,6BAAuB;AAEvB,yDAAuD;AACvD,gDAA+C;AAC/C,yDAAuD;AAE1C,QAAA,sBAAsB,GAAG,OAAC,CAAC,YAAY,CAClD,6CAA+B,EAC/B,OAAC,CAAC,MAAM,CAAC;IACP,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC3C,IAAI,EAAE,oBAAU;IAChB,6EAA6E;IAC7E,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,CAAC;SACP,GAAG,CAAC,GAAG,CAAC;SACR,KAAK,CAAC,oBAAoB,CAAC;IAC9B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC9B,kBAAkB;CACnB,CAAC,CACH,CAAA;AAIY,QAAA,yBAAyB,GAAG,OAAC,CAAC,YAAY,CACrD,6CAA+B,EAC/B,OAAC,CAAC,MAAM,CAAC;IACP,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACtC,aAAa,EAAE,qCAAkB;IACjC,SAAS,EAAE,6BAAc;CAC1B,CAAC,CACH,CAAA;AAIY,QAAA,kBAAkB,GAAG,OAAC,CAAC,KAAK,CAAC;IACxC,8BAAsB;IACtB,iCAAyB;CAC1B,CAAC,CAAA;AAIW,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,+BAAiB,EAAE,qCAAkB,CAAC,CAAC;IACvD,eAAe,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtE,CAAC,CAAA;AAIW,QAAA,YAAY,GAAG,2BAAmB,CAAA;AAIlC,QAAA,gBAAgB,GAAG,OAAC,CAAC,YAAY,CAC5C,6CAA+B,EAC/B,2BAAmB,CACpB,CAAA"}
|