@atcute/oauth-types 0.1.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/LICENSE +14 -0
- package/README.md +48 -0
- package/dist/build-client-metadata.d.ts +168 -0
- package/dist/build-client-metadata.d.ts.map +1 -0
- package/dist/build-client-metadata.js +53 -0
- package/dist/build-client-metadata.js.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/atcute-confidential-client-metadata.d.ts +21 -0
- package/dist/schemas/atcute-confidential-client-metadata.d.ts.map +1 -0
- package/dist/schemas/atcute-confidential-client-metadata.js +112 -0
- package/dist/schemas/atcute-confidential-client-metadata.js.map +1 -0
- package/dist/schemas/atproto-authorization-server-metadata.d.ts +55 -0
- package/dist/schemas/atproto-authorization-server-metadata.d.ts.map +1 -0
- package/dist/schemas/atproto-authorization-server-metadata.js +25 -0
- package/dist/schemas/atproto-authorization-server-metadata.js.map +1 -0
- package/dist/schemas/atproto-oauth-scope.d.ts +8 -0
- package/dist/schemas/atproto-oauth-scope.d.ts.map +1 -0
- package/dist/schemas/atproto-oauth-scope.js +12 -0
- package/dist/schemas/atproto-oauth-scope.js.map +1 -0
- package/dist/schemas/atproto-oauth-token-response.d.ts +19 -0
- package/dist/schemas/atproto-oauth-token-response.d.ts.map +1 -0
- package/dist/schemas/atproto-oauth-token-response.js +16 -0
- package/dist/schemas/atproto-oauth-token-response.js.map +1 -0
- package/dist/schemas/atproto-protected-resource-metadata.d.ts +21 -0
- package/dist/schemas/atproto-protected-resource-metadata.d.ts.map +1 -0
- package/dist/schemas/atproto-protected-resource-metadata.js +18 -0
- package/dist/schemas/atproto-protected-resource-metadata.js.map +1 -0
- package/dist/schemas/jwk.d.ts +241 -0
- package/dist/schemas/jwk.d.ts.map +1 -0
- package/dist/schemas/jwk.js +138 -0
- package/dist/schemas/jwk.js.map +1 -0
- package/dist/schemas/jwks.d.ts +242 -0
- package/dist/schemas/jwks.d.ts.map +1 -0
- package/dist/schemas/jwks.js +34 -0
- package/dist/schemas/jwks.js.map +1 -0
- package/dist/schemas/oauth-authorization-details.d.ts +64 -0
- package/dist/schemas/oauth-authorization-details.d.ts.map +1 -0
- package/dist/schemas/oauth-authorization-details.js +37 -0
- package/dist/schemas/oauth-authorization-details.js.map +1 -0
- package/dist/schemas/oauth-authorization-server-metadata.d.ts +96 -0
- package/dist/schemas/oauth-authorization-server-metadata.d.ts.map +1 -0
- package/dist/schemas/oauth-authorization-server-metadata.js +81 -0
- package/dist/schemas/oauth-authorization-server-metadata.js.map +1 -0
- package/dist/schemas/oauth-client-id-discoverable.d.ts +6 -0
- package/dist/schemas/oauth-client-id-discoverable.d.ts.map +1 -0
- package/dist/schemas/oauth-client-id-discoverable.js +43 -0
- package/dist/schemas/oauth-client-id-discoverable.js.map +1 -0
- package/dist/schemas/oauth-client-id.d.ts +5 -0
- package/dist/schemas/oauth-client-id.d.ts.map +1 -0
- package/dist/schemas/oauth-client-id.js +4 -0
- package/dist/schemas/oauth-client-id.js.map +1 -0
- package/dist/schemas/oauth-client-metadata.d.ts +164 -0
- package/dist/schemas/oauth-client-metadata.d.ts.map +1 -0
- package/dist/schemas/oauth-client-metadata.js +74 -0
- package/dist/schemas/oauth-client-metadata.js.map +1 -0
- package/dist/schemas/oauth-code-challenge-method.d.ts +4 -0
- package/dist/schemas/oauth-code-challenge-method.d.ts.map +1 -0
- package/dist/schemas/oauth-code-challenge-method.js +3 -0
- package/dist/schemas/oauth-code-challenge-method.js.map +1 -0
- package/dist/schemas/oauth-endpoint-auth-method.d.ts +4 -0
- package/dist/schemas/oauth-endpoint-auth-method.d.ts.map +1 -0
- package/dist/schemas/oauth-endpoint-auth-method.js +3 -0
- package/dist/schemas/oauth-endpoint-auth-method.js.map +1 -0
- package/dist/schemas/oauth-grant-type.d.ts +4 -0
- package/dist/schemas/oauth-grant-type.d.ts.map +1 -0
- package/dist/schemas/oauth-grant-type.js +4 -0
- package/dist/schemas/oauth-grant-type.js.map +1 -0
- package/dist/schemas/oauth-issuer-identifier.d.ts +4 -0
- package/dist/schemas/oauth-issuer-identifier.d.ts.map +1 -0
- package/dist/schemas/oauth-issuer-identifier.js +21 -0
- package/dist/schemas/oauth-issuer-identifier.js.map +1 -0
- package/dist/schemas/oauth-par-response.d.ts +7 -0
- package/dist/schemas/oauth-par-response.d.ts.map +1 -0
- package/dist/schemas/oauth-par-response.js +7 -0
- package/dist/schemas/oauth-par-response.js.map +1 -0
- package/dist/schemas/oauth-prompt.d.ts +13 -0
- package/dist/schemas/oauth-prompt.d.ts.map +1 -0
- package/dist/schemas/oauth-prompt.js +12 -0
- package/dist/schemas/oauth-prompt.js.map +1 -0
- package/dist/schemas/oauth-protected-resource-metadata.d.ts +66 -0
- package/dist/schemas/oauth-protected-resource-metadata.d.ts.map +1 -0
- package/dist/schemas/oauth-protected-resource-metadata.js +71 -0
- package/dist/schemas/oauth-protected-resource-metadata.js.map +1 -0
- package/dist/schemas/oauth-redirect-uri.d.ts +20 -0
- package/dist/schemas/oauth-redirect-uri.d.ts.map +1 -0
- package/dist/schemas/oauth-redirect-uri.js +32 -0
- package/dist/schemas/oauth-redirect-uri.js.map +1 -0
- package/dist/schemas/oauth-response-mode.d.ts +4 -0
- package/dist/schemas/oauth-response-mode.d.ts.map +1 -0
- package/dist/schemas/oauth-response-mode.js +3 -0
- package/dist/schemas/oauth-response-mode.js.map +1 -0
- package/dist/schemas/oauth-response-type.d.ts +4 -0
- package/dist/schemas/oauth-response-type.d.ts.map +1 -0
- package/dist/schemas/oauth-response-type.js +8 -0
- package/dist/schemas/oauth-response-type.js.map +1 -0
- package/dist/schemas/oauth-scope.d.ts +12 -0
- package/dist/schemas/oauth-scope.d.ts.map +1 -0
- package/dist/schemas/oauth-scope.js +14 -0
- package/dist/schemas/oauth-scope.js.map +1 -0
- package/dist/schemas/oauth-token-response.d.ts +22 -0
- package/dist/schemas/oauth-token-response.d.ts.map +1 -0
- package/dist/schemas/oauth-token-response.js +19 -0
- package/dist/schemas/oauth-token-response.js.map +1 -0
- package/dist/schemas/oauth-token-type.d.ts +5 -0
- package/dist/schemas/oauth-token-type.d.ts.map +1 -0
- package/dist/schemas/oauth-token-type.js +13 -0
- package/dist/schemas/oauth-token-type.js.map +1 -0
- package/dist/schemas/uri.d.ts +18 -0
- package/dist/schemas/uri.d.ts.map +1 -0
- package/dist/schemas/uri.js +81 -0
- package/dist/schemas/uri.js.map +1 -0
- package/dist/schemas/utils.d.ts +32 -0
- package/dist/schemas/utils.d.ts.map +1 -0
- package/dist/schemas/utils.js +94 -0
- package/dist/schemas/utils.js.map +1 -0
- package/dist/scope.d.ts +84 -0
- package/dist/scope.d.ts.map +1 -0
- package/dist/scope.js +102 -0
- package/dist/scope.js.map +1 -0
- package/lib/build-client-metadata.ts +72 -0
- package/lib/constants.ts +5 -0
- package/lib/index.ts +116 -0
- package/lib/schemas/atcute-confidential-client-metadata.ts +139 -0
- package/lib/schemas/atproto-authorization-server-metadata.ts +32 -0
- package/lib/schemas/atproto-oauth-scope.ts +18 -0
- package/lib/schemas/atproto-oauth-token-response.ts +20 -0
- package/lib/schemas/atproto-protected-resource-metadata.ts +24 -0
- package/lib/schemas/jwk.ts +189 -0
- package/lib/schemas/jwks.ts +45 -0
- package/lib/schemas/oauth-authorization-details.ts +43 -0
- package/lib/schemas/oauth-authorization-server-metadata.ts +101 -0
- package/lib/schemas/oauth-client-id-discoverable.ts +53 -0
- package/lib/schemas/oauth-client-id.ts +6 -0
- package/lib/schemas/oauth-client-metadata.ts +83 -0
- package/lib/schemas/oauth-code-challenge-method.ts +5 -0
- package/lib/schemas/oauth-endpoint-auth-method.ts +13 -0
- package/lib/schemas/oauth-grant-type.ts +13 -0
- package/lib/schemas/oauth-issuer-identifier.ts +30 -0
- package/lib/schemas/oauth-par-response.ts +10 -0
- package/lib/schemas/oauth-prompt.ts +20 -0
- package/lib/schemas/oauth-protected-resource-metadata.ts +89 -0
- package/lib/schemas/oauth-redirect-uri.ts +42 -0
- package/lib/schemas/oauth-response-mode.ts +9 -0
- package/lib/schemas/oauth-response-type.ts +17 -0
- package/lib/schemas/oauth-scope.ts +18 -0
- package/lib/schemas/oauth-token-response.ts +22 -0
- package/lib/schemas/oauth-token-type.ts +15 -0
- package/lib/schemas/uri.ts +100 -0
- package/lib/schemas/utils.ts +113 -0
- package/lib/scope.ts +187 -0
- package/package.json +38 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import * as v from '@badrap/valita';
|
|
2
|
+
/** JWKS (JSON Web Key Set) */
|
|
3
|
+
export declare const jwksSchema: v.ObjectType<{
|
|
4
|
+
keys: v.Type<({
|
|
5
|
+
kid?: string | undefined;
|
|
6
|
+
use?: "enc" | "sig" | undefined;
|
|
7
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
8
|
+
x5c?: string[] | undefined;
|
|
9
|
+
x5t?: string | undefined;
|
|
10
|
+
'x5t#S256'?: string | undefined;
|
|
11
|
+
x5u?: string | undefined;
|
|
12
|
+
ext?: boolean | undefined;
|
|
13
|
+
iat?: number | undefined;
|
|
14
|
+
exp?: number | undefined;
|
|
15
|
+
nbf?: number | undefined;
|
|
16
|
+
revoked?: {
|
|
17
|
+
revoked_at: number;
|
|
18
|
+
reason?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
kty: "RSA";
|
|
21
|
+
alg?: "PS256" | "PS384" | "PS512" | "RS256" | "RS384" | "RS512" | undefined;
|
|
22
|
+
n: string;
|
|
23
|
+
e: string;
|
|
24
|
+
d?: string | undefined;
|
|
25
|
+
p?: string | undefined;
|
|
26
|
+
q?: string | undefined;
|
|
27
|
+
dp?: string | undefined;
|
|
28
|
+
dq?: string | undefined;
|
|
29
|
+
qi?: string | undefined;
|
|
30
|
+
oth?: {
|
|
31
|
+
r?: string | undefined;
|
|
32
|
+
d?: string | undefined;
|
|
33
|
+
t?: string | undefined;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
} | {
|
|
36
|
+
kid?: string | undefined;
|
|
37
|
+
use?: "enc" | "sig" | undefined;
|
|
38
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
39
|
+
x5c?: string[] | undefined;
|
|
40
|
+
x5t?: string | undefined;
|
|
41
|
+
'x5t#S256'?: string | undefined;
|
|
42
|
+
x5u?: string | undefined;
|
|
43
|
+
ext?: boolean | undefined;
|
|
44
|
+
iat?: number | undefined;
|
|
45
|
+
exp?: number | undefined;
|
|
46
|
+
nbf?: number | undefined;
|
|
47
|
+
revoked?: {
|
|
48
|
+
revoked_at: number;
|
|
49
|
+
reason?: string | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
kty: "EC";
|
|
52
|
+
alg?: "ES256" | "ES384" | "ES512" | undefined;
|
|
53
|
+
crv: "P-256" | "P-384" | "P-521";
|
|
54
|
+
x: string;
|
|
55
|
+
y: string;
|
|
56
|
+
d?: string | undefined;
|
|
57
|
+
} | {
|
|
58
|
+
kid?: string | undefined;
|
|
59
|
+
use?: "enc" | "sig" | undefined;
|
|
60
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
61
|
+
x5c?: string[] | undefined;
|
|
62
|
+
x5t?: string | undefined;
|
|
63
|
+
'x5t#S256'?: string | undefined;
|
|
64
|
+
x5u?: string | undefined;
|
|
65
|
+
ext?: boolean | undefined;
|
|
66
|
+
iat?: number | undefined;
|
|
67
|
+
exp?: number | undefined;
|
|
68
|
+
nbf?: number | undefined;
|
|
69
|
+
revoked?: {
|
|
70
|
+
revoked_at: number;
|
|
71
|
+
reason?: string | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
kty: "EC";
|
|
74
|
+
alg?: "ES256K" | undefined;
|
|
75
|
+
crv: "secp256k1";
|
|
76
|
+
x: string;
|
|
77
|
+
y: string;
|
|
78
|
+
d?: string | undefined;
|
|
79
|
+
} | {
|
|
80
|
+
kid?: string | undefined;
|
|
81
|
+
use?: "enc" | "sig" | undefined;
|
|
82
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
83
|
+
x5c?: string[] | undefined;
|
|
84
|
+
x5t?: string | undefined;
|
|
85
|
+
'x5t#S256'?: string | undefined;
|
|
86
|
+
x5u?: string | undefined;
|
|
87
|
+
ext?: boolean | undefined;
|
|
88
|
+
iat?: number | undefined;
|
|
89
|
+
exp?: number | undefined;
|
|
90
|
+
nbf?: number | undefined;
|
|
91
|
+
revoked?: {
|
|
92
|
+
revoked_at: number;
|
|
93
|
+
reason?: string | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
kty: "OKP";
|
|
96
|
+
alg?: "EdDSA" | undefined;
|
|
97
|
+
crv: "Ed25519" | "Ed448";
|
|
98
|
+
x: string;
|
|
99
|
+
d?: string | undefined;
|
|
100
|
+
} | {
|
|
101
|
+
kid?: string | undefined;
|
|
102
|
+
use?: "enc" | "sig" | undefined;
|
|
103
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
104
|
+
x5c?: string[] | undefined;
|
|
105
|
+
x5t?: string | undefined;
|
|
106
|
+
'x5t#S256'?: string | undefined;
|
|
107
|
+
x5u?: string | undefined;
|
|
108
|
+
ext?: boolean | undefined;
|
|
109
|
+
iat?: number | undefined;
|
|
110
|
+
exp?: number | undefined;
|
|
111
|
+
nbf?: number | undefined;
|
|
112
|
+
revoked?: {
|
|
113
|
+
revoked_at: number;
|
|
114
|
+
reason?: string | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
kty: "oct";
|
|
117
|
+
alg?: "HS256" | "HS384" | "HS512" | undefined;
|
|
118
|
+
k: string;
|
|
119
|
+
})[]>;
|
|
120
|
+
}, undefined>;
|
|
121
|
+
/** public JWKS (JSON Web Key Set with only public keys) */
|
|
122
|
+
export declare const jwksPubSchema: v.ObjectType<{
|
|
123
|
+
keys: v.Type<({
|
|
124
|
+
kid?: string | undefined;
|
|
125
|
+
use?: "enc" | "sig" | undefined;
|
|
126
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
127
|
+
x5c?: string[] | undefined;
|
|
128
|
+
x5t?: string | undefined;
|
|
129
|
+
'x5t#S256'?: string | undefined;
|
|
130
|
+
x5u?: string | undefined;
|
|
131
|
+
ext?: boolean | undefined;
|
|
132
|
+
iat?: number | undefined;
|
|
133
|
+
exp?: number | undefined;
|
|
134
|
+
nbf?: number | undefined;
|
|
135
|
+
revoked?: {
|
|
136
|
+
revoked_at: number;
|
|
137
|
+
reason?: string | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
kty: "RSA";
|
|
140
|
+
alg?: "PS256" | "PS384" | "PS512" | "RS256" | "RS384" | "RS512" | undefined;
|
|
141
|
+
n: string;
|
|
142
|
+
e: string;
|
|
143
|
+
d?: string | undefined;
|
|
144
|
+
p?: string | undefined;
|
|
145
|
+
q?: string | undefined;
|
|
146
|
+
dp?: string | undefined;
|
|
147
|
+
dq?: string | undefined;
|
|
148
|
+
qi?: string | undefined;
|
|
149
|
+
oth?: {
|
|
150
|
+
r?: string | undefined;
|
|
151
|
+
d?: string | undefined;
|
|
152
|
+
t?: string | undefined;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
} | {
|
|
155
|
+
kid?: string | undefined;
|
|
156
|
+
use?: "enc" | "sig" | undefined;
|
|
157
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
158
|
+
x5c?: string[] | undefined;
|
|
159
|
+
x5t?: string | undefined;
|
|
160
|
+
'x5t#S256'?: string | undefined;
|
|
161
|
+
x5u?: string | undefined;
|
|
162
|
+
ext?: boolean | undefined;
|
|
163
|
+
iat?: number | undefined;
|
|
164
|
+
exp?: number | undefined;
|
|
165
|
+
nbf?: number | undefined;
|
|
166
|
+
revoked?: {
|
|
167
|
+
revoked_at: number;
|
|
168
|
+
reason?: string | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
kty: "EC";
|
|
171
|
+
alg?: "ES256" | "ES384" | "ES512" | undefined;
|
|
172
|
+
crv: "P-256" | "P-384" | "P-521";
|
|
173
|
+
x: string;
|
|
174
|
+
y: string;
|
|
175
|
+
d?: string | undefined;
|
|
176
|
+
} | {
|
|
177
|
+
kid?: string | undefined;
|
|
178
|
+
use?: "enc" | "sig" | undefined;
|
|
179
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
180
|
+
x5c?: string[] | undefined;
|
|
181
|
+
x5t?: string | undefined;
|
|
182
|
+
'x5t#S256'?: string | undefined;
|
|
183
|
+
x5u?: string | undefined;
|
|
184
|
+
ext?: boolean | undefined;
|
|
185
|
+
iat?: number | undefined;
|
|
186
|
+
exp?: number | undefined;
|
|
187
|
+
nbf?: number | undefined;
|
|
188
|
+
revoked?: {
|
|
189
|
+
revoked_at: number;
|
|
190
|
+
reason?: string | undefined;
|
|
191
|
+
} | undefined;
|
|
192
|
+
kty: "EC";
|
|
193
|
+
alg?: "ES256K" | undefined;
|
|
194
|
+
crv: "secp256k1";
|
|
195
|
+
x: string;
|
|
196
|
+
y: string;
|
|
197
|
+
d?: string | undefined;
|
|
198
|
+
} | {
|
|
199
|
+
kid?: string | undefined;
|
|
200
|
+
use?: "enc" | "sig" | undefined;
|
|
201
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
202
|
+
x5c?: string[] | undefined;
|
|
203
|
+
x5t?: string | undefined;
|
|
204
|
+
'x5t#S256'?: string | undefined;
|
|
205
|
+
x5u?: string | undefined;
|
|
206
|
+
ext?: boolean | undefined;
|
|
207
|
+
iat?: number | undefined;
|
|
208
|
+
exp?: number | undefined;
|
|
209
|
+
nbf?: number | undefined;
|
|
210
|
+
revoked?: {
|
|
211
|
+
revoked_at: number;
|
|
212
|
+
reason?: string | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
kty: "OKP";
|
|
215
|
+
alg?: "EdDSA" | undefined;
|
|
216
|
+
crv: "Ed25519" | "Ed448";
|
|
217
|
+
x: string;
|
|
218
|
+
d?: string | undefined;
|
|
219
|
+
} | {
|
|
220
|
+
kid?: string | undefined;
|
|
221
|
+
use?: "enc" | "sig" | undefined;
|
|
222
|
+
key_ops?: ("decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey")[] | undefined;
|
|
223
|
+
x5c?: string[] | undefined;
|
|
224
|
+
x5t?: string | undefined;
|
|
225
|
+
'x5t#S256'?: string | undefined;
|
|
226
|
+
x5u?: string | undefined;
|
|
227
|
+
ext?: boolean | undefined;
|
|
228
|
+
iat?: number | undefined;
|
|
229
|
+
exp?: number | undefined;
|
|
230
|
+
nbf?: number | undefined;
|
|
231
|
+
revoked?: {
|
|
232
|
+
revoked_at: number;
|
|
233
|
+
reason?: string | undefined;
|
|
234
|
+
} | undefined;
|
|
235
|
+
kty: "oct";
|
|
236
|
+
alg?: "HS256" | "HS384" | "HS512" | undefined;
|
|
237
|
+
k: string;
|
|
238
|
+
})[]>;
|
|
239
|
+
}, undefined>;
|
|
240
|
+
export type Jwks = v.Infer<typeof jwksSchema>;
|
|
241
|
+
export type JwksPub = v.Infer<typeof jwksPubSchema>;
|
|
242
|
+
//# sourceMappingURL=jwks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwks.d.ts","sourceRoot":"","sources":["../../lib/schemas/jwks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAIpC,8BAA8B;AAC9B,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAkBrB,CAAC;AAEH,2DAA2D;AAC3D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAexB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as v from '@badrap/valita';
|
|
2
|
+
import { jwkPubSchema, jwkSchema } from './jwk.js';
|
|
3
|
+
/** JWKS (JSON Web Key Set) */
|
|
4
|
+
export const jwksSchema = v.object({
|
|
5
|
+
keys: v.array(v.unknown()).chain((input, options) => {
|
|
6
|
+
// implementations SHOULD ignore JWKs within a JWK Set that use "kty"
|
|
7
|
+
// values that are not understood, are missing required members, or
|
|
8
|
+
// have values out of the supported ranges.
|
|
9
|
+
const keys = [];
|
|
10
|
+
for (const item of input) {
|
|
11
|
+
const result = jwkSchema.try(item, options);
|
|
12
|
+
if (!result.ok) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
keys.push(result.value);
|
|
16
|
+
}
|
|
17
|
+
return v.ok(keys);
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
/** public JWKS (JSON Web Key Set with only public keys) */
|
|
21
|
+
export const jwksPubSchema = v.object({
|
|
22
|
+
keys: v.array(v.unknown()).chain((input, options) => {
|
|
23
|
+
const keys = [];
|
|
24
|
+
for (const item of input) {
|
|
25
|
+
const result = jwkPubSchema.try(item, options);
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
keys.push(result.value);
|
|
30
|
+
}
|
|
31
|
+
return v.ok(keys);
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=jwks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwks.js","sourceRoot":"","sources":["../../lib/schemas/jwks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAyB,MAAM,UAAU,CAAC;AAE1E,8BAA8B;AAC9B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;QACpD,qEAAqE;QACrE,mEAAmE;QACnE,2CAA2C;QAC3C,MAAM,IAAI,GAAU,EAAE,CAAC;QAEvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBAChB,SAAS;YACV,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAAA,CAClB,CAAC;CACF,CAAC,CAAC;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;QACpD,MAAM,IAAI,GAAa,EAAE,CAAC;QAE1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBAChB,SAAS;YACV,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAAA,CAClB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as v from '@badrap/valita';
|
|
2
|
+
/**
|
|
3
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc9396#section-2 | RFC 9396, Section 2}
|
|
4
|
+
*/
|
|
5
|
+
export declare const oauthAuthorizationDetailSchema: v.ObjectType<{
|
|
6
|
+
type: v.Type<string>;
|
|
7
|
+
/**
|
|
8
|
+
* an array of strings representing the location of the resource or RS. these
|
|
9
|
+
* strings are typically URIs identifying the location of the RS.
|
|
10
|
+
*/
|
|
11
|
+
locations: v.Optional<string[]>;
|
|
12
|
+
/**
|
|
13
|
+
* an array of strings representing the kinds of actions to be taken at the
|
|
14
|
+
* resource.
|
|
15
|
+
*/
|
|
16
|
+
actions: v.Optional<string[]>;
|
|
17
|
+
/**
|
|
18
|
+
* an array of strings representing the kinds of data being requested from the
|
|
19
|
+
* resource.
|
|
20
|
+
*/
|
|
21
|
+
datatypes: v.Optional<string[]>;
|
|
22
|
+
/**
|
|
23
|
+
* a string identifier indicating a specific resource available at the API.
|
|
24
|
+
*/
|
|
25
|
+
identifier: v.Optional<string>;
|
|
26
|
+
/**
|
|
27
|
+
* an array of strings representing the types or levels of privilege being
|
|
28
|
+
* requested at the resource.
|
|
29
|
+
*/
|
|
30
|
+
privileges: v.Optional<string[]>;
|
|
31
|
+
}, undefined>;
|
|
32
|
+
export type OAuthAuthorizationDetail = v.Infer<typeof oauthAuthorizationDetailSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc9396#section-2 | RFC 9396, Section 2}
|
|
35
|
+
*/
|
|
36
|
+
export declare const oauthAuthorizationDetailsSchema: v.ArrayType<v.ObjectType<{
|
|
37
|
+
type: v.Type<string>;
|
|
38
|
+
/**
|
|
39
|
+
* an array of strings representing the location of the resource or RS. these
|
|
40
|
+
* strings are typically URIs identifying the location of the RS.
|
|
41
|
+
*/
|
|
42
|
+
locations: v.Optional<string[]>;
|
|
43
|
+
/**
|
|
44
|
+
* an array of strings representing the kinds of actions to be taken at the
|
|
45
|
+
* resource.
|
|
46
|
+
*/
|
|
47
|
+
actions: v.Optional<string[]>;
|
|
48
|
+
/**
|
|
49
|
+
* an array of strings representing the kinds of data being requested from the
|
|
50
|
+
* resource.
|
|
51
|
+
*/
|
|
52
|
+
datatypes: v.Optional<string[]>;
|
|
53
|
+
/**
|
|
54
|
+
* a string identifier indicating a specific resource available at the API.
|
|
55
|
+
*/
|
|
56
|
+
identifier: v.Optional<string>;
|
|
57
|
+
/**
|
|
58
|
+
* an array of strings representing the types or levels of privilege being
|
|
59
|
+
* requested at the resource.
|
|
60
|
+
*/
|
|
61
|
+
privileges: v.Optional<string[]>;
|
|
62
|
+
}, undefined>>;
|
|
63
|
+
export type OAuthAuthorizationDetails = v.Infer<typeof oauthAuthorizationDetailsSchema>;
|
|
64
|
+
//# sourceMappingURL=oauth-authorization-details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-authorization-details.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-authorization-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAIpC;;GAEG;AACH,eAAO,MAAM,8BAA8B;;IAE1C;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;;aAEF,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,+BAA+B;;IA/B3C;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;;cASkF,CAAC;AAEvF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as v from '@badrap/valita';
|
|
2
|
+
import { urlSchema } from './uri.js';
|
|
3
|
+
/**
|
|
4
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc9396#section-2 | RFC 9396, Section 2}
|
|
5
|
+
*/
|
|
6
|
+
export const oauthAuthorizationDetailSchema = v.object({
|
|
7
|
+
type: v.string(),
|
|
8
|
+
/**
|
|
9
|
+
* an array of strings representing the location of the resource or RS. these
|
|
10
|
+
* strings are typically URIs identifying the location of the RS.
|
|
11
|
+
*/
|
|
12
|
+
locations: v.array(urlSchema).optional(),
|
|
13
|
+
/**
|
|
14
|
+
* an array of strings representing the kinds of actions to be taken at the
|
|
15
|
+
* resource.
|
|
16
|
+
*/
|
|
17
|
+
actions: v.array(v.string()).optional(),
|
|
18
|
+
/**
|
|
19
|
+
* an array of strings representing the kinds of data being requested from the
|
|
20
|
+
* resource.
|
|
21
|
+
*/
|
|
22
|
+
datatypes: v.array(v.string()).optional(),
|
|
23
|
+
/**
|
|
24
|
+
* a string identifier indicating a specific resource available at the API.
|
|
25
|
+
*/
|
|
26
|
+
identifier: v.string().optional(),
|
|
27
|
+
/**
|
|
28
|
+
* an array of strings representing the types or levels of privilege being
|
|
29
|
+
* requested at the resource.
|
|
30
|
+
*/
|
|
31
|
+
privileges: v.array(v.string()).optional(),
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc9396#section-2 | RFC 9396, Section 2}
|
|
35
|
+
*/
|
|
36
|
+
export const oauthAuthorizationDetailsSchema = v.array(oauthAuthorizationDetailSchema);
|
|
37
|
+
//# sourceMappingURL=oauth-authorization-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-authorization-details.js","sourceRoot":"","sources":["../../lib/schemas/oauth-authorization-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE;IACxC;;;OAGG;IACH,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as v from '@badrap/valita';
|
|
2
|
+
/**
|
|
3
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc8414}
|
|
4
|
+
*/
|
|
5
|
+
export declare const oauthAuthorizationServerMetadataSchema: v.ObjectType<{
|
|
6
|
+
issuer: v.Type<string>;
|
|
7
|
+
claims_supported: v.Optional<string[]>;
|
|
8
|
+
claims_locales_supported: v.Optional<string[]>;
|
|
9
|
+
claims_parameter_supported: v.Optional<boolean>;
|
|
10
|
+
request_parameter_supported: v.Optional<boolean>;
|
|
11
|
+
request_uri_parameter_supported: v.Optional<boolean>;
|
|
12
|
+
require_request_uri_registration: v.Optional<boolean>;
|
|
13
|
+
scopes_supported: v.Optional<string[]>;
|
|
14
|
+
subject_types_supported: v.Optional<string[]>;
|
|
15
|
+
response_types_supported: v.Optional<string[]>;
|
|
16
|
+
response_modes_supported: v.Optional<string[]>;
|
|
17
|
+
grant_types_supported: v.Optional<string[]>;
|
|
18
|
+
code_challenge_methods_supported: v.Optional<("S256" | "plain")[]>;
|
|
19
|
+
ui_locales_supported: v.Optional<string[]>;
|
|
20
|
+
id_token_signing_alg_values_supported: v.Optional<string[]>;
|
|
21
|
+
display_values_supported: v.Optional<string[]>;
|
|
22
|
+
prompt_values_supported: v.Optional<("consent" | "create" | "login" | "none" | "select_account")[]>;
|
|
23
|
+
request_object_signing_alg_values_supported: v.Optional<string[]>;
|
|
24
|
+
authorization_response_iss_parameter_supported: v.Optional<boolean>;
|
|
25
|
+
authorization_details_types_supported: v.Optional<string[]>;
|
|
26
|
+
request_object_encryption_alg_values_supported: v.Optional<string[]>;
|
|
27
|
+
request_object_encryption_enc_values_supported: v.Optional<string[]>;
|
|
28
|
+
jwks_uri: v.Optional<string>;
|
|
29
|
+
authorization_endpoint: v.Type<string>;
|
|
30
|
+
token_endpoint: v.Type<string>;
|
|
31
|
+
token_endpoint_auth_methods_supported: v.Optional<string[]>;
|
|
32
|
+
token_endpoint_auth_signing_alg_values_supported: v.Optional<string[]>;
|
|
33
|
+
revocation_endpoint: v.Optional<string>;
|
|
34
|
+
revocation_endpoint_auth_methods_supported: v.Optional<string[]>;
|
|
35
|
+
revocation_endpoint_auth_signing_alg_values_supported: v.Optional<string[]>;
|
|
36
|
+
introspection_endpoint: v.Optional<string>;
|
|
37
|
+
introspection_endpoint_auth_methods_supported: v.Optional<string[]>;
|
|
38
|
+
introspection_endpoint_auth_signing_alg_values_supported: v.Optional<string[]>;
|
|
39
|
+
pushed_authorization_request_endpoint: v.Optional<string>;
|
|
40
|
+
pushed_authorization_request_endpoint_auth_methods_supported: v.Optional<string[]>;
|
|
41
|
+
pushed_authorization_request_endpoint_auth_signing_alg_values_supported: v.Optional<string[]>;
|
|
42
|
+
require_pushed_authorization_requests: v.Optional<boolean>;
|
|
43
|
+
userinfo_endpoint: v.Optional<string>;
|
|
44
|
+
end_session_endpoint: v.Optional<string>;
|
|
45
|
+
registration_endpoint: v.Optional<string>;
|
|
46
|
+
dpop_signing_alg_values_supported: v.Optional<string[]>;
|
|
47
|
+
protected_resources: v.Optional<string[]>;
|
|
48
|
+
client_id_metadata_document_supported: v.Optional<boolean>;
|
|
49
|
+
}, undefined>;
|
|
50
|
+
export type OAuthAuthorizationServerMetadata = v.Infer<typeof oauthAuthorizationServerMetadataSchema>;
|
|
51
|
+
export declare const oauthAuthorizationServerMetadataValidator: v.Type<{
|
|
52
|
+
issuer: string;
|
|
53
|
+
claims_supported?: string[] | undefined;
|
|
54
|
+
claims_locales_supported?: string[] | undefined;
|
|
55
|
+
claims_parameter_supported?: boolean | undefined;
|
|
56
|
+
request_parameter_supported?: boolean | undefined;
|
|
57
|
+
request_uri_parameter_supported?: boolean | undefined;
|
|
58
|
+
require_request_uri_registration?: boolean | undefined;
|
|
59
|
+
scopes_supported?: string[] | undefined;
|
|
60
|
+
subject_types_supported?: string[] | undefined;
|
|
61
|
+
response_types_supported?: string[] | undefined;
|
|
62
|
+
response_modes_supported?: string[] | undefined;
|
|
63
|
+
grant_types_supported?: string[] | undefined;
|
|
64
|
+
code_challenge_methods_supported?: ("S256" | "plain")[] | undefined;
|
|
65
|
+
ui_locales_supported?: string[] | undefined;
|
|
66
|
+
id_token_signing_alg_values_supported?: string[] | undefined;
|
|
67
|
+
display_values_supported?: string[] | undefined;
|
|
68
|
+
prompt_values_supported?: ("consent" | "create" | "login" | "none" | "select_account")[] | undefined;
|
|
69
|
+
request_object_signing_alg_values_supported?: string[] | undefined;
|
|
70
|
+
authorization_response_iss_parameter_supported?: boolean | undefined;
|
|
71
|
+
authorization_details_types_supported?: string[] | undefined;
|
|
72
|
+
request_object_encryption_alg_values_supported?: string[] | undefined;
|
|
73
|
+
request_object_encryption_enc_values_supported?: string[] | undefined;
|
|
74
|
+
jwks_uri?: string | undefined;
|
|
75
|
+
authorization_endpoint: string;
|
|
76
|
+
token_endpoint: string;
|
|
77
|
+
token_endpoint_auth_methods_supported?: string[] | undefined;
|
|
78
|
+
token_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
|
|
79
|
+
revocation_endpoint?: string | undefined;
|
|
80
|
+
revocation_endpoint_auth_methods_supported?: string[] | undefined;
|
|
81
|
+
revocation_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
|
|
82
|
+
introspection_endpoint?: string | undefined;
|
|
83
|
+
introspection_endpoint_auth_methods_supported?: string[] | undefined;
|
|
84
|
+
introspection_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
|
|
85
|
+
pushed_authorization_request_endpoint?: string | undefined;
|
|
86
|
+
pushed_authorization_request_endpoint_auth_methods_supported?: string[] | undefined;
|
|
87
|
+
pushed_authorization_request_endpoint_auth_signing_alg_values_supported?: string[] | undefined;
|
|
88
|
+
require_pushed_authorization_requests?: boolean | undefined;
|
|
89
|
+
userinfo_endpoint?: string | undefined;
|
|
90
|
+
end_session_endpoint?: string | undefined;
|
|
91
|
+
registration_endpoint?: string | undefined;
|
|
92
|
+
dpop_signing_alg_values_supported?: string[] | undefined;
|
|
93
|
+
protected_resources?: string[] | undefined;
|
|
94
|
+
client_id_metadata_document_supported?: boolean | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
//# sourceMappingURL=oauth-authorization-server-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-authorization-server-metadata.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-authorization-server-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAOpC;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2DjD,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BrD,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as v from '@badrap/valita';
|
|
2
|
+
import { oauthCodeChallengeMethodSchema } from './oauth-code-challenge-method.js';
|
|
3
|
+
import { oauthIssuerIdentifierSchema } from './oauth-issuer-identifier.js';
|
|
4
|
+
import { oauthPromptSchema } from './oauth-prompt.js';
|
|
5
|
+
import { webUriSchema } from './uri.js';
|
|
6
|
+
/**
|
|
7
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc8414}
|
|
8
|
+
*/
|
|
9
|
+
export const oauthAuthorizationServerMetadataSchema = v.object({
|
|
10
|
+
issuer: oauthIssuerIdentifierSchema,
|
|
11
|
+
claims_supported: v.array(v.string()).optional(),
|
|
12
|
+
claims_locales_supported: v.array(v.string()).optional(),
|
|
13
|
+
claims_parameter_supported: v.boolean().optional(),
|
|
14
|
+
request_parameter_supported: v.boolean().optional(),
|
|
15
|
+
request_uri_parameter_supported: v.boolean().optional(),
|
|
16
|
+
require_request_uri_registration: v.boolean().optional(),
|
|
17
|
+
scopes_supported: v.array(v.string()).optional(),
|
|
18
|
+
subject_types_supported: v.array(v.string()).optional(),
|
|
19
|
+
response_types_supported: v.array(v.string()).optional(),
|
|
20
|
+
response_modes_supported: v.array(v.string()).optional(),
|
|
21
|
+
grant_types_supported: v.array(v.string()).optional(),
|
|
22
|
+
code_challenge_methods_supported: v.array(oauthCodeChallengeMethodSchema).optional(),
|
|
23
|
+
ui_locales_supported: v.array(v.string()).optional(),
|
|
24
|
+
id_token_signing_alg_values_supported: v.array(v.string()).optional(),
|
|
25
|
+
display_values_supported: v.array(v.string()).optional(),
|
|
26
|
+
prompt_values_supported: v.array(oauthPromptSchema).optional(),
|
|
27
|
+
request_object_signing_alg_values_supported: v.array(v.string()).optional(),
|
|
28
|
+
authorization_response_iss_parameter_supported: v.boolean().optional(),
|
|
29
|
+
authorization_details_types_supported: v.array(v.string()).optional(),
|
|
30
|
+
request_object_encryption_alg_values_supported: v.array(v.string()).optional(),
|
|
31
|
+
request_object_encryption_enc_values_supported: v.array(v.string()).optional(),
|
|
32
|
+
jwks_uri: webUriSchema.optional(),
|
|
33
|
+
authorization_endpoint: webUriSchema,
|
|
34
|
+
token_endpoint: webUriSchema,
|
|
35
|
+
// https://www.rfc-editor.org/rfc/rfc8414.html#section-2
|
|
36
|
+
token_endpoint_auth_methods_supported: v.array(v.string()).optional(),
|
|
37
|
+
token_endpoint_auth_signing_alg_values_supported: v.array(v.string()).optional(),
|
|
38
|
+
revocation_endpoint: webUriSchema.optional(),
|
|
39
|
+
revocation_endpoint_auth_methods_supported: v.array(v.string()).optional(),
|
|
40
|
+
revocation_endpoint_auth_signing_alg_values_supported: v.array(v.string()).optional(),
|
|
41
|
+
introspection_endpoint: webUriSchema.optional(),
|
|
42
|
+
introspection_endpoint_auth_methods_supported: v.array(v.string()).optional(),
|
|
43
|
+
introspection_endpoint_auth_signing_alg_values_supported: v.array(v.string()).optional(),
|
|
44
|
+
pushed_authorization_request_endpoint: webUriSchema.optional(),
|
|
45
|
+
pushed_authorization_request_endpoint_auth_methods_supported: v.array(v.string()).optional(),
|
|
46
|
+
pushed_authorization_request_endpoint_auth_signing_alg_values_supported: v.array(v.string()).optional(),
|
|
47
|
+
require_pushed_authorization_requests: v.boolean().optional(),
|
|
48
|
+
userinfo_endpoint: webUriSchema.optional(),
|
|
49
|
+
end_session_endpoint: webUriSchema.optional(),
|
|
50
|
+
registration_endpoint: webUriSchema.optional(),
|
|
51
|
+
// https://datatracker.ietf.org/doc/html/rfc9449#section-5.1
|
|
52
|
+
dpop_signing_alg_values_supported: v.array(v.string()).optional(),
|
|
53
|
+
// https://www.rfc-editor.org/rfc/rfc9728.html#section-4
|
|
54
|
+
protected_resources: v.array(webUriSchema).optional(),
|
|
55
|
+
// https://www.ietf.org/archive/id/draft-ietf-oauth-client-id-metadata-document-00.html
|
|
56
|
+
client_id_metadata_document_supported: v.boolean().optional(),
|
|
57
|
+
});
|
|
58
|
+
export const oauthAuthorizationServerMetadataValidator = oauthAuthorizationServerMetadataSchema.chain((data) => {
|
|
59
|
+
if (data.require_pushed_authorization_requests && !data.pushed_authorization_request_endpoint) {
|
|
60
|
+
return v.err({
|
|
61
|
+
message: `"pushed_authorization_request_endpoint" required when "require_pushed_authorization_requests" is true`,
|
|
62
|
+
path: ['pushed_authorization_request_endpoint'],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (data.response_types_supported && !data.response_types_supported.includes('code')) {
|
|
66
|
+
return v.err({
|
|
67
|
+
message: `response type "code" is required`,
|
|
68
|
+
path: ['response_types_supported'],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (data.token_endpoint_auth_signing_alg_values_supported?.includes('none')) {
|
|
72
|
+
// https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.3
|
|
73
|
+
// > The value `none` MUST NOT be used.
|
|
74
|
+
return v.err({
|
|
75
|
+
message: `client authentication method "none" is not allowed`,
|
|
76
|
+
path: ['token_endpoint_auth_signing_alg_values_supported'],
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return v.ok(data);
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=oauth-authorization-server-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-authorization-server-metadata.js","sourceRoot":"","sources":["../../lib/schemas/oauth-authorization-server-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,2BAA2B;IAEnC,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,wBAAwB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxD,0BAA0B,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClD,2BAA2B,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnD,+BAA+B,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvD,gCAAgC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACxD,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAA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v from '@badrap/valita';
|
|
2
|
+
/**
|
|
3
|
+
* @see {@link https://www.ietf.org/archive/id/draft-ietf-oauth-client-id-metadata-document-00.html}
|
|
4
|
+
*/
|
|
5
|
+
export declare const oauthClientIdDiscoverableSchema: v.Type<string>;
|
|
6
|
+
//# sourceMappingURL=oauth-client-id-discoverable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-client-id-discoverable.d.ts","sourceRoot":"","sources":["../../lib/schemas/oauth-client-id-discoverable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAMpC;;GAEG;AACH,eAAO,MAAM,+BAA+B,gBA2C1C,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as v from '@badrap/valita';
|
|
2
|
+
import { oauthClientIdSchema } from './oauth-client-id.js';
|
|
3
|
+
import { httpsUriSchema } from './uri.js';
|
|
4
|
+
import { extractUrlPath, isHostnameIP } from './utils.js';
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link https://www.ietf.org/archive/id/draft-ietf-oauth-client-id-metadata-document-00.html}
|
|
7
|
+
*/
|
|
8
|
+
export const oauthClientIdDiscoverableSchema = v.string().chain((input, options) => {
|
|
9
|
+
// first validate as base client ID
|
|
10
|
+
const clientIdResult = oauthClientIdSchema.try(input, options);
|
|
11
|
+
if (!clientIdResult.ok) {
|
|
12
|
+
return clientIdResult;
|
|
13
|
+
}
|
|
14
|
+
// then validate as https URI
|
|
15
|
+
const httpsResult = httpsUriSchema.try(input, options);
|
|
16
|
+
if (!httpsResult.ok) {
|
|
17
|
+
return httpsResult;
|
|
18
|
+
}
|
|
19
|
+
const url = new URL(input);
|
|
20
|
+
if (url.username || url.password) {
|
|
21
|
+
return v.err(`client ID must not contain credentials`);
|
|
22
|
+
}
|
|
23
|
+
if (url.hash) {
|
|
24
|
+
return v.err(`client ID must not contain a fragment`);
|
|
25
|
+
}
|
|
26
|
+
if (url.pathname === '/') {
|
|
27
|
+
return v.err(`client ID must contain a path component (e.g. "/client-metadata.json")`);
|
|
28
|
+
}
|
|
29
|
+
if (url.pathname.endsWith('/')) {
|
|
30
|
+
return v.err(`client ID path must not end with a trailing slash`);
|
|
31
|
+
}
|
|
32
|
+
if (isHostnameIP(url.hostname)) {
|
|
33
|
+
return v.err(`client ID hostname must not be an IP address`);
|
|
34
|
+
}
|
|
35
|
+
// URL constructor normalizes the URL, so we extract the path manually to
|
|
36
|
+
// avoid normalization, then compare it to the normalized path to ensure
|
|
37
|
+
// that the URL does not contain path traversal or other unexpected characters
|
|
38
|
+
if (extractUrlPath(input) !== url.pathname) {
|
|
39
|
+
return v.err(`client ID must be in canonical form ("${url.href}", got "${input}")`);
|
|
40
|
+
}
|
|
41
|
+
return v.ok(input);
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=oauth-client-id-discoverable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-client-id-discoverable.js","sourceRoot":"","sources":["../../lib/schemas/oauth-client-id-discoverable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;IACnF,mCAAmC;IACnC,MAAM,cAAc,GAAG,mBAAmB,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/D,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC;QACxB,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,6BAA6B;IAC7B,MAAM,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