@atproto/oauth-types 0.4.1 → 0.4.2
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/CHANGELOG.md +14 -0
- package/dist/atproto-loopback-client-id.d.ts +14 -0
- package/dist/atproto-loopback-client-id.d.ts.map +1 -0
- package/dist/atproto-loopback-client-id.js +43 -0
- package/dist/atproto-loopback-client-id.js.map +1 -0
- package/dist/atproto-loopback-client-metadata.d.ts +8 -1
- package/dist/atproto-loopback-client-metadata.d.ts.map +1 -1
- package/dist/atproto-loopback-client-metadata.js +13 -4
- package/dist/atproto-loopback-client-metadata.js.map +1 -1
- package/dist/atproto-loopback-client-redirect-uris.d.ts +2 -0
- package/dist/atproto-loopback-client-redirect-uris.d.ts.map +1 -0
- package/dist/atproto-loopback-client-redirect-uris.js +8 -0
- package/dist/atproto-loopback-client-redirect-uris.js.map +1 -0
- package/dist/atproto-oauth-scope.d.ts +12 -0
- package/dist/atproto-oauth-scope.d.ts.map +1 -0
- package/dist/atproto-oauth-scope.js +27 -0
- package/dist/atproto-oauth-scope.js.map +1 -0
- package/dist/atproto-oauth-token-response.d.ts +106 -0
- package/dist/atproto-oauth-token-response.d.ts.map +1 -0
- package/dist/atproto-oauth-token-response.js +15 -0
- package/dist/atproto-oauth-token-response.js.map +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/oauth-access-token.js.map +1 -1
- package/dist/oauth-authorization-code-grant-token-request.js.map +1 -1
- package/dist/oauth-authorization-details.js.map +1 -1
- package/dist/oauth-authorization-request-jar.js.map +1 -1
- package/dist/oauth-authorization-request-par.d.ts +12 -12
- package/dist/oauth-authorization-request-par.js.map +1 -1
- package/dist/oauth-authorization-request-parameters.d.ts +12 -12
- package/dist/oauth-authorization-request-parameters.js.map +1 -1
- package/dist/oauth-authorization-request-query.d.ts +12 -12
- package/dist/oauth-authorization-request-query.js.map +1 -1
- package/dist/oauth-authorization-request-uri.js.map +1 -1
- package/dist/oauth-authorization-response-error.js.map +1 -1
- package/dist/oauth-authorization-server-metadata.js.map +1 -1
- package/dist/oauth-client-credentials-grant-token-request.js.map +1 -1
- package/dist/oauth-client-credentials.js.map +1 -1
- package/dist/oauth-client-id-discoverable.js.map +1 -1
- package/dist/oauth-client-id-loopback.d.ts +24 -8
- package/dist/oauth-client-id-loopback.d.ts.map +1 -1
- package/dist/oauth-client-id-loopback.js +97 -60
- package/dist/oauth-client-id-loopback.js.map +1 -1
- package/dist/oauth-client-id.js.map +1 -1
- package/dist/oauth-client-metadata.d.ts +160 -1098
- package/dist/oauth-client-metadata.d.ts.map +1 -1
- package/dist/oauth-client-metadata.js.map +1 -1
- package/dist/oauth-code-challenge-method.js.map +1 -1
- package/dist/oauth-endpoint-auth-method.js.map +1 -1
- package/dist/oauth-endpoint-name.js.map +1 -1
- package/dist/oauth-grant-type.js.map +1 -1
- package/dist/oauth-introspection-response.js.map +1 -1
- package/dist/oauth-issuer-identifier.js.map +1 -1
- package/dist/oauth-par-response.d.ts +2 -2
- package/dist/oauth-par-response.js.map +1 -1
- package/dist/oauth-password-grant-token-request.js.map +1 -1
- package/dist/oauth-protected-resource-metadata.js.map +1 -1
- package/dist/oauth-redirect-uri.js.map +1 -1
- package/dist/oauth-refresh-token-grant-token-request.js.map +1 -1
- package/dist/oauth-refresh-token.js.map +1 -1
- package/dist/oauth-request-uri.js.map +1 -1
- package/dist/oauth-response-mode.js.map +1 -1
- package/dist/oauth-response-type.js.map +1 -1
- package/dist/oauth-scope.d.ts +5 -3
- package/dist/oauth-scope.d.ts.map +1 -1
- package/dist/oauth-scope.js +11 -8
- package/dist/oauth-scope.js.map +1 -1
- package/dist/oauth-token-identification.js.map +1 -1
- package/dist/oauth-token-request.js.map +1 -1
- package/dist/oauth-token-response.js.map +1 -1
- package/dist/oauth-token-type.js.map +1 -1
- package/dist/oidc-authorization-error-response.js.map +1 -1
- package/dist/oidc-claims-parameter.js.map +1 -1
- package/dist/oidc-claims-properties.js.map +1 -1
- package/dist/oidc-entity-type.js.map +1 -1
- package/dist/oidc-userinfo.js.map +1 -1
- package/dist/uri.js +1 -1
- package/dist/uri.js.map +1 -1
- package/dist/util.d.ts +9 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +50 -1
- package/dist/util.js.map +1 -1
- package/package.json +3 -2
- package/src/atproto-loopback-client-id.ts +75 -0
- package/src/atproto-loopback-client-metadata.ts +33 -13
- package/src/atproto-loopback-client-redirect-uris.ts +4 -0
- package/src/atproto-oauth-scope.ts +34 -0
- package/src/atproto-oauth-token-response.ts +16 -0
- package/src/index.ts +5 -1
- package/src/oauth-client-id-loopback.ts +130 -72
- package/src/oauth-scope.ts +13 -7
- package/src/uri.ts +1 -1
- package/src/util.ts +60 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atproto/oauth-types
|
|
2
2
|
|
|
3
|
+
## 0.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4216](https://github.com/bluesky-social/atproto/pull/4216) [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Expose new utilities to build and work with atproto loopback client metadata
|
|
8
|
+
|
|
9
|
+
- [#4216](https://github.com/bluesky-social/atproto/pull/4216) [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve validation of `AtprotoOAuthScope`
|
|
10
|
+
|
|
11
|
+
- [#4216](https://github.com/bluesky-social/atproto/pull/4216) [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add `AtprotoOAuthTokenResponse` schema
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`fefe70126`](https://github.com/bluesky-social/atproto/commit/fefe70126d0ea82507ac750f669b3478290f186b), [`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3)]:
|
|
14
|
+
- @atproto/jwk@0.6.0
|
|
15
|
+
- @atproto/did@0.2.1
|
|
16
|
+
|
|
3
17
|
## 0.4.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AtprotoOAuthScope } from './atproto-oauth-scope.js';
|
|
2
|
+
import { OAuthClientIdLoopback } from './oauth-client-id-loopback.js';
|
|
3
|
+
import { OAuthLoopbackRedirectURI } from './oauth-redirect-uri.js';
|
|
4
|
+
export type OAuthLoopbackClientIdConfig = {
|
|
5
|
+
scope?: string;
|
|
6
|
+
redirect_uris?: Iterable<string>;
|
|
7
|
+
};
|
|
8
|
+
export declare function buildAtprotoLoopbackClientId(config?: OAuthLoopbackClientIdConfig): OAuthClientIdLoopback;
|
|
9
|
+
export type AtprotoLoopbackClientIdParams = {
|
|
10
|
+
scope: AtprotoOAuthScope;
|
|
11
|
+
redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]];
|
|
12
|
+
};
|
|
13
|
+
export declare function parseAtprotoLoopbackClientId(clientId: string): AtprotoLoopbackClientIdParams;
|
|
14
|
+
//# sourceMappingURL=atproto-loopback-client-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-loopback-client-id.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-id.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAIlB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEL,qBAAqB,EAEtB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,wBAAwB,EAEzB,MAAM,yBAAyB,CAAA;AAGhC,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CACjC,CAAA;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,CAAC,EAAE,2BAA2B,GACnC,qBAAqB,CA4BvB;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,iBAAiB,CAAA;IACxB,aAAa,EAAE,CAAC,wBAAwB,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;CACzE,CAAA;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,GACf,6BAA6B,CAY/B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildAtprotoLoopbackClientId = buildAtprotoLoopbackClientId;
|
|
4
|
+
exports.parseAtprotoLoopbackClientId = parseAtprotoLoopbackClientId;
|
|
5
|
+
const atproto_loopback_client_redirect_uris_js_1 = require("./atproto-loopback-client-redirect-uris.js");
|
|
6
|
+
const atproto_oauth_scope_js_1 = require("./atproto-oauth-scope.js");
|
|
7
|
+
const oauth_client_id_loopback_js_1 = require("./oauth-client-id-loopback.js");
|
|
8
|
+
const oauth_redirect_uri_js_1 = require("./oauth-redirect-uri.js");
|
|
9
|
+
const util_js_1 = require("./util.js");
|
|
10
|
+
function buildAtprotoLoopbackClientId(config) {
|
|
11
|
+
if (config) {
|
|
12
|
+
const params = new URLSearchParams();
|
|
13
|
+
const { scope } = config;
|
|
14
|
+
if (scope != null && scope !== atproto_oauth_scope_js_1.DEFAULT_ATPROTO_OAUTH_SCOPE) {
|
|
15
|
+
params.set('scope', (0, atproto_oauth_scope_js_1.asAtprotoOAuthScope)(scope));
|
|
16
|
+
}
|
|
17
|
+
const redirectUris = (0, util_js_1.asArray)(config.redirect_uris);
|
|
18
|
+
if (redirectUris &&
|
|
19
|
+
!(0, util_js_1.arrayEquivalent)(redirectUris, atproto_loopback_client_redirect_uris_js_1.DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS)) {
|
|
20
|
+
if (!redirectUris.length) {
|
|
21
|
+
throw new TypeError(`Unexpected empty "redirect_uris" config`);
|
|
22
|
+
}
|
|
23
|
+
for (const uri of redirectUris) {
|
|
24
|
+
params.append('redirect_uri', oauth_redirect_uri_js_1.oauthLoopbackRedirectURISchema.parse(uri));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (params.size) {
|
|
28
|
+
return `${oauth_client_id_loopback_js_1.LOOPBACK_CLIENT_ID_ORIGIN}?${params.toString()}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return oauth_client_id_loopback_js_1.LOOPBACK_CLIENT_ID_ORIGIN;
|
|
32
|
+
}
|
|
33
|
+
function parseAtprotoLoopbackClientId(clientId) {
|
|
34
|
+
const { scope = atproto_oauth_scope_js_1.DEFAULT_ATPROTO_OAUTH_SCOPE, redirect_uris } = (0, oauth_client_id_loopback_js_1.parseOAuthLoopbackClientId)(clientId);
|
|
35
|
+
if (!(0, atproto_oauth_scope_js_1.isAtprotoOAuthScope)(scope)) {
|
|
36
|
+
throw new TypeError('ATProto Loopback ClientID must include "atproto" scope');
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
scope,
|
|
40
|
+
redirect_uris: redirect_uris ?? [...atproto_loopback_client_redirect_uris_js_1.DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=atproto-loopback-client-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-loopback-client-id.js","sourceRoot":"","sources":["../src/atproto-loopback-client-id.ts"],"names":[],"mappings":";;AAuBA,oEA8BC;AAOD,oEAcC;AA1ED,yGAAkG;AAClG,qEAKiC;AACjC,+EAIsC;AACtC,mEAGgC;AAChC,uCAAoD;AAOpD,SAAgB,4BAA4B,CAC1C,MAAoC;IAEpC,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;QAEpC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;QACxB,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,oDAA2B,EAAE,CAAC;YAC3D,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAA,4CAAmB,EAAC,KAAK,CAAC,CAAC,CAAA;QACjD,CAAC;QAED,MAAM,YAAY,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,aAAa,CAAC,CAAA;QAClD,IACE,YAAY;YACZ,CAAC,IAAA,yBAAe,EAAC,YAAY,EAAE,gFAAqC,CAAC,EACrE,CAAC;YACD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;gBACzB,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAA;YAChE,CAAC;YACD,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;gBAC/B,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,sDAA8B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;YAC1E,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,OAAO,GAAG,uDAAyB,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAA;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,uDAAyB,CAAA;AAClC,CAAC;AAOD,SAAgB,4BAA4B,CAC1C,QAAgB;IAEhB,MAAM,EAAE,KAAK,GAAG,oDAA2B,EAAE,aAAa,EAAE,GAC1D,IAAA,wDAA0B,EAAC,QAAQ,CAAC,CAAA;IACtC,IAAI,CAAC,IAAA,4CAAmB,EAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CACjB,wDAAwD,CACzD,CAAA;IACH,CAAC;IACD,OAAO;QACL,KAAK;QACL,aAAa,EAAE,aAAa,IAAI,CAAC,GAAG,gFAAqC,CAAC;KAC3E,CAAA;AACH,CAAC","sourcesContent":["import { DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS } from './atproto-loopback-client-redirect-uris.js'\nimport {\n AtprotoOAuthScope,\n DEFAULT_ATPROTO_OAUTH_SCOPE,\n asAtprotoOAuthScope,\n isAtprotoOAuthScope,\n} from './atproto-oauth-scope.js'\nimport {\n LOOPBACK_CLIENT_ID_ORIGIN,\n OAuthClientIdLoopback,\n parseOAuthLoopbackClientId,\n} from './oauth-client-id-loopback.js'\nimport {\n OAuthLoopbackRedirectURI,\n oauthLoopbackRedirectURISchema,\n} from './oauth-redirect-uri.js'\nimport { arrayEquivalent, asArray } from './util.js'\n\nexport type OAuthLoopbackClientIdConfig = {\n scope?: string\n redirect_uris?: Iterable<string>\n}\n\nexport function buildAtprotoLoopbackClientId(\n config?: OAuthLoopbackClientIdConfig,\n): OAuthClientIdLoopback {\n if (config) {\n const params = new URLSearchParams()\n\n const { scope } = config\n if (scope != null && scope !== DEFAULT_ATPROTO_OAUTH_SCOPE) {\n params.set('scope', asAtprotoOAuthScope(scope))\n }\n\n const redirectUris = asArray(config.redirect_uris)\n if (\n redirectUris &&\n !arrayEquivalent(redirectUris, DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS)\n ) {\n if (!redirectUris.length) {\n throw new TypeError(`Unexpected empty \"redirect_uris\" config`)\n }\n for (const uri of redirectUris) {\n params.append('redirect_uri', oauthLoopbackRedirectURISchema.parse(uri))\n }\n }\n\n if (params.size) {\n return `${LOOPBACK_CLIENT_ID_ORIGIN}?${params.toString()}`\n }\n }\n\n return LOOPBACK_CLIENT_ID_ORIGIN\n}\n\nexport type AtprotoLoopbackClientIdParams = {\n scope: AtprotoOAuthScope\n redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]]\n}\n\nexport function parseAtprotoLoopbackClientId(\n clientId: string,\n): AtprotoLoopbackClientIdParams {\n const { scope = DEFAULT_ATPROTO_OAUTH_SCOPE, redirect_uris } =\n parseOAuthLoopbackClientId(clientId)\n if (!isAtprotoOAuthScope(scope)) {\n throw new TypeError(\n 'ATProto Loopback ClientID must include \"atproto\" scope',\n )\n }\n return {\n scope,\n redirect_uris: redirect_uris ?? [...DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS],\n }\n}\n"]}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { OAuthLoopbackClientIdConfig } from './atproto-loopback-client-id.js';
|
|
2
|
+
import { AtprotoOAuthScope } from './atproto-oauth-scope.js';
|
|
1
3
|
import { OAuthClientIdLoopback } from './oauth-client-id-loopback.js';
|
|
2
4
|
import { OAuthClientMetadataInput } from './oauth-client-metadata.js';
|
|
3
|
-
|
|
5
|
+
import { OAuthLoopbackRedirectURI } from './oauth-redirect-uri.js';
|
|
6
|
+
export type AtprotoLoopbackClientMetadata = OAuthClientMetadataInput & {
|
|
4
7
|
client_id: OAuthClientIdLoopback;
|
|
8
|
+
scope: AtprotoOAuthScope;
|
|
9
|
+
redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]];
|
|
5
10
|
};
|
|
11
|
+
export declare function atprotoLoopbackClientMetadata(clientId: string): AtprotoLoopbackClientMetadata;
|
|
12
|
+
export declare function buildAtprotoLoopbackClientMetadata(config: OAuthLoopbackClientIdConfig): AtprotoLoopbackClientMetadata;
|
|
6
13
|
//# sourceMappingURL=atproto-loopback-client-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atproto-loopback-client-metadata.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"atproto-loopback-client-metadata.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,2BAA2B,EAG5B,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAElE,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,GAAG;IACrE,SAAS,EAAE,qBAAqB,CAAA;IAChC,KAAK,EAAE,iBAAiB,CAAA;IACxB,aAAa,EAAE,CAAC,wBAAwB,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;CACzE,CAAA;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,GACf,6BAA6B,CAI/B;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,2BAA2B,GAClC,6BAA6B,CAG/B"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.atprotoLoopbackClientMetadata = atprotoLoopbackClientMetadata;
|
|
4
|
-
|
|
4
|
+
exports.buildAtprotoLoopbackClientMetadata = buildAtprotoLoopbackClientMetadata;
|
|
5
|
+
const atproto_loopback_client_id_js_1 = require("./atproto-loopback-client-id.js");
|
|
5
6
|
function atprotoLoopbackClientMetadata(clientId) {
|
|
6
|
-
const
|
|
7
|
+
const params = (0, atproto_loopback_client_id_js_1.parseAtprotoLoopbackClientId)(clientId);
|
|
8
|
+
// Safe to cast because parseAtprotoLoopbackClientId ensures it's a loopback ID
|
|
9
|
+
return buildMetadataInternal(clientId, params);
|
|
10
|
+
}
|
|
11
|
+
function buildAtprotoLoopbackClientMetadata(config) {
|
|
12
|
+
const clientId = (0, atproto_loopback_client_id_js_1.buildAtprotoLoopbackClientId)(config);
|
|
13
|
+
return buildMetadataInternal(clientId, (0, atproto_loopback_client_id_js_1.parseAtprotoLoopbackClientId)(clientId));
|
|
14
|
+
}
|
|
15
|
+
function buildMetadataInternal(clientId, clientParams) {
|
|
7
16
|
return {
|
|
8
17
|
client_id: clientId,
|
|
9
|
-
scope,
|
|
10
|
-
redirect_uris,
|
|
18
|
+
scope: clientParams.scope,
|
|
19
|
+
redirect_uris: clientParams.redirect_uris,
|
|
11
20
|
response_types: ['code'],
|
|
12
21
|
grant_types: ['authorization_code', 'refresh_token'],
|
|
13
22
|
token_endpoint_auth_method: 'none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atproto-loopback-client-metadata.js","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"atproto-loopback-client-metadata.js","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":";;AAiBA,sEAMC;AAED,gFAKC;AA9BD,mFAKwC;AAYxC,SAAgB,6BAA6B,CAC3C,QAAgB;IAEhB,MAAM,MAAM,GAAG,IAAA,4DAA4B,EAAC,QAAQ,CAAC,CAAA;IACrD,+EAA+E;IAC/E,OAAO,qBAAqB,CAAC,QAAiC,EAAE,MAAM,CAAC,CAAA;AACzE,CAAC;AAED,SAAgB,kCAAkC,CAChD,MAAmC;IAEnC,MAAM,QAAQ,GAAG,IAAA,4DAA4B,EAAC,MAAM,CAAC,CAAA;IACrD,OAAO,qBAAqB,CAAC,QAAQ,EAAE,IAAA,4DAA4B,EAAC,QAAQ,CAAC,CAAC,CAAA;AAChF,CAAC;AAED,SAAS,qBAAqB,CAC5B,QAA+B,EAC/B,YAA2C;IAE3C,OAAO;QACL,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,WAAW,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACpD,0BAA0B,EAAE,MAAM;QAClC,gBAAgB,EAAE,QAAQ;QAC1B,wBAAwB,EAAE,IAAI;KAC/B,CAAA;AACH,CAAC","sourcesContent":["import {\n AtprotoLoopbackClientIdParams,\n OAuthLoopbackClientIdConfig,\n buildAtprotoLoopbackClientId,\n parseAtprotoLoopbackClientId,\n} from './atproto-loopback-client-id.js'\nimport { AtprotoOAuthScope } from './atproto-oauth-scope.js'\nimport { OAuthClientIdLoopback } from './oauth-client-id-loopback.js'\nimport { OAuthClientMetadataInput } from './oauth-client-metadata.js'\nimport { OAuthLoopbackRedirectURI } from './oauth-redirect-uri.js'\n\nexport type AtprotoLoopbackClientMetadata = OAuthClientMetadataInput & {\n client_id: OAuthClientIdLoopback\n scope: AtprotoOAuthScope\n redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]]\n}\n\nexport function atprotoLoopbackClientMetadata(\n clientId: string,\n): AtprotoLoopbackClientMetadata {\n const params = parseAtprotoLoopbackClientId(clientId)\n // Safe to cast because parseAtprotoLoopbackClientId ensures it's a loopback ID\n return buildMetadataInternal(clientId as OAuthClientIdLoopback, params)\n}\n\nexport function buildAtprotoLoopbackClientMetadata(\n config: OAuthLoopbackClientIdConfig,\n): AtprotoLoopbackClientMetadata {\n const clientId = buildAtprotoLoopbackClientId(config)\n return buildMetadataInternal(clientId, parseAtprotoLoopbackClientId(clientId))\n}\n\nfunction buildMetadataInternal(\n clientId: OAuthClientIdLoopback,\n clientParams: AtprotoLoopbackClientIdParams,\n): AtprotoLoopbackClientMetadata {\n return {\n client_id: clientId,\n scope: clientParams.scope,\n redirect_uris: clientParams.redirect_uris,\n response_types: ['code'],\n grant_types: ['authorization_code', 'refresh_token'],\n token_endpoint_auth_method: 'none',\n application_type: 'native',\n dpop_bound_access_tokens: true,\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-loopback-client-redirect-uris.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-redirect-uris.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,iDAGvC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS = void 0;
|
|
4
|
+
exports.DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS = Object.freeze([
|
|
5
|
+
`http://127.0.0.1/`,
|
|
6
|
+
`http://[::1]/`,
|
|
7
|
+
]);
|
|
8
|
+
//# sourceMappingURL=atproto-loopback-client-redirect-uris.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-loopback-client-redirect-uris.js","sourceRoot":"","sources":["../src/atproto-loopback-client-redirect-uris.ts"],"names":[],"mappings":";;;AAAa,QAAA,qCAAqC,GAAG,MAAM,CAAC,MAAM,CAAC;IACjE,mBAAmB;IACnB,eAAe;CACP,CAAC,CAAA","sourcesContent":["export const DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS = Object.freeze([\n `http://127.0.0.1/`,\n `http://[::1]/`,\n] as const)\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { OAuthScope } from './oauth-scope.js';
|
|
3
|
+
import { SpaceSeparatedValue } from './util.js';
|
|
4
|
+
export declare const ATPROTO_SCOPE_VALUE = "atproto";
|
|
5
|
+
export type AtprotoScopeValue = typeof ATPROTO_SCOPE_VALUE;
|
|
6
|
+
export type AtprotoOAuthScope = OAuthScope & SpaceSeparatedValue<AtprotoScopeValue>;
|
|
7
|
+
export declare function isAtprotoOAuthScope(input: string): input is AtprotoOAuthScope;
|
|
8
|
+
export declare function asAtprotoOAuthScope<I extends string>(input: I): (I & "atproto") | (I & `atproto ${string}`) | (I & `${string} atproto`) | (I & `${string} atproto ${string}`);
|
|
9
|
+
export declare function assertAtprotoOAuthScope(input: string): asserts input is AtprotoOAuthScope;
|
|
10
|
+
export declare const atprotoOAuthScopeSchema: z.ZodEffects<z.ZodString, AtprotoOAuthScope, string>;
|
|
11
|
+
export declare const DEFAULT_ATPROTO_OAUTH_SCOPE = "atproto";
|
|
12
|
+
//# sourceMappingURL=atproto-oauth-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-oauth-scope.d.ts","sourceRoot":"","sources":["../src/atproto-oauth-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAgB,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAyB,MAAM,WAAW,CAAA;AAEtE,eAAO,MAAM,mBAAmB,YAAY,CAAA;AAC5C,MAAM,MAAM,iBAAiB,GAAG,OAAO,mBAAmB,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,UAAU,GACxC,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAExC,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAI7E;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,iHAG7D;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,KAAK,IAAI,iBAAiB,CAEpC;AAED,eAAO,MAAM,uBAAuB,sDAElC,CAAA;AAGF,eAAO,MAAM,2BAA2B,YACS,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_ATPROTO_OAUTH_SCOPE = exports.atprotoOAuthScopeSchema = exports.ATPROTO_SCOPE_VALUE = void 0;
|
|
4
|
+
exports.isAtprotoOAuthScope = isAtprotoOAuthScope;
|
|
5
|
+
exports.asAtprotoOAuthScope = asAtprotoOAuthScope;
|
|
6
|
+
exports.assertAtprotoOAuthScope = assertAtprotoOAuthScope;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const oauth_scope_js_1 = require("./oauth-scope.js");
|
|
9
|
+
const util_js_1 = require("./util.js");
|
|
10
|
+
exports.ATPROTO_SCOPE_VALUE = 'atproto';
|
|
11
|
+
function isAtprotoOAuthScope(input) {
|
|
12
|
+
return ((0, oauth_scope_js_1.isOAuthScope)(input) && (0, util_js_1.isSpaceSeparatedValue)(exports.ATPROTO_SCOPE_VALUE, input));
|
|
13
|
+
}
|
|
14
|
+
function asAtprotoOAuthScope(input) {
|
|
15
|
+
if (isAtprotoOAuthScope(input))
|
|
16
|
+
return input;
|
|
17
|
+
throw new TypeError(`Value must contain "${exports.ATPROTO_SCOPE_VALUE}" scope value`);
|
|
18
|
+
}
|
|
19
|
+
function assertAtprotoOAuthScope(input) {
|
|
20
|
+
void asAtprotoOAuthScope(input);
|
|
21
|
+
}
|
|
22
|
+
exports.atprotoOAuthScopeSchema = zod_1.z.string().refine(isAtprotoOAuthScope, {
|
|
23
|
+
message: 'Invalid ATProto OAuth scope',
|
|
24
|
+
});
|
|
25
|
+
// Default scope is for reading identity (did) only
|
|
26
|
+
exports.DEFAULT_ATPROTO_OAUTH_SCOPE = exports.ATPROTO_SCOPE_VALUE;
|
|
27
|
+
//# sourceMappingURL=atproto-oauth-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-oauth-scope.js","sourceRoot":"","sources":["../src/atproto-oauth-scope.ts"],"names":[],"mappings":";;;AAUA,kDAIC;AAED,kDAGC;AAED,0DAIC;AAzBD,6BAAuB;AACvB,qDAA2D;AAC3D,uCAAsE;AAEzD,QAAA,mBAAmB,GAAG,SAAS,CAAA;AAM5C,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,OAAO,CACL,IAAA,6BAAY,EAAC,KAAK,CAAC,IAAI,IAAA,+BAAqB,EAAC,2BAAmB,EAAE,KAAK,CAAC,CACzE,CAAA;AACH,CAAC;AAED,SAAgB,mBAAmB,CAAmB,KAAQ;IAC5D,IAAI,mBAAmB,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC5C,MAAM,IAAI,SAAS,CAAC,uBAAuB,2BAAmB,eAAe,CAAC,CAAA;AAChF,CAAC;AAED,SAAgB,uBAAuB,CACrC,KAAa;IAEb,KAAK,mBAAmB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAEY,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,mBAAmB,EAAE;IAC5E,OAAO,EAAE,6BAA6B;CACvC,CAAC,CAAA;AAEF,mDAAmD;AACtC,QAAA,2BAA2B,GACtC,2BAA+C,CAAA","sourcesContent":["import { z } from 'zod'\nimport { OAuthScope, isOAuthScope } from './oauth-scope.js'\nimport { SpaceSeparatedValue, isSpaceSeparatedValue } from './util.js'\n\nexport const ATPROTO_SCOPE_VALUE = 'atproto'\nexport type AtprotoScopeValue = typeof ATPROTO_SCOPE_VALUE\n\nexport type AtprotoOAuthScope = OAuthScope &\n SpaceSeparatedValue<AtprotoScopeValue>\n\nexport function isAtprotoOAuthScope(input: string): input is AtprotoOAuthScope {\n return (\n isOAuthScope(input) && isSpaceSeparatedValue(ATPROTO_SCOPE_VALUE, input)\n )\n}\n\nexport function asAtprotoOAuthScope<I extends string>(input: I) {\n if (isAtprotoOAuthScope(input)) return input\n throw new TypeError(`Value must contain \"${ATPROTO_SCOPE_VALUE}\" scope value`)\n}\n\nexport function assertAtprotoOAuthScope(\n input: string,\n): asserts input is AtprotoOAuthScope {\n void asAtprotoOAuthScope(input)\n}\n\nexport const atprotoOAuthScopeSchema = z.string().refine(isAtprotoOAuthScope, {\n message: 'Invalid ATProto OAuth scope',\n})\n\n// Default scope is for reading identity (did) only\nexport const DEFAULT_ATPROTO_OAUTH_SCOPE =\n ATPROTO_SCOPE_VALUE satisfies AtprotoOAuthScope\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { TypeOf, z } from 'zod';
|
|
2
|
+
export declare const atprotoOAuthTokenResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
access_token: z.ZodString;
|
|
4
|
+
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
|
|
5
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
6
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
7
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
|
9
|
+
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
type: z.ZodString;
|
|
11
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, "many">>;
|
|
12
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
+
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
15
|
+
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
type: string;
|
|
18
|
+
locations?: `${string}:${string}`[] | undefined;
|
|
19
|
+
actions?: string[] | undefined;
|
|
20
|
+
datatypes?: string[] | undefined;
|
|
21
|
+
identifier?: string | undefined;
|
|
22
|
+
privileges?: string[] | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
type: string;
|
|
25
|
+
locations?: string[] | undefined;
|
|
26
|
+
actions?: string[] | undefined;
|
|
27
|
+
datatypes?: string[] | undefined;
|
|
28
|
+
identifier?: string | undefined;
|
|
29
|
+
privileges?: string[] | undefined;
|
|
30
|
+
}>, "many">>;
|
|
31
|
+
}, {
|
|
32
|
+
token_type: z.ZodLiteral<"DPoP">;
|
|
33
|
+
sub: z.ZodEffects<z.ZodString, `did:plc:${string}` | `did:web:${string}`, string>;
|
|
34
|
+
scope: z.ZodEffects<z.ZodString, import("./atproto-oauth-scope").AtprotoOAuthScope, string>;
|
|
35
|
+
id_token: z.ZodOptional<z.ZodNever>;
|
|
36
|
+
}>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
|
|
37
|
+
access_token: z.ZodString;
|
|
38
|
+
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
|
|
39
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
40
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
41
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
|
43
|
+
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
type: z.ZodString;
|
|
45
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, "many">>;
|
|
46
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
47
|
+
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
48
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
49
|
+
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
type: string;
|
|
52
|
+
locations?: `${string}:${string}`[] | undefined;
|
|
53
|
+
actions?: string[] | undefined;
|
|
54
|
+
datatypes?: string[] | undefined;
|
|
55
|
+
identifier?: string | undefined;
|
|
56
|
+
privileges?: string[] | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
type: string;
|
|
59
|
+
locations?: string[] | undefined;
|
|
60
|
+
actions?: string[] | undefined;
|
|
61
|
+
datatypes?: string[] | undefined;
|
|
62
|
+
identifier?: string | undefined;
|
|
63
|
+
privileges?: string[] | undefined;
|
|
64
|
+
}>, "many">>;
|
|
65
|
+
}, {
|
|
66
|
+
token_type: z.ZodLiteral<"DPoP">;
|
|
67
|
+
sub: z.ZodEffects<z.ZodString, `did:plc:${string}` | `did:web:${string}`, string>;
|
|
68
|
+
scope: z.ZodEffects<z.ZodString, import("./atproto-oauth-scope").AtprotoOAuthScope, string>;
|
|
69
|
+
id_token: z.ZodOptional<z.ZodNever>;
|
|
70
|
+
}>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
|
|
71
|
+
access_token: z.ZodString;
|
|
72
|
+
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
|
|
73
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
74
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
75
|
+
expires_in: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
|
|
77
|
+
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
+
type: z.ZodString;
|
|
79
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, "many">>;
|
|
80
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
|
+
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
82
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
83
|
+
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
type: string;
|
|
86
|
+
locations?: `${string}:${string}`[] | undefined;
|
|
87
|
+
actions?: string[] | undefined;
|
|
88
|
+
datatypes?: string[] | undefined;
|
|
89
|
+
identifier?: string | undefined;
|
|
90
|
+
privileges?: string[] | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
type: string;
|
|
93
|
+
locations?: string[] | undefined;
|
|
94
|
+
actions?: string[] | undefined;
|
|
95
|
+
datatypes?: string[] | undefined;
|
|
96
|
+
identifier?: string | undefined;
|
|
97
|
+
privileges?: string[] | undefined;
|
|
98
|
+
}>, "many">>;
|
|
99
|
+
}, {
|
|
100
|
+
token_type: z.ZodLiteral<"DPoP">;
|
|
101
|
+
sub: z.ZodEffects<z.ZodString, `did:plc:${string}` | `did:web:${string}`, string>;
|
|
102
|
+
scope: z.ZodEffects<z.ZodString, import("./atproto-oauth-scope").AtprotoOAuthScope, string>;
|
|
103
|
+
id_token: z.ZodOptional<z.ZodNever>;
|
|
104
|
+
}>, z.ZodTypeAny, "passthrough">>;
|
|
105
|
+
export type AtprotoOAuthTokenResponse = TypeOf<typeof atprotoOAuthTokenResponseSchema>;
|
|
106
|
+
//# sourceMappingURL=atproto-oauth-token-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-oauth-token-response.d.ts","sourceRoot":"","sources":["../src/atproto-oauth-token-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAK/B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAM1C,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C,OAAO,+BAA+B,CACvC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.atprotoOAuthTokenResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const did_1 = require("@atproto/did");
|
|
6
|
+
const atproto_oauth_scope_1 = require("./atproto-oauth-scope");
|
|
7
|
+
const oauth_token_response_js_1 = require("./oauth-token-response.js");
|
|
8
|
+
exports.atprotoOAuthTokenResponseSchema = oauth_token_response_js_1.oauthTokenResponseSchema.extend({
|
|
9
|
+
token_type: zod_1.z.literal('DPoP'),
|
|
10
|
+
sub: did_1.atprotoDidSchema,
|
|
11
|
+
scope: atproto_oauth_scope_1.atprotoOAuthScopeSchema,
|
|
12
|
+
// OpenID is not compatible with atproto identities
|
|
13
|
+
id_token: zod_1.z.never().optional(),
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=atproto-oauth-token-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto-oauth-token-response.js","sourceRoot":"","sources":["../src/atproto-oauth-token-response.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,sCAA+C;AAC/C,+DAA+D;AAC/D,uEAAoE;AAEvD,QAAA,+BAA+B,GAAG,kDAAwB,CAAC,MAAM,CAAC;IAC7E,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,sBAAgB;IACrB,KAAK,EAAE,6CAAuB;IAC9B,mDAAmD;IACnD,QAAQ,EAAE,OAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAA","sourcesContent":["import { TypeOf, z } from 'zod'\nimport { atprotoDidSchema } from '@atproto/did'\nimport { atprotoOAuthScopeSchema } from './atproto-oauth-scope'\nimport { oauthTokenResponseSchema } from './oauth-token-response.js'\n\nexport const atprotoOAuthTokenResponseSchema = oauthTokenResponseSchema.extend({\n token_type: z.literal('DPoP'),\n sub: atprotoDidSchema,\n scope: atprotoOAuthScopeSchema,\n // OpenID is not compatible with atproto identities\n id_token: z.never().optional(),\n})\n\nexport type AtprotoOAuthTokenResponse = TypeOf<\n typeof atprotoOAuthTokenResponseSchema\n>\n"]}
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gCAAgC,GAC3C,wDAAwD,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gCAAgC,GAC3C,wDAAwD,CAAA","sourcesContent":["export const CLIENT_ASSERTION_TYPE_JWT_BEARER =\n 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export * from './constants.js';
|
|
2
2
|
export * from './uri.js';
|
|
3
3
|
export * from './util.js';
|
|
4
|
+
export * from './atproto-loopback-client-id.js';
|
|
4
5
|
export * from './atproto-loopback-client-metadata.js';
|
|
6
|
+
export * from './atproto-loopback-client-redirect-uris.js';
|
|
7
|
+
export * from './atproto-oauth-scope.js';
|
|
8
|
+
export * from './atproto-oauth-token-response.js';
|
|
5
9
|
export * from './oauth-access-token.js';
|
|
6
|
-
export * from './oauth-authorization-response-error.js';
|
|
7
10
|
export * from './oauth-authorization-code-grant-token-request.js';
|
|
8
11
|
export * from './oauth-authorization-details.js';
|
|
9
12
|
export * from './oauth-authorization-request-jar.js';
|
|
@@ -11,6 +14,7 @@ export * from './oauth-authorization-request-par.js';
|
|
|
11
14
|
export * from './oauth-authorization-request-parameters.js';
|
|
12
15
|
export * from './oauth-authorization-request-query.js';
|
|
13
16
|
export * from './oauth-authorization-request-uri.js';
|
|
17
|
+
export * from './oauth-authorization-response-error.js';
|
|
14
18
|
export * from './oauth-authorization-server-metadata.js';
|
|
15
19
|
export * from './oauth-client-credentials-grant-token-request.js';
|
|
16
20
|
export * from './oauth-client-credentials.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,cAAc,uCAAuC,CAAA;AACrD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uCAAuC,CAAA;AACrD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,0BAA0B,CAAA;AACxC,cAAc,mCAAmC,CAAA;AACjD,cAAc,yBAAyB,CAAA;AACvC,cAAc,mDAAmD,CAAA;AACjE,cAAc,kCAAkC,CAAA;AAChD,cAAc,sCAAsC,CAAA;AACpD,cAAc,sCAAsC,CAAA;AACpD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,wCAAwC,CAAA;AACtD,cAAc,sCAAsC,CAAA;AACpD,cAAc,yCAAyC,CAAA;AACvD,cAAc,0CAA0C,CAAA;AACxD,cAAc,mDAAmD,CAAA;AACjE,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mCAAmC,CAAA;AACjD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yCAAyC,CAAA;AACvD,cAAc,wCAAwC,CAAA;AACtD,cAAc,yBAAyB,CAAA;AACvC,cAAc,8CAA8C,CAAA;AAC5D,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wCAAwC,CAAA;AACtD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -17,9 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./constants.js"), exports);
|
|
18
18
|
__exportStar(require("./uri.js"), exports);
|
|
19
19
|
__exportStar(require("./util.js"), exports);
|
|
20
|
+
__exportStar(require("./atproto-loopback-client-id.js"), exports);
|
|
20
21
|
__exportStar(require("./atproto-loopback-client-metadata.js"), exports);
|
|
22
|
+
__exportStar(require("./atproto-loopback-client-redirect-uris.js"), exports);
|
|
23
|
+
__exportStar(require("./atproto-oauth-scope.js"), exports);
|
|
24
|
+
__exportStar(require("./atproto-oauth-token-response.js"), exports);
|
|
21
25
|
__exportStar(require("./oauth-access-token.js"), exports);
|
|
22
|
-
__exportStar(require("./oauth-authorization-response-error.js"), exports);
|
|
23
26
|
__exportStar(require("./oauth-authorization-code-grant-token-request.js"), exports);
|
|
24
27
|
__exportStar(require("./oauth-authorization-details.js"), exports);
|
|
25
28
|
__exportStar(require("./oauth-authorization-request-jar.js"), exports);
|
|
@@ -27,6 +30,7 @@ __exportStar(require("./oauth-authorization-request-par.js"), exports);
|
|
|
27
30
|
__exportStar(require("./oauth-authorization-request-parameters.js"), exports);
|
|
28
31
|
__exportStar(require("./oauth-authorization-request-query.js"), exports);
|
|
29
32
|
__exportStar(require("./oauth-authorization-request-uri.js"), exports);
|
|
33
|
+
__exportStar(require("./oauth-authorization-response-error.js"), exports);
|
|
30
34
|
__exportStar(require("./oauth-authorization-server-metadata.js"), exports);
|
|
31
35
|
__exportStar(require("./oauth-client-credentials-grant-token-request.js"), exports);
|
|
32
36
|
__exportStar(require("./oauth-client-credentials.js"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,2CAAwB;AACxB,4CAAyB;AAEzB,wEAAqD;AACrD,0DAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,2CAAwB;AACxB,4CAAyB;AAEzB,kEAA+C;AAC/C,wEAAqD;AACrD,6EAA0D;AAC1D,2DAAwC;AACxC,oEAAiD;AACjD,0DAAuC;AACvC,oFAAiE;AACjE,mEAAgD;AAChD,uEAAoD;AACpD,uEAAoD;AACpD,8EAA2D;AAC3D,yEAAsD;AACtD,uEAAoD;AACpD,0EAAuD;AACvD,2EAAwD;AACxD,oFAAiE;AACjE,gEAA6C;AAC7C,oEAAiD;AACjD,gEAA6C;AAC7C,uDAAoC;AACpC,6DAA0C;AAC1C,kEAA+C;AAC/C,2DAAwC;AACxC,wDAAqC;AACrC,oEAAiD;AACjD,+DAA4C;AAC5C,0DAAuC;AACvC,0EAAuD;AACvD,yEAAsD;AACtD,0DAAuC;AACvC,+EAA4D;AAC5D,2DAAwC;AACxC,yDAAsC;AACtC,2DAAwC;AACxC,2DAAwC;AACxC,mDAAgC;AAChC,kEAA+C;AAC/C,2DAAwC;AACxC,4DAAyC;AACzC,wDAAqC;AACrC,yEAAsD;AACtD,6DAA0C;AAC1C,8DAA2C;AAC3C,wDAAqC;AACrC,qDAAkC","sourcesContent":["export * from './constants.js'\nexport * from './uri.js'\nexport * from './util.js'\n\nexport * from './atproto-loopback-client-id.js'\nexport * from './atproto-loopback-client-metadata.js'\nexport * from './atproto-loopback-client-redirect-uris.js'\nexport * from './atproto-oauth-scope.js'\nexport * from './atproto-oauth-token-response.js'\nexport * from './oauth-access-token.js'\nexport * from './oauth-authorization-code-grant-token-request.js'\nexport * from './oauth-authorization-details.js'\nexport * from './oauth-authorization-request-jar.js'\nexport * from './oauth-authorization-request-par.js'\nexport * from './oauth-authorization-request-parameters.js'\nexport * from './oauth-authorization-request-query.js'\nexport * from './oauth-authorization-request-uri.js'\nexport * from './oauth-authorization-response-error.js'\nexport * from './oauth-authorization-server-metadata.js'\nexport * from './oauth-client-credentials-grant-token-request.js'\nexport * from './oauth-client-credentials.js'\nexport * from './oauth-client-id-discoverable.js'\nexport * from './oauth-client-id-loopback.js'\nexport * from './oauth-client-id.js'\nexport * from './oauth-client-metadata.js'\nexport * from './oauth-endpoint-auth-method.js'\nexport * from './oauth-endpoint-name.js'\nexport * from './oauth-grant-type.js'\nexport * from './oauth-introspection-response.js'\nexport * from './oauth-issuer-identifier.js'\nexport * from './oauth-par-response.js'\nexport * from './oauth-password-grant-token-request.js'\nexport * from './oauth-protected-resource-metadata.js'\nexport * from './oauth-redirect-uri.js'\nexport * from './oauth-refresh-token-grant-token-request.js'\nexport * from './oauth-refresh-token.js'\nexport * from './oauth-request-uri.js'\nexport * from './oauth-response-mode.js'\nexport * from './oauth-response-type.js'\nexport * from './oauth-scope.js'\nexport * from './oauth-token-identification.js'\nexport * from './oauth-token-request.js'\nexport * from './oauth-token-response.js'\nexport * from './oauth-token-type.js'\nexport * from './oidc-authorization-error-response.js'\nexport * from './oidc-claims-parameter.js'\nexport * from './oidc-claims-properties.js'\nexport * from './oidc-entity-type.js'\nexport * from './oidc-userinfo.js'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-access-token.js","sourceRoot":"","sources":["../src/oauth-access-token.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"oauth-access-token.js","sourceRoot":"","sources":["../src/oauth-access-token.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA","sourcesContent":["import { z } from 'zod'\n\nexport const oauthAccessTokenSchema = z.string().min(1)\nexport type OAuthAccessToken = z.infer<typeof oauthAccessTokenSchema>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-authorization-code-grant-token-request.js","sourceRoot":"","sources":["../src/oauth-authorization-code-grant-token-request.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,mEAAgE;AAEnD,QAAA,6CAA6C,GAAG,OAAC,CAAC,MAAM,CAAC;IACpE,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,YAAY,EAAE,8CAAsB;IACpC,6EAA6E;IAC7E,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,CAAC;SACP,GAAG,CAAC,GAAG,CAAC;SACR,KAAK,CAAC,oBAAoB,CAAC;SAC3B,QAAQ,EAAE;CACd,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"oauth-authorization-code-grant-token-request.js","sourceRoot":"","sources":["../src/oauth-authorization-code-grant-token-request.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,mEAAgE;AAEnD,QAAA,6CAA6C,GAAG,OAAC,CAAC,MAAM,CAAC;IACpE,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,YAAY,EAAE,8CAAsB;IACpC,6EAA6E;IAC7E,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,CAAC;SACP,GAAG,CAAC,GAAG,CAAC;SACR,KAAK,CAAC,oBAAoB,CAAC;SAC3B,QAAQ,EAAE;CACd,CAAC,CAAA","sourcesContent":["import { z } from 'zod'\nimport { oauthRedirectUriSchema } from './oauth-redirect-uri.js'\n\nexport const oauthAuthorizationCodeGrantTokenRequestSchema = z.object({\n grant_type: z.literal('authorization_code'),\n code: z.string().min(1),\n redirect_uri: oauthRedirectUriSchema,\n /** @see {@link https://datatracker.ietf.org/doc/html/rfc7636#section-4.1} */\n code_verifier: z\n .string()\n .min(43)\n .max(128)\n .regex(/^[a-zA-Z0-9-._~]+$/)\n .optional(),\n})\n\nexport type OAuthAuthorizationCodeGrantTokenRequest = z.infer<\n typeof oauthAuthorizationCodeGrantTokenRequestSchema\n>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-authorization-details.js","sourceRoot":"","sources":["../src/oauth-authorization-details.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,qCAA6C;AAE7C;;GAEG;AACU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB;;;OAGG;IACH,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,2BAAkB,CAAC,CAAC,QAAQ,EAAE;IACjD;;;OAGG;IACH,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC;;;OAGG;IACH,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC;;OAEG;IACH,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC;;;OAGG;IACH,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAA;AAMF;;GAEG;AACU,QAAA,+BAA+B,GAAG,OAAC,CAAC,KAAK,CACpD,sCAA8B,CAC/B,CAAA"}
|
|
1
|
+
{"version":3,"file":"oauth-authorization-details.js","sourceRoot":"","sources":["../src/oauth-authorization-details.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,qCAA6C;AAE7C;;GAEG;AACU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB;;;OAGG;IACH,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,2BAAkB,CAAC,CAAC,QAAQ,EAAE;IACjD;;;OAGG;IACH,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC;;;OAGG;IACH,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC;;OAEG;IACH,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC;;;OAGG;IACH,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAA;AAMF;;GAEG;AACU,QAAA,+BAA+B,GAAG,OAAC,CAAC,KAAK,CACpD,sCAA8B,CAC/B,CAAA","sourcesContent":["import { z } from 'zod'\nimport { dangerousUriSchema } from './uri.js'\n\n/**\n * @see {@link https://datatracker.ietf.org/doc/html/rfc9396#section-2 | RFC 9396, Section 2}\n */\nexport const oauthAuthorizationDetailSchema = z.object({\n type: z.string(),\n /**\n * An array of strings representing the location of the resource or RS. These\n * strings are typically URIs identifying the location of the RS.\n */\n locations: z.array(dangerousUriSchema).optional(),\n /**\n * An array of strings representing the kinds of actions to be taken at the\n * resource.\n */\n actions: z.array(z.string()).optional(),\n /**\n * An array of strings representing the kinds of data being requested from the\n * resource.\n */\n datatypes: z.array(z.string()).optional(),\n /**\n * A string identifier indicating a specific resource available at the API.\n */\n identifier: z.string().optional(),\n /**\n * An array of strings representing the types or levels of privilege being\n * requested at the resource.\n */\n privileges: z.array(z.string()).optional(),\n})\n\nexport type OAuthAuthorizationDetail = z.infer<\n typeof oauthAuthorizationDetailSchema\n>\n\n/**\n * @see {@link https://datatracker.ietf.org/doc/html/rfc9396#section-2 | RFC 9396, Section 2}\n */\nexport const oauthAuthorizationDetailsSchema = z.array(\n oauthAuthorizationDetailSchema,\n)\n\nexport type OAuthAuthorizationDetails = z.infer<\n typeof oauthAuthorizationDetailsSchema\n>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-authorization-request-jar.js","sourceRoot":"","sources":["../src/oauth-authorization-request-jar.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,sCAAiE;AAEpD,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD;;;;;OAKG;IACH,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,qBAAe,EAAE,uBAAiB,CAAC,CAAC;CACvD,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"oauth-authorization-request-jar.js","sourceRoot":"","sources":["../src/oauth-authorization-request-jar.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,sCAAiE;AAEpD,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD;;;;;OAKG;IACH,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,qBAAe,EAAE,uBAAiB,CAAC,CAAC;CACvD,CAAC,CAAA","sourcesContent":["import { z } from 'zod'\nimport { signedJwtSchema, unsignedJwtSchema } from '@atproto/jwk'\n\nexport const oauthAuthorizationRequestJarSchema = z.object({\n /**\n * AuthorizationRequest inside a JWT:\n * - \"iat\" is required and **MUST** be less than one minute\n *\n * @see {@link https://datatracker.ietf.org/doc/html/rfc9101}\n */\n request: z.union([signedJwtSchema, unsignedJwtSchema]),\n})\n\nexport type OAuthAuthorizationRequestJar = z.infer<\n typeof oauthAuthorizationRequestJarSchema\n>\n"]}
|
|
@@ -3,7 +3,7 @@ export declare const oauthAuthorizationRequestParSchema: z.ZodUnion<[z.ZodObject
|
|
|
3
3
|
client_id: z.ZodString;
|
|
4
4
|
state: z.ZodOptional<z.ZodString>;
|
|
5
5
|
redirect_uri: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}`, string>, `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `https://${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `${string}.${string}:/${string}`, string>]>>;
|
|
6
|
-
scope: z.ZodOptional<z.ZodString
|
|
6
|
+
scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
7
7
|
response_type: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
|
|
8
8
|
code_challenge: z.ZodOptional<z.ZodString>;
|
|
9
9
|
code_challenge_method: z.ZodOptional<z.ZodEnum<["S256", "plain"]>>;
|
|
@@ -65,8 +65,16 @@ export declare const oauthAuthorizationRequestParSchema: z.ZodUnion<[z.ZodObject
|
|
|
65
65
|
}, "strip", z.ZodTypeAny, {
|
|
66
66
|
client_id: string;
|
|
67
67
|
response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
|
68
|
-
redirect_uri?: `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | `${string}.${string}:/${string}` | undefined;
|
|
69
68
|
scope?: string | undefined;
|
|
69
|
+
redirect_uri?: `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | `${string}.${string}:/${string}` | undefined;
|
|
70
|
+
authorization_details?: {
|
|
71
|
+
type: string;
|
|
72
|
+
locations?: `${string}:${string}`[] | undefined;
|
|
73
|
+
actions?: string[] | undefined;
|
|
74
|
+
datatypes?: string[] | undefined;
|
|
75
|
+
identifier?: string | undefined;
|
|
76
|
+
privileges?: string[] | undefined;
|
|
77
|
+
}[] | undefined;
|
|
70
78
|
nonce?: string | undefined;
|
|
71
79
|
state?: string | undefined;
|
|
72
80
|
code_challenge?: string | undefined;
|
|
@@ -84,19 +92,12 @@ export declare const oauthAuthorizationRequestParSchema: z.ZodUnion<[z.ZodObject
|
|
|
84
92
|
id_token_hint?: `${string}.${string}.${string}` | undefined;
|
|
85
93
|
display?: "page" | "popup" | "touch" | "wap" | undefined;
|
|
86
94
|
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
|
87
|
-
authorization_details?: {
|
|
88
|
-
type: string;
|
|
89
|
-
locations?: `${string}:${string}`[] | undefined;
|
|
90
|
-
actions?: string[] | undefined;
|
|
91
|
-
datatypes?: string[] | undefined;
|
|
92
|
-
identifier?: string | undefined;
|
|
93
|
-
privileges?: string[] | undefined;
|
|
94
|
-
}[] | undefined;
|
|
95
95
|
}, {
|
|
96
96
|
client_id: string;
|
|
97
97
|
response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
|
98
|
-
redirect_uri?: string | undefined;
|
|
99
98
|
scope?: string | undefined;
|
|
99
|
+
redirect_uri?: string | undefined;
|
|
100
|
+
authorization_details?: unknown;
|
|
100
101
|
nonce?: string | undefined;
|
|
101
102
|
state?: string | undefined;
|
|
102
103
|
code_challenge?: string | undefined;
|
|
@@ -110,7 +111,6 @@ export declare const oauthAuthorizationRequestParSchema: z.ZodUnion<[z.ZodObject
|
|
|
110
111
|
id_token_hint?: string | undefined;
|
|
111
112
|
display?: "page" | "popup" | "touch" | "wap" | undefined;
|
|
112
113
|
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
|
113
|
-
authorization_details?: unknown;
|
|
114
114
|
}>, z.ZodObject<{
|
|
115
115
|
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>]>;
|
|
116
116
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-authorization-request-par.js","sourceRoot":"","sources":["../src/oauth-authorization-request-par.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,6FAAyF;AACzF,2GAAuG;AAE1F,QAAA,kCAAkC,GAAG,OAAC,CAAC,KAAK,CAAC;IACxD,qFAAyC;IACzC,uEAAkC;CACnC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"oauth-authorization-request-par.js","sourceRoot":"","sources":["../src/oauth-authorization-request-par.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,6FAAyF;AACzF,2GAAuG;AAE1F,QAAA,kCAAkC,GAAG,OAAC,CAAC,KAAK,CAAC;IACxD,qFAAyC;IACzC,uEAAkC;CACnC,CAAC,CAAA","sourcesContent":["import { z } from 'zod'\nimport { oauthAuthorizationRequestJarSchema } from './oauth-authorization-request-jar.js'\nimport { oauthAuthorizationRequestParametersSchema } from './oauth-authorization-request-parameters.js'\n\nexport const oauthAuthorizationRequestParSchema = z.union([\n oauthAuthorizationRequestParametersSchema,\n oauthAuthorizationRequestJarSchema,\n])\n\nexport type OAuthAuthorizationRequestPar = z.infer<\n typeof oauthAuthorizationRequestParSchema\n>\n"]}
|
|
@@ -9,7 +9,7 @@ export declare const oauthAuthorizationRequestParametersSchema: z.ZodObject<{
|
|
|
9
9
|
client_id: z.ZodString;
|
|
10
10
|
state: z.ZodOptional<z.ZodString>;
|
|
11
11
|
redirect_uri: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `http://[::1]${string}` | "http://localhost" | `http://localhost#${string}` | `http://localhost?${string}` | `http://localhost/${string}` | `http://localhost:${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}`, string>, `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `https://${string}`, string>, z.ZodEffects<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, `${string}.${string}:/${string}`, string>]>>;
|
|
12
|
-
scope: z.ZodOptional<z.ZodString
|
|
12
|
+
scope: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
13
13
|
response_type: z.ZodEnum<["code", "token", "none", "code id_token token", "code id_token", "code token", "id_token token", "id_token"]>;
|
|
14
14
|
code_challenge: z.ZodOptional<z.ZodString>;
|
|
15
15
|
code_challenge_method: z.ZodOptional<z.ZodEnum<["S256", "plain"]>>;
|
|
@@ -77,8 +77,16 @@ export declare const oauthAuthorizationRequestParametersSchema: z.ZodObject<{
|
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
78
78
|
client_id: string;
|
|
79
79
|
response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
|
80
|
-
redirect_uri?: `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | `${string}.${string}:/${string}` | undefined;
|
|
81
80
|
scope?: string | undefined;
|
|
81
|
+
redirect_uri?: `http://[::1]${string}` | "http://127.0.0.1" | `http://127.0.0.1#${string}` | `http://127.0.0.1?${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `https://${string}` | `${string}.${string}:/${string}` | undefined;
|
|
82
|
+
authorization_details?: {
|
|
83
|
+
type: string;
|
|
84
|
+
locations?: `${string}:${string}`[] | undefined;
|
|
85
|
+
actions?: string[] | undefined;
|
|
86
|
+
datatypes?: string[] | undefined;
|
|
87
|
+
identifier?: string | undefined;
|
|
88
|
+
privileges?: string[] | undefined;
|
|
89
|
+
}[] | undefined;
|
|
82
90
|
nonce?: string | undefined;
|
|
83
91
|
state?: string | undefined;
|
|
84
92
|
code_challenge?: string | undefined;
|
|
@@ -96,19 +104,12 @@ export declare const oauthAuthorizationRequestParametersSchema: z.ZodObject<{
|
|
|
96
104
|
id_token_hint?: `${string}.${string}.${string}` | undefined;
|
|
97
105
|
display?: "page" | "popup" | "touch" | "wap" | undefined;
|
|
98
106
|
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
|
99
|
-
authorization_details?: {
|
|
100
|
-
type: string;
|
|
101
|
-
locations?: `${string}:${string}`[] | undefined;
|
|
102
|
-
actions?: string[] | undefined;
|
|
103
|
-
datatypes?: string[] | undefined;
|
|
104
|
-
identifier?: string | undefined;
|
|
105
|
-
privileges?: string[] | undefined;
|
|
106
|
-
}[] | undefined;
|
|
107
107
|
}, {
|
|
108
108
|
client_id: string;
|
|
109
109
|
response_type: "code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token";
|
|
110
|
-
redirect_uri?: string | undefined;
|
|
111
110
|
scope?: string | undefined;
|
|
111
|
+
redirect_uri?: string | undefined;
|
|
112
|
+
authorization_details?: unknown;
|
|
112
113
|
nonce?: string | undefined;
|
|
113
114
|
state?: string | undefined;
|
|
114
115
|
code_challenge?: string | undefined;
|
|
@@ -122,7 +123,6 @@ export declare const oauthAuthorizationRequestParametersSchema: z.ZodObject<{
|
|
|
122
123
|
id_token_hint?: string | undefined;
|
|
123
124
|
display?: "page" | "popup" | "touch" | "wap" | undefined;
|
|
124
125
|
prompt?: "none" | "login" | "consent" | "select_account" | undefined;
|
|
125
|
-
authorization_details?: unknown;
|
|
126
126
|
}>;
|
|
127
127
|
/**
|
|
128
128
|
* @see {oauthAuthorizationRequestParametersSchema}
|