@atproto/oauth-provider 0.25.6 → 0.27.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/CHANGELOG.md +79 -0
- package/dist/account/account-manager.d.ts +5 -11
- package/dist/account/account-manager.d.ts.map +1 -1
- package/dist/account/account-manager.js +17 -59
- package/dist/account/account-manager.js.map +1 -1
- package/dist/account/account-store.d.ts +2 -8
- package/dist/account/account-store.d.ts.map +1 -1
- package/dist/account/account-store.js.map +1 -1
- package/dist/errors/captcha-rejected-error.d.ts +12 -0
- package/dist/errors/captcha-rejected-error.d.ts.map +1 -0
- package/dist/errors/captcha-rejected-error.js +18 -0
- package/dist/errors/captcha-rejected-error.js.map +1 -0
- package/dist/errors/captcha-required-error.d.ts +9 -0
- package/dist/errors/captcha-required-error.d.ts.map +1 -0
- package/dist/errors/captcha-required-error.js +11 -0
- package/dist/errors/captcha-required-error.js.map +1 -0
- package/dist/errors/oauth-error.d.ts +1 -0
- package/dist/errors/oauth-error.d.ts.map +1 -1
- package/dist/errors/oauth-error.js +3 -0
- package/dist/errors/oauth-error.js.map +1 -1
- package/dist/errors/rate-limit-exceeded-error.d.ts +12 -0
- package/dist/errors/rate-limit-exceeded-error.d.ts.map +1 -0
- package/dist/errors/rate-limit-exceeded-error.js +14 -0
- package/dist/errors/rate-limit-exceeded-error.js.map +1 -0
- package/dist/errors/www-authenticate-error.d.ts +1 -0
- package/dist/errors/www-authenticate-error.d.ts.map +1 -1
- package/dist/errors/www-authenticate-error.js +4 -0
- package/dist/errors/www-authenticate-error.js.map +1 -1
- package/dist/hcaptcha/hcaptcha-client-tokens.d.ts +7 -0
- package/dist/hcaptcha/hcaptcha-client-tokens.d.ts.map +1 -0
- package/dist/hcaptcha/hcaptcha-client-tokens.js +2 -0
- package/dist/hcaptcha/hcaptcha-client-tokens.js.map +1 -0
- package/dist/hcaptcha/hcaptcha-manager.d.ts +23 -0
- package/dist/hcaptcha/hcaptcha-manager.d.ts.map +1 -0
- package/dist/hcaptcha/hcaptcha-manager.js +83 -0
- package/dist/hcaptcha/hcaptcha-manager.js.map +1 -0
- package/dist/hcaptcha/hcaptcha-verify-data.d.ts +15 -0
- package/dist/hcaptcha/hcaptcha-verify-data.d.ts.map +1 -0
- package/dist/hcaptcha/hcaptcha-verify-data.js +2 -0
- package/dist/hcaptcha/hcaptcha-verify-data.js.map +1 -0
- package/dist/lib/hcaptcha.d.ts +5 -11
- package/dist/lib/hcaptcha.d.ts.map +1 -1
- package/dist/lib/hcaptcha.js +12 -20
- package/dist/lib/hcaptcha.js.map +1 -1
- package/dist/lib/http/response.d.ts +1 -1
- package/dist/lib/http/response.d.ts.map +1 -1
- package/dist/lib/http/response.js +15 -17
- package/dist/lib/http/response.js.map +1 -1
- package/dist/lib/identifier.d.ts +3 -0
- package/dist/lib/identifier.d.ts.map +1 -0
- package/dist/lib/identifier.js +4 -0
- package/dist/lib/identifier.js.map +1 -0
- package/dist/lib/redis.d.ts.map +1 -1
- package/dist/lib/redis.js +7 -1
- package/dist/lib/redis.js.map +1 -1
- package/dist/oauth-errors.d.ts +3 -0
- package/dist/oauth-errors.d.ts.map +1 -1
- package/dist/oauth-errors.js +3 -0
- package/dist/oauth-errors.js.map +1 -1
- package/dist/oauth-hooks.d.ts +16 -14
- package/dist/oauth-hooks.d.ts.map +1 -1
- package/dist/oauth-hooks.js.map +1 -1
- package/dist/oauth-provider.d.ts +26 -7
- package/dist/oauth-provider.d.ts.map +1 -1
- package/dist/oauth-provider.js +28 -48
- package/dist/oauth-provider.js.map +1 -1
- package/dist/rate-limit/rate-limit-manager.d.ts +39 -0
- package/dist/rate-limit/rate-limit-manager.d.ts.map +1 -0
- package/dist/rate-limit/rate-limit-manager.js +99 -0
- package/dist/rate-limit/rate-limit-manager.js.map +1 -0
- package/dist/rate-limit/rate-limit-policies.d.ts +108 -0
- package/dist/rate-limit/rate-limit-policies.d.ts.map +1 -0
- package/dist/rate-limit/rate-limit-policies.js +90 -0
- package/dist/rate-limit/rate-limit-policies.js.map +1 -0
- package/dist/rate-limit/rate-limiter.d.ts +36 -0
- package/dist/rate-limit/rate-limiter.d.ts.map +1 -0
- package/dist/rate-limit/rate-limiter.js +2 -0
- package/dist/rate-limit/rate-limiter.js.map +1 -0
- package/dist/router/assets/send-error-page.d.ts.map +1 -1
- package/dist/router/assets/send-error-page.js +3 -2
- package/dist/router/assets/send-error-page.js.map +1 -1
- package/dist/router/create-api-middleware.d.ts.map +1 -1
- package/dist/router/create-api-middleware.js +72 -15
- package/dist/router/create-api-middleware.js.map +1 -1
- package/dist/router/create-authorization-page-middleware.d.ts.map +1 -1
- package/dist/router/create-authorization-page-middleware.js +18 -17
- package/dist/router/create-authorization-page-middleware.js.map +1 -1
- package/dist/router/create-oauth-middleware.d.ts.map +1 -1
- package/dist/router/create-oauth-middleware.js +9 -8
- package/dist/router/create-oauth-middleware.js.map +1 -1
- package/dist/types/email.d.ts +2 -1
- package/dist/types/email.d.ts.map +1 -1
- package/dist/types/email.js.map +1 -1
- package/dist/types/indentifier.d.ts +2 -3
- package/dist/types/indentifier.d.ts.map +1 -1
- package/dist/types/indentifier.js.map +1 -1
- package/package.json +17 -17
- package/dist/account/sign-in-data.d.ts +0 -22
- package/dist/account/sign-in-data.d.ts.map +0 -1
- package/dist/account/sign-in-data.js +0 -15
- package/dist/account/sign-in-data.js.map +0 -1
- package/dist/account/sign-up-input.d.ts +0 -28
- package/dist/account/sign-up-input.d.ts.map +0 -1
- package/dist/account/sign-up-input.js +0 -19
- package/dist/account/sign-up-input.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/lib/http/response.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,eAAe,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAGvD,MAAM,UAAU,aAAa,CA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AAC,EAAE,CAAC;YAC1D,OAAO,KAAK,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAC,CAAA;QAClE,CAAC;QAED,wEAAwE;QACxE,yBAAyB;QACzB,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,IAAI,CAAC;gBACH,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACzD,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,YAAY,CAAA;gBACvD,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,CAAA;YAC9C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC,CAAA;YACrD,CAAC;QACH,CAAC,CAAC,EAAE,CAAA;IACN,CAAC,CAAA;AACH,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAE,OAAe;IAC9C,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;AACvE,CAAC","sourcesContent":["import type { IncomingMessage, ServerResponse } from 'node:http'\nimport { type Readable, pipeline } from 'node:stream'\nimport createHttpError from 'http-errors'\nimport type { Awaitable } from '../util/type.js'\nimport { negotiateResponseContent } from './request.js'\nimport type { Handler, Middleware } from './types.js'\n\nexport function writeRedirect(\n res: ServerResponse,\n url: string,\n status = 302,\n): void {\n res.writeHead(status, { Location: url }).end()\n}\n\nexport type WriteResponseOptions = {\n status?: number\n contentType?: string\n onError?: (err: NodeJS.ErrnoException) => void\n}\n\nexport function writeStream(\n res: ServerResponse,\n stream: Readable,\n {\n status = 200,\n contentType = 'application/octet-stream',\n onError,\n }: WriteResponseOptions = {},\n): void {\n res.statusCode = status\n res.setHeader('content-type', contentType)\n\n if (res.req.method === 'HEAD') {\n res.end()\n stream.destroy()\n } else {\n pipeline([stream, res], (err) => {\n if (err) onError?.(err)\n })\n }\n}\n\nexport function writeBuffer(\n res: ServerResponse,\n chunk: string | Buffer,\n opts: WriteResponseOptions,\n): void {\n if (opts?.status != null) res.statusCode = opts.status\n res.setHeader('content-type', opts?.contentType || 'application/octet-stream')\n res.end(chunk)\n}\n\nexport function toJsonBuffer(value: unknown): Buffer {\n try {\n return Buffer.from(JSON.stringify(value))\n } catch (cause) {\n throw new Error(`Failed to serialize as JSON`, { cause })\n }\n}\n\nexport function writeJson(\n res: ServerResponse,\n payload: unknown,\n { contentType = 'application/json', ...options }: WriteResponseOptions = {},\n): void {\n const buffer = toJsonBuffer(payload)\n writeBuffer(res, buffer, { ...options, contentType })\n}\n\nexport function staticJsonMiddleware(\n value: unknown,\n { contentType = 'application/json', ...options }: WriteResponseOptions = {},\n): Handler<unknown> {\n const buffer = toJsonBuffer(value)\n const staticOptions: WriteResponseOptions = { ...options, contentType }\n return function (req, res) {\n writeBuffer(res, buffer, staticOptions)\n }\n}\n\nexport function cacheControlMiddleware(maxAge: number): Middleware<void> {\n const header = `max-age=${maxAge}`\n return function (req, res, next) {\n res.setHeader('Cache-Control', header)\n next()\n }\n}\n\nexport type JsonResponse<P = unknown> = WriteResponseOptions & {\n json: P\n}\n\nexport function jsonHandler<\n T,\n Req extends IncomingMessage = IncomingMessage,\n Res extends ServerResponse = ServerResponse,\n>(\n buildJson: (this: T, req: Req, res: Res) => Awaitable<JsonResponse>,\n supportedContentTypes: string[] = ['application/json'],\n): Middleware<T, Req, Res> {\n return function (req, res, next) {\n // Ensure we can agree on a content encoding & type before starting to\n // build the JSON response.\n if (!negotiateResponseContent(req, supportedContentTypes)) {\n return void next(createHttpError(406, 'Unsupported media type'))\n }\n\n // A middleware should not be async, so we wrap the async operation in a\n // promise and return it.\n void (async () => {\n try {\n const jsonResponse = await buildJson.call(this, req, res)\n const { json, status = 200, ...options } = jsonResponse\n writeJson(res, json, { ...options, status })\n } catch (err) {\n next(asError(err, 'Failed to build JSON response'))\n }\n })()\n }\n}\n\nfunction asError(cause: unknown, message: string): Error {\n return cause instanceof Error ? cause : new Error(message, { cause })\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../src/lib/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,gBAAgB,GAC3B,gBAAgB,CAElB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../src/lib/identifier.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,yBAAyB,CACvC,UAA4B;IAE5B,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAqB,CAAA;AAC/E,CAAC","sourcesContent":["import type { IdentifierString } from '@atproto/oauth-provider-api'\n\nexport function normalizeIdentifierString(\n identifier: IdentifierString,\n): IdentifierString {\n return identifier.trim().toLowerCase().replace(/^@/g, '') as IdentifierString\n}\n"]}
|
package/dist/lib/redis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAElD,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;AAEnC,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAElD,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;AAEnC,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,CAAA;AAQ9D,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,KAAK,CAmB9D"}
|
package/dist/lib/redis.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Redis } from 'ioredis';
|
|
2
|
+
// @TODO Pins ioredis 5's wire behavior (RESP2, no CLIENT SETINFO on connect)
|
|
3
|
+
// so the ioredis 6 upgrade changes nothing for callers' Redis servers (Redis
|
|
4
|
+
// < 7.2 rejects CLIENT SETINFO). Callers can override it through RedisOptions.
|
|
5
|
+
// Drop this to use ioredis 6's defaults in the next breaking release.
|
|
6
|
+
const REDIS_DEFAULTS = { protocol: 2, disableClientInfo: true };
|
|
2
7
|
export function createRedis(options) {
|
|
3
8
|
if (typeof options === 'string') {
|
|
4
9
|
const url = new URL(options.startsWith('redis://') ? options : `redis://${options}`);
|
|
5
10
|
return new Redis({
|
|
11
|
+
...REDIS_DEFAULTS,
|
|
6
12
|
host: url.hostname,
|
|
7
13
|
port: parseInt(url.port, 10),
|
|
8
14
|
password: url.password,
|
|
@@ -14,7 +20,7 @@ export function createRedis(options) {
|
|
|
14
20
|
return options;
|
|
15
21
|
}
|
|
16
22
|
else {
|
|
17
|
-
return new Redis(options);
|
|
23
|
+
return new Redis({ ...REDIS_DEFAULTS, ...options });
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
//# sourceMappingURL=redis.js.map
|
package/dist/lib/redis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,SAAS,CAAA;AAMlD,MAAM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C,QAAQ;YAClB,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC,CAAA;IACJ,CAAC;SAAM,IAAI,IAAI,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;QACpE,4EAA4E;QAC5E,+DAA+D;QAC/D,OAAO,OAAO,CAAA;IAChB,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,KAAK,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IACrD,CAAC;AACH,CAAC","sourcesContent":["import { Redis, type RedisOptions } from 'ioredis'\n\nexport type { Redis, RedisOptions }\n\nexport type CreateRedisOptions = Redis | RedisOptions | string\n\n// @TODO Pins ioredis 5's wire behavior (RESP2, no CLIENT SETINFO on connect)\n// so the ioredis 6 upgrade changes nothing for callers' Redis servers (Redis\n// < 7.2 rejects CLIENT SETINFO). Callers can override it through RedisOptions.\n// Drop this to use ioredis 6's defaults in the next breaking release.\nconst REDIS_DEFAULTS = { protocol: 2, disableClientInfo: true } as const\n\nexport function createRedis(options: CreateRedisOptions): Redis {\n if (typeof options === 'string') {\n const url = new URL(\n options.startsWith('redis://') ? options : `redis://${options}`,\n )\n\n return new Redis({\n ...REDIS_DEFAULTS,\n host: url.hostname,\n port: parseInt(url.port, 10),\n password: url.password,\n })\n } else if ('on' in options && 'call' in options && 'acl' in options) {\n // Not using \"instanceof\" here in case the options is an instance of another\n // version of ioredis (Redis is both a class and an interface).\n return options\n } else {\n return new Redis({ ...REDIS_DEFAULTS, ...options })\n }\n}\n"]}
|
package/dist/oauth-errors.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './errors/handle-unavailable-error.js';
|
|
|
3
3
|
export * from './errors/access-denied-error.js';
|
|
4
4
|
export * from './errors/account-selection-required-error.js';
|
|
5
5
|
export * from './errors/authorization-error.js';
|
|
6
|
+
export * from './errors/captcha-rejected-error.js';
|
|
7
|
+
export * from './errors/captcha-required-error.js';
|
|
6
8
|
export * from './errors/consent-required-error.js';
|
|
7
9
|
export * from './errors/invalid-authorization-details-error.js';
|
|
8
10
|
export * from './errors/invalid-client-error.js';
|
|
@@ -17,6 +19,7 @@ export * from './errors/invalid-request-error.js';
|
|
|
17
19
|
export * from './errors/invalid-scope-error.js';
|
|
18
20
|
export * from './errors/invalid-token-error.js';
|
|
19
21
|
export * from './errors/login-required-error.js';
|
|
22
|
+
export * from './errors/rate-limit-exceeded-error.js';
|
|
20
23
|
export * from './errors/second-authentication-factor-required-error.js';
|
|
21
24
|
export * from './errors/unauthorized-client-error.js';
|
|
22
25
|
export * from './errors/use-dpop-nonce-error.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-errors.d.ts","sourceRoot":"","sources":["../src/oauth-errors.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAGvC,cAAc,sCAAsC,CAAA;AAGpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,8CAA8C,CAAA;AAC5D,cAAc,iCAAiC,CAAA;AAC/C,cAAc,oCAAoC,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2CAA2C,CAAA;AACzD,cAAc,uCAAuC,CAAA;AACrD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA;AACtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,yDAAyD,CAAA;AACvE,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA"}
|
|
1
|
+
{"version":3,"file":"oauth-errors.d.ts","sourceRoot":"","sources":["../src/oauth-errors.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAGvC,cAAc,sCAAsC,CAAA;AAGpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,8CAA8C,CAAA;AAC5D,cAAc,iCAAiC,CAAA;AAC/C,cAAc,oCAAoC,CAAA;AAClD,cAAc,oCAAoC,CAAA;AAClD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2CAA2C,CAAA;AACzD,cAAc,uCAAuC,CAAA;AACrD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA;AACtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uCAAuC,CAAA;AACrD,cAAc,yDAAyD,CAAA;AACvE,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA"}
|
package/dist/oauth-errors.js
CHANGED
|
@@ -5,6 +5,8 @@ export * from './errors/handle-unavailable-error.js';
|
|
|
5
5
|
export * from './errors/access-denied-error.js';
|
|
6
6
|
export * from './errors/account-selection-required-error.js';
|
|
7
7
|
export * from './errors/authorization-error.js';
|
|
8
|
+
export * from './errors/captcha-rejected-error.js';
|
|
9
|
+
export * from './errors/captcha-required-error.js';
|
|
8
10
|
export * from './errors/consent-required-error.js';
|
|
9
11
|
export * from './errors/invalid-authorization-details-error.js';
|
|
10
12
|
export * from './errors/invalid-client-error.js';
|
|
@@ -19,6 +21,7 @@ export * from './errors/invalid-request-error.js';
|
|
|
19
21
|
export * from './errors/invalid-scope-error.js';
|
|
20
22
|
export * from './errors/invalid-token-error.js';
|
|
21
23
|
export * from './errors/login-required-error.js';
|
|
24
|
+
export * from './errors/rate-limit-exceeded-error.js';
|
|
22
25
|
export * from './errors/second-authentication-factor-required-error.js';
|
|
23
26
|
export * from './errors/unauthorized-client-error.js';
|
|
24
27
|
export * from './errors/use-dpop-nonce-error.js';
|
package/dist/oauth-errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-errors.js","sourceRoot":"","sources":["../src/oauth-errors.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC,YAAY;AACZ,cAAc,sCAAsC,CAAA;AAEpD,yBAAyB;AACzB,cAAc,iCAAiC,CAAA;AAC/C,cAAc,8CAA8C,CAAA;AAC5D,cAAc,iCAAiC,CAAA;AAC/C,cAAc,oCAAoC,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2CAA2C,CAAA;AACzD,cAAc,uCAAuC,CAAA;AACrD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA;AACtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,yDAAyD,CAAA;AACvE,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA","sourcesContent":["export * from './errors/oauth-error.js'\n\n// API error\nexport * from './errors/handle-unavailable-error.js'\n\n// OAuthError sub-classes\nexport * from './errors/access-denied-error.js'\nexport * from './errors/account-selection-required-error.js'\nexport * from './errors/authorization-error.js'\nexport * from './errors/consent-required-error.js'\nexport * from './errors/invalid-authorization-details-error.js'\nexport * from './errors/invalid-client-error.js'\nexport * from './errors/invalid-client-id-error.js'\nexport * from './errors/invalid-client-metadata-error.js'\nexport * from './errors/invalid-credentials-error.js'\nexport * from './errors/invalid-dpop-key-binding-error.js'\nexport * from './errors/invalid-dpop-proof-error.js'\nexport * from './errors/invalid-grant-error.js'\nexport * from './errors/invalid-redirect-uri-error.js'\nexport * from './errors/invalid-request-error.js'\nexport * from './errors/invalid-scope-error.js'\nexport * from './errors/invalid-token-error.js'\nexport * from './errors/login-required-error.js'\nexport * from './errors/second-authentication-factor-required-error.js'\nexport * from './errors/unauthorized-client-error.js'\nexport * from './errors/use-dpop-nonce-error.js'\nexport * from './errors/www-authenticate-error.js'\n"]}
|
|
1
|
+
{"version":3,"file":"oauth-errors.js","sourceRoot":"","sources":["../src/oauth-errors.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC,YAAY;AACZ,cAAc,sCAAsC,CAAA;AAEpD,yBAAyB;AACzB,cAAc,iCAAiC,CAAA;AAC/C,cAAc,8CAA8C,CAAA;AAC5D,cAAc,iCAAiC,CAAA;AAC/C,cAAc,oCAAoC,CAAA;AAClD,cAAc,oCAAoC,CAAA;AAClD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2CAA2C,CAAA;AACzD,cAAc,uCAAuC,CAAA;AACrD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA;AACtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uCAAuC,CAAA;AACrD,cAAc,yDAAyD,CAAA;AACvE,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA","sourcesContent":["export * from './errors/oauth-error.js'\n\n// API error\nexport * from './errors/handle-unavailable-error.js'\n\n// OAuthError sub-classes\nexport * from './errors/access-denied-error.js'\nexport * from './errors/account-selection-required-error.js'\nexport * from './errors/authorization-error.js'\nexport * from './errors/captcha-rejected-error.js'\nexport * from './errors/captcha-required-error.js'\nexport * from './errors/consent-required-error.js'\nexport * from './errors/invalid-authorization-details-error.js'\nexport * from './errors/invalid-client-error.js'\nexport * from './errors/invalid-client-id-error.js'\nexport * from './errors/invalid-client-metadata-error.js'\nexport * from './errors/invalid-credentials-error.js'\nexport * from './errors/invalid-dpop-key-binding-error.js'\nexport * from './errors/invalid-dpop-proof-error.js'\nexport * from './errors/invalid-grant-error.js'\nexport * from './errors/invalid-redirect-uri-error.js'\nexport * from './errors/invalid-request-error.js'\nexport * from './errors/invalid-scope-error.js'\nexport * from './errors/invalid-token-error.js'\nexport * from './errors/login-required-error.js'\nexport * from './errors/rate-limit-exceeded-error.js'\nexport * from './errors/second-authentication-factor-required-error.js'\nexport * from './errors/unauthorized-client-error.js'\nexport * from './errors/use-dpop-nonce-error.js'\nexport * from './errors/www-authenticate-error.js'\n"]}
|
package/dist/oauth-hooks.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { Did } from '@atproto/did';
|
|
2
2
|
import type { Jwks } from '@atproto/jwk';
|
|
3
|
-
import type { Account } from '@atproto/oauth-provider-api';
|
|
3
|
+
import type { Account, SignInInput, SignUpInput } from '@atproto/oauth-provider-api';
|
|
4
4
|
import type { OAuthAccessToken, OAuthAuthorizationDetails, OAuthAuthorizationRequestParameters, OAuthClientMetadata, OAuthTokenResponse, OAuthTokenType } from '@atproto/oauth-types';
|
|
5
|
-
import type { DeleteAccountConfirmInput, DeviceAccount, DisableEmailAuthFactorInput, EnableEmailAuthFactorInput, ResetPasswordConfirmInput, ResetPasswordRequestInput,
|
|
6
|
-
import type { SignInData } from './account/sign-in-data.js';
|
|
7
|
-
import type { SignUpInput } from './account/sign-up-input.js';
|
|
5
|
+
import type { DeleteAccountConfirmInput, DeviceAccount, DisableEmailAuthFactorInput, EnableEmailAuthFactorInput, ResetPasswordConfirmInput, ResetPasswordRequestInput, UpdateEmailConfirmInput, UpdateEmailRequestInput, UpdateHandleData, VerifyEmailConfirmInput, VerifyEmailRequestInput } from './account/account-store.js';
|
|
8
6
|
import type { ClientAuth } from './client/client-auth.js';
|
|
9
7
|
import type { ClientId } from './client/client-id.js';
|
|
10
8
|
import type { ClientInfo } from './client/client-info.js';
|
|
@@ -12,13 +10,15 @@ import type { Client } from './client/client.js';
|
|
|
12
10
|
import type { DeviceId } from './device/device-id.js';
|
|
13
11
|
import type { DpopProof } from './dpop/dpop-proof.js';
|
|
14
12
|
import type { InvalidRequestError } from './errors/invalid-request-error.js';
|
|
15
|
-
import type { HcaptchaClientTokens
|
|
13
|
+
import type { HcaptchaClientTokens } from './hcaptcha/hcaptcha-client-tokens.js';
|
|
14
|
+
import type { HcaptchaVerifyData } from './hcaptcha/hcaptcha-verify-data.js';
|
|
15
|
+
import type { HcaptchaConfig, HcaptchaVerifyResult } from './lib/hcaptcha.js';
|
|
16
16
|
import type { RequestMetadata } from './lib/http/request.js';
|
|
17
17
|
import type { Awaitable, OmitKey } from './lib/util/type.js';
|
|
18
18
|
import type { RequestId } from './request/request-id.js';
|
|
19
19
|
import type { AccessTokenPayload } from './signer/access-token-payload.js';
|
|
20
20
|
import type { TokenClaims } from './token/token-claims.js';
|
|
21
|
-
export type { AccessTokenPayload, Account, Awaitable, Client, ClientAuth, ClientId, ClientInfo, DeviceId, Did, DpopProof, HcaptchaClientTokens, HcaptchaConfig, HcaptchaVerifyResult, Jwks, OAuthAccessToken, OAuthAuthorizationDetails, OAuthAuthorizationRequestParameters, OAuthClientMetadata, OAuthTokenResponse, OAuthTokenType, RequestMetadata, ResetPasswordConfirmInput, ResetPasswordRequestInput,
|
|
21
|
+
export type { AccessTokenPayload, Account, Awaitable, Client, ClientAuth, ClientId, ClientInfo, DeviceId, Did, DpopProof, HcaptchaClientTokens, HcaptchaConfig, HcaptchaVerifyData, HcaptchaVerifyResult, Jwks, OAuthAccessToken, OAuthAuthorizationDetails, OAuthAuthorizationRequestParameters, OAuthClientMetadata, OAuthTokenResponse, OAuthTokenType, RequestMetadata, ResetPasswordConfirmInput, ResetPasswordRequestInput, SignInInput, SignUpInput, TokenClaims, UpdateHandleData, };
|
|
22
22
|
export type OAuthHooks = {
|
|
23
23
|
/**
|
|
24
24
|
* Use this to alter, override or validate the client metadata & jwks returned
|
|
@@ -280,11 +280,13 @@ export type OAuthHooks = {
|
|
|
280
280
|
clientId: ClientId | undefined;
|
|
281
281
|
}) => Awaitable<void>;
|
|
282
282
|
/**
|
|
283
|
-
* This hook is called
|
|
284
|
-
* `/siteverify` request has been made (and before the result is
|
|
283
|
+
* This hook is called whenever an hCaptcha token is verified, after the
|
|
284
|
+
* hcaptcha `/siteverify` request has been made (and before the result is
|
|
285
|
+
* validated). By default, this happens on every sign-up, and on sign-in and
|
|
286
|
+
* password reset requests and confirmations once a captcha tier rate limit
|
|
287
|
+
* was exceeded.
|
|
285
288
|
*/
|
|
286
|
-
onHcaptchaResult?: (data: {
|
|
287
|
-
input: SignUpInput;
|
|
289
|
+
onHcaptchaResult?: (data: HcaptchaVerifyData & {
|
|
288
290
|
deviceId: DeviceId;
|
|
289
291
|
deviceMetadata: RequestMetadata;
|
|
290
292
|
tokens: HcaptchaClientTokens;
|
|
@@ -336,7 +338,7 @@ export type OAuthHooks = {
|
|
|
336
338
|
* @throws {AccessDeniedError} to deny the sign-up
|
|
337
339
|
*/
|
|
338
340
|
onSignedUp?: (data: {
|
|
339
|
-
|
|
341
|
+
input: SignUpInput;
|
|
340
342
|
account: Account;
|
|
341
343
|
deviceId: DeviceId;
|
|
342
344
|
deviceMetadata: RequestMetadata;
|
|
@@ -349,7 +351,7 @@ export type OAuthHooks = {
|
|
|
349
351
|
* authorization flow.
|
|
350
352
|
*/
|
|
351
353
|
onSignInAttempt?: (data: {
|
|
352
|
-
|
|
354
|
+
input: SignInInput;
|
|
353
355
|
deviceId: DeviceId;
|
|
354
356
|
deviceMetadata: RequestMetadata;
|
|
355
357
|
deviceAccounts: readonly DeviceAccount[];
|
|
@@ -364,7 +366,7 @@ export type OAuthHooks = {
|
|
|
364
366
|
* @throws {InvalidRequestError} when the sign-in should be denied
|
|
365
367
|
*/
|
|
366
368
|
onSignedIn?: (data: {
|
|
367
|
-
|
|
369
|
+
input: SignInInput;
|
|
368
370
|
account: Account;
|
|
369
371
|
remembered: boolean;
|
|
370
372
|
deviceId: DeviceId;
|
|
@@ -390,7 +392,7 @@ export type OAuthHooks = {
|
|
|
390
392
|
* processed further.
|
|
391
393
|
*/
|
|
392
394
|
onSignInFailed?: (data: {
|
|
393
|
-
|
|
395
|
+
input: SignInInput;
|
|
394
396
|
error: InvalidRequestError;
|
|
395
397
|
did: Did | null;
|
|
396
398
|
deviceId: DeviceId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-hooks.d.ts","sourceRoot":"","sources":["../src/oauth-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"oauth-hooks.d.ts","sourceRoot":"","sources":["../src/oauth-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,WAAW,EACZ,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,mCAAmC,EACnC,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACb,2BAA2B,EAC3B,0BAA0B,EAC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E,CAAC,IAAI,EAAE;QACrB,SAAS,EAAE,cAAc,CAAA;QACzB,KAAK,EAAE,gBAAgB,CAAA;QACvB,OAAO,EAAE,kBAAkB,CAAA;QAC3B,SAAS,EAAE,IAAI,GAAG,SAAS,CAAA;KAC5B,KAAK,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;IAExC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE;QACtB,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,EAAE,UAAU,CAAA;QACtB,cAAc,EAAE,eAAe,CAAA;QAC/B,OAAO,EAAE,OAAO,CAAA;QAChB,UAAU,EAAE,mCAAmC,CAAA;KAChD,KAAK,SAAS,CAAC,IAAI,CAAC,CAAA;IAErB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE;QACxB,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,EAAE,UAAU,CAAA;QACtB,cAAc,EAAE,eAAe,CAAA;QAC/B,OAAO,EAAE,OAAO,CAAA;QAChB,UAAU,EAAE,mCAAmC,CAAA;KAChD,KAAK,SAAS,CAAC,IAAI,CAAC,CAAA;CACtB,CAAA"}
|
package/dist/oauth-hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-hooks.js","sourceRoot":"","sources":["../src/oauth-hooks.ts"],"names":[],"mappings":"","sourcesContent":["import type { Did } from '@atproto/did'\nimport type { Jwks } from '@atproto/jwk'\nimport type { Account } from '@atproto/oauth-provider-api'\nimport type {\n OAuthAccessToken,\n OAuthAuthorizationDetails,\n OAuthAuthorizationRequestParameters,\n OAuthClientMetadata,\n OAuthTokenResponse,\n OAuthTokenType,\n} from '@atproto/oauth-types'\nimport type {\n DeleteAccountConfirmInput,\n DeviceAccount,\n DisableEmailAuthFactorInput,\n EnableEmailAuthFactorInput,\n ResetPasswordConfirmInput,\n ResetPasswordRequestInput,\n SignUpData,\n UpdateEmailConfirmInput,\n UpdateEmailRequestInput,\n UpdateHandleData,\n VerifyEmailConfirmInput,\n VerifyEmailRequestInput,\n} from './account/account-store.js'\nimport type { SignInData } from './account/sign-in-data.js'\nimport type { SignUpInput } from './account/sign-up-input.js'\nimport type { ClientAuth } from './client/client-auth.js'\nimport type { ClientId } from './client/client-id.js'\nimport type { ClientInfo } from './client/client-info.js'\nimport type { Client } from './client/client.js'\nimport type { DeviceId } from './device/device-id.js'\nimport type { DpopProof } from './dpop/dpop-proof.js'\nimport type { InvalidRequestError } from './errors/invalid-request-error.js'\nimport type {\n HcaptchaClientTokens,\n HcaptchaConfig,\n HcaptchaVerifyResult,\n} from './lib/hcaptcha.js'\nimport type { RequestMetadata } from './lib/http/request.js'\nimport type { Awaitable, OmitKey } from './lib/util/type.js'\nimport type { RequestId } from './request/request-id.js'\nimport type { AccessTokenPayload } from './signer/access-token-payload.js'\nimport type { TokenClaims } from './token/token-claims.js'\n\n// Make sure all types needed to implement the OAuthHooks are exported\nexport type {\n AccessTokenPayload,\n Account,\n Awaitable,\n Client,\n ClientAuth,\n ClientId,\n ClientInfo,\n DeviceId,\n Did,\n DpopProof,\n HcaptchaClientTokens,\n HcaptchaConfig,\n HcaptchaVerifyResult,\n Jwks,\n OAuthAccessToken,\n OAuthAuthorizationDetails,\n OAuthAuthorizationRequestParameters,\n OAuthClientMetadata,\n OAuthTokenResponse,\n OAuthTokenType,\n RequestMetadata,\n ResetPasswordConfirmInput,\n ResetPasswordRequestInput,\n SignInData,\n SignUpData,\n SignUpInput,\n TokenClaims,\n UpdateHandleData,\n}\n\nexport type OAuthHooks = {\n /**\n * Use this to alter, override or validate the client metadata & jwks returned\n * by the client store.\n *\n * @throws {InvalidClientMetadataError} if the metadata is invalid\n * @see {@link InvalidClientMetadataError}\n */\n getClientInfo?: (\n clientId: ClientId,\n data: {\n metadata: OAuthClientMetadata\n jwks: Jwks | undefined\n },\n ) => Awaitable<undefined | Partial<ClientInfo>>\n\n /**\n * This hook is called when a user requests an email change, before the email\n * change request is triggered on the account store. Only triggered with\n * authenticated sessions, so the `account` is always available.\n */\n onChangeEmailRequest?: (data: {\n input: UpdateEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user requests an email change, and the email\n * change request was successfully triggered on the account store.\n */\n onChangeEmailRequested?: (data: {\n input: UpdateEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms an email change, before the email\n * change is actually confirmed on the account store. Only triggered with\n * authenticated sessions, so the `account` is always available.\n */\n onUpdateEmailConfirm?: (data: {\n input: UpdateEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user confirms an email change, and the email\n * change was successfully confirmed on the account store.\n */\n onUpdateEmailConfirmed?: (data: {\n input: UpdateEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n prevAccount: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests an email verification, before the\n * verification request is triggered on the account store. Only triggered with\n * authenticated sessions, so the `account` is always available.\n */\n onVerifyEmailRequest?: (data: {\n input: VerifyEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user requests an email verification, and the\n * verification request was successfully triggered on the account store.\n */\n onVerifyEmailRequested?: (data: {\n input: VerifyEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms an email verification, before the\n * verification is actually confirmed on the account store. Only triggered\n * with authenticated sessions, so the `account` is always available.\n */\n onVerifyEmailConfirm?: (data: {\n input: VerifyEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user confirms an email verification, and the\n * verification was successfully confirmed on the account store.\n */\n onVerifyEmailConfirmed?: (data: {\n input: VerifyEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called whenever a user is trying to enable their email auth\n * factor (OTP), before the change is saved to the account store.\n */\n onEnableEmailAuthFactor?: (data: {\n input: EnableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called only after the email auth factor was actually enabled\n * on the account store. This follows\n * {@link OAuthHooks.onEnableEmailAuthFactor} and is triggered only if the\n * change succeeded and actually occurred.\n */\n onEnabledEmailAuthFactor?: (data: {\n input: EnableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests that their email auth factor (OTP)\n * be disabled, before the change is saved to the account store.\n *\n * @note Disabling is two-phase:\n * - First no {@link DisableEmailAuthFactorInput.token} is provided and the\n * store implementation is expected to trigger an email confirmation. When\n * that happens, {@link OAuthHooks.onDisabledEmailAuthFactor} will not be\n * called during the processing of the first HTTP request.\n * - In the second request, which follows the email confirmation, the\n * {@link DisableEmailAuthFactorInput.token} is provided and the store\n * implementation is expected to actually disable the email auth factor. At\n * this point, {@link OAuthHooks.onDisabledEmailAuthFactor} will be called\n * after the store has successfully processed the request.\n */\n onDisableEmailAuthFactor?: (data: {\n input: DisableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called only after the email auth factor was actually disabled\n * on the account store. This follows\n * {@link OAuthHooks.onDisableEmailAuthFactor} and is triggered only if the\n * change succeeded and actually occurred.\n */\n onDisabledEmailAuthFactor?: (data: {\n input: DisableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests a handle change, before the change\n * is performed on the account store. Only triggered with authenticated\n * sessions, so the `account` is always available.\n */\n onUpdateHandle?: (data: {\n input: UpdateHandleData\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user successfully changed their handle on the\n * account store.\n */\n onUpdatedHandle?: (data: {\n input: UpdateHandleData\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests account deactivation, before the\n * account is deactivated on the account store.\n */\n onDeactivateAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user successfully deactivated their account on\n * the account store.\n */\n onDeactivatedAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests account reactivation, before the\n * account is reactivated on the account store.\n */\n onReactivateAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user successfully reactivated their account on\n * the account store.\n */\n onReactivatedAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests account deletion, before the\n * confirmation email is dispatched on the account store.\n */\n onDeleteAccountRequest?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user has requested account deletion and the\n * confirmation email has been dispatched.\n */\n onDeleteAccountRequested?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms account deletion, before the\n * account is actually deleted on the account store.\n */\n onDeleteAccountConfirm?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user has successfully deleted their account\n * on the account store.\n */\n onDeleteAccountConfirmed?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n input: DeleteAccountConfirmInput\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user attempts to sign up, after every validation\n * has passed (including hcaptcha).\n */\n onSignUpAttempt?: (data: {\n input: SignUpInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n /**\n * If the user is signing up as part of an oauth flow, this will be the\n * client ID of the oauth application that initiated the flow.\n */\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user attempts to sign up, after the hcaptcha\n * `/siteverify` request has been made (and before the result is validated).\n */\n onHcaptchaResult?: (data: {\n input: SignUpInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n tokens: HcaptchaClientTokens\n result: HcaptchaVerifyResult\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests a password reset, before the\n * reset password request is triggered on the account store. Use this to\n * potentially cancel the password reset.\n */\n onResetPasswordRequest?: (data: {\n input: ResetPasswordRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests a password reset, before the\n * reset password request is triggered on the account store. If not account\n * was found for the provided identifier, the `account` field will be `null`.\n */\n onResetPasswordRequested?: (data: {\n input: ResetPasswordRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account | null\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms a password reset, before the\n * password is actually reset on the account store.\n */\n onResetPasswordConfirm?: (data: {\n input: ResetPasswordConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user confirms a password reset, and the\n * password was successfully reset on the account store.\n */\n onResetPasswordConfirmed?: (data: {\n input: ResetPasswordConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user successfully signs up.\n *\n * @throws {AccessDeniedError} to deny the sign-up\n */\n onSignedUp?: (data: {\n data: SignUpData\n account: Account\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * `clientId` is populated when the sign-in is submitted in the context of\n * an OAuth authorization request (i.e. the user is logging in to approve a\n * client); it is omitted for first-party sign-ins that happen outside any\n * authorization flow.\n */\n onSignInAttempt?: (data: {\n data: SignInData\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n deviceAccounts: readonly DeviceAccount[]\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user successfully signs in.\n *\n * `clientId` is populated when the sign-in is submitted in the context of\n * an OAuth authorization request; see {@link OAuthHooks.onSignInAttempt}.\n *\n * @throws {InvalidRequestError} when the sign-in should be denied\n */\n onSignedIn?: (data: {\n data: SignInData\n account: Account\n remembered: boolean\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * This hook is called when a sign-in attempt is rejected by the account\n * store due to invalid credentials (e.g. unknown identifier, wrong\n * password). It is *not* called for unexpected server errors, nor for flows\n * that require an additional authentication factor.\n *\n * `sub` is populated when the store throws an\n * {@link InvalidCredentialsError} that carries the matched subject\n * identifier (i.e. identifier known, credentials wrong). It is `null` when\n * the identifier was unknown or when the store threw a plain\n * {@link InvalidRequestError} without distinguishing the two cases.\n *\n * `clientId` is populated when the sign-in is submitted in the context of\n * an OAuth authorization request; see {@link OAuthHooks.onSignInAttempt}.\n *\n * Errors thrown from this hook will prevent the sign-in attempt from being\n * processed further.\n */\n onSignInFailed?: (data: {\n data: SignInData\n error: InvalidRequestError\n did: Did | null\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * Allows validating an authorization request (typically the requested scopes)\n * before it is created. Note that the validity against the client metadata is\n * already enforced by the OAuth provider.\n *\n * @throws {AuthorizationError}\n */\n onAuthorizationRequest?: (data: {\n client: Client\n clientAuth: null | ClientAuth\n parameters: Readonly<OAuthAuthorizationRequestParameters>\n }) => Awaitable<void>\n\n /**\n * This hook is called when a client is authorized.\n *\n * @throws {AuthorizationError} to deny the authorization request and redirect\n * the user to the client with an OAuth error (other errors will result in an\n * internal server error being displayed to the user)\n *\n * @note We use `deviceMetadata` instead of `clientMetadata` to make it clear\n * that this metadata is from the user device, which might be different from\n * the client metadata (because the OAuth client could live in a backend).\n */\n onAuthorized?: (data: {\n client: Client\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n requestId: RequestId\n }) => Awaitable<void>\n\n /**\n * This hook is called whenever a token is about to be created. You can use\n * it to modify the token claims or perform additional validation.\n *\n * This hook should never throw an error.\n */\n onCreateToken?: (data: {\n client: Client\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n claims: TokenClaims\n }) => Awaitable<void | OmitKey<AccessTokenPayload, 'iss'>>\n\n /**\n * This hook is called whenever a token was just decoded, and basic validation\n * was performed (signature, expiration, not-before).\n *\n * It can be used to modify the payload (e.g., to add custom claims), or to\n * perform additional validation.\n *\n * This hook is called when authenticating requests through the\n * `authenticateRequest()` method in `OAuthVerifier` and `OAuthProvider`.\n *\n * Any error thrown here will be propagated.\n */\n onDecodeToken?: (data: {\n tokenType: OAuthTokenType\n token: OAuthAccessToken\n payload: AccessTokenPayload\n dpopProof: null | DpopProof\n }) => Promise<AccessTokenPayload | void>\n\n /**\n * This hook is called when an authorized client exchanges an authorization\n * code for an access token.\n *\n * @throws {OAuthError} to cancel the token creation and revoke the session\n */\n onTokenCreated?: (data: {\n client: Client\n clientAuth: ClientAuth\n clientMetadata: RequestMetadata\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n }) => Awaitable<void>\n\n /**\n * This hook is called when an authorized client refreshes an access token.\n *\n * @throws {OAuthError} to cancel the token refresh and revoke the session\n */\n onTokenRefreshed?: (data: {\n client: Client\n clientAuth: ClientAuth\n clientMetadata: RequestMetadata\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n }) => Awaitable<void>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"oauth-hooks.js","sourceRoot":"","sources":["../src/oauth-hooks.ts"],"names":[],"mappings":"","sourcesContent":["import type { Did } from '@atproto/did'\nimport type { Jwks } from '@atproto/jwk'\nimport type {\n Account,\n SignInInput,\n SignUpInput,\n} from '@atproto/oauth-provider-api'\nimport type {\n OAuthAccessToken,\n OAuthAuthorizationDetails,\n OAuthAuthorizationRequestParameters,\n OAuthClientMetadata,\n OAuthTokenResponse,\n OAuthTokenType,\n} from '@atproto/oauth-types'\nimport type {\n DeleteAccountConfirmInput,\n DeviceAccount,\n DisableEmailAuthFactorInput,\n EnableEmailAuthFactorInput,\n ResetPasswordConfirmInput,\n ResetPasswordRequestInput,\n UpdateEmailConfirmInput,\n UpdateEmailRequestInput,\n UpdateHandleData,\n VerifyEmailConfirmInput,\n VerifyEmailRequestInput,\n} from './account/account-store.js'\nimport type { ClientAuth } from './client/client-auth.js'\nimport type { ClientId } from './client/client-id.js'\nimport type { ClientInfo } from './client/client-info.js'\nimport type { Client } from './client/client.js'\nimport type { DeviceId } from './device/device-id.js'\nimport type { DpopProof } from './dpop/dpop-proof.js'\nimport type { InvalidRequestError } from './errors/invalid-request-error.js'\nimport type { HcaptchaClientTokens } from './hcaptcha/hcaptcha-client-tokens.js'\nimport type { HcaptchaVerifyData } from './hcaptcha/hcaptcha-verify-data.js'\nimport type { HcaptchaConfig, HcaptchaVerifyResult } from './lib/hcaptcha.js'\nimport type { RequestMetadata } from './lib/http/request.js'\nimport type { Awaitable, OmitKey } from './lib/util/type.js'\nimport type { RequestId } from './request/request-id.js'\nimport type { AccessTokenPayload } from './signer/access-token-payload.js'\nimport type { TokenClaims } from './token/token-claims.js'\n\n// Make sure all types needed to implement the OAuthHooks are exported\nexport type {\n AccessTokenPayload,\n Account,\n Awaitable,\n Client,\n ClientAuth,\n ClientId,\n ClientInfo,\n DeviceId,\n Did,\n DpopProof,\n HcaptchaClientTokens,\n HcaptchaConfig,\n HcaptchaVerifyData,\n HcaptchaVerifyResult,\n Jwks,\n OAuthAccessToken,\n OAuthAuthorizationDetails,\n OAuthAuthorizationRequestParameters,\n OAuthClientMetadata,\n OAuthTokenResponse,\n OAuthTokenType,\n RequestMetadata,\n ResetPasswordConfirmInput,\n ResetPasswordRequestInput,\n SignInInput,\n SignUpInput,\n TokenClaims,\n UpdateHandleData,\n}\n\nexport type OAuthHooks = {\n /**\n * Use this to alter, override or validate the client metadata & jwks returned\n * by the client store.\n *\n * @throws {InvalidClientMetadataError} if the metadata is invalid\n * @see {@link InvalidClientMetadataError}\n */\n getClientInfo?: (\n clientId: ClientId,\n data: {\n metadata: OAuthClientMetadata\n jwks: Jwks | undefined\n },\n ) => Awaitable<undefined | Partial<ClientInfo>>\n\n /**\n * This hook is called when a user requests an email change, before the email\n * change request is triggered on the account store. Only triggered with\n * authenticated sessions, so the `account` is always available.\n */\n onChangeEmailRequest?: (data: {\n input: UpdateEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user requests an email change, and the email\n * change request was successfully triggered on the account store.\n */\n onChangeEmailRequested?: (data: {\n input: UpdateEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms an email change, before the email\n * change is actually confirmed on the account store. Only triggered with\n * authenticated sessions, so the `account` is always available.\n */\n onUpdateEmailConfirm?: (data: {\n input: UpdateEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user confirms an email change, and the email\n * change was successfully confirmed on the account store.\n */\n onUpdateEmailConfirmed?: (data: {\n input: UpdateEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n prevAccount: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests an email verification, before the\n * verification request is triggered on the account store. Only triggered with\n * authenticated sessions, so the `account` is always available.\n */\n onVerifyEmailRequest?: (data: {\n input: VerifyEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user requests an email verification, and the\n * verification request was successfully triggered on the account store.\n */\n onVerifyEmailRequested?: (data: {\n input: VerifyEmailRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms an email verification, before the\n * verification is actually confirmed on the account store. Only triggered\n * with authenticated sessions, so the `account` is always available.\n */\n onVerifyEmailConfirm?: (data: {\n input: VerifyEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user confirms an email verification, and the\n * verification was successfully confirmed on the account store.\n */\n onVerifyEmailConfirmed?: (data: {\n input: VerifyEmailConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called whenever a user is trying to enable their email auth\n * factor (OTP), before the change is saved to the account store.\n */\n onEnableEmailAuthFactor?: (data: {\n input: EnableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called only after the email auth factor was actually enabled\n * on the account store. This follows\n * {@link OAuthHooks.onEnableEmailAuthFactor} and is triggered only if the\n * change succeeded and actually occurred.\n */\n onEnabledEmailAuthFactor?: (data: {\n input: EnableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests that their email auth factor (OTP)\n * be disabled, before the change is saved to the account store.\n *\n * @note Disabling is two-phase:\n * - First no {@link DisableEmailAuthFactorInput.token} is provided and the\n * store implementation is expected to trigger an email confirmation. When\n * that happens, {@link OAuthHooks.onDisabledEmailAuthFactor} will not be\n * called during the processing of the first HTTP request.\n * - In the second request, which follows the email confirmation, the\n * {@link DisableEmailAuthFactorInput.token} is provided and the store\n * implementation is expected to actually disable the email auth factor. At\n * this point, {@link OAuthHooks.onDisabledEmailAuthFactor} will be called\n * after the store has successfully processed the request.\n */\n onDisableEmailAuthFactor?: (data: {\n input: DisableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called only after the email auth factor was actually disabled\n * on the account store. This follows\n * {@link OAuthHooks.onDisableEmailAuthFactor} and is triggered only if the\n * change succeeded and actually occurred.\n */\n onDisabledEmailAuthFactor?: (data: {\n input: DisableEmailAuthFactorInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests a handle change, before the change\n * is performed on the account store. Only triggered with authenticated\n * sessions, so the `account` is always available.\n */\n onUpdateHandle?: (data: {\n input: UpdateHandleData\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user successfully changed their handle on the\n * account store.\n */\n onUpdatedHandle?: (data: {\n input: UpdateHandleData\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests account deactivation, before the\n * account is deactivated on the account store.\n */\n onDeactivateAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user successfully deactivated their account on\n * the account store.\n */\n onDeactivatedAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests account reactivation, before the\n * account is reactivated on the account store.\n */\n onReactivateAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user successfully reactivated their account on\n * the account store.\n */\n onReactivatedAccount?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests account deletion, before the\n * confirmation email is dispatched on the account store.\n */\n onDeleteAccountRequest?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user has requested account deletion and the\n * confirmation email has been dispatched.\n */\n onDeleteAccountRequested?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms account deletion, before the\n * account is actually deleted on the account store.\n */\n onDeleteAccountConfirm?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user has successfully deleted their account\n * on the account store.\n */\n onDeleteAccountConfirmed?: (data: {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n input: DeleteAccountConfirmInput\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user attempts to sign up, after every validation\n * has passed (including hcaptcha).\n */\n onSignUpAttempt?: (data: {\n input: SignUpInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n /**\n * If the user is signing up as part of an oauth flow, this will be the\n * client ID of the oauth application that initiated the flow.\n */\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * This hook is called whenever an hCaptcha token is verified, after the\n * hcaptcha `/siteverify` request has been made (and before the result is\n * validated). By default, this happens on every sign-up, and on sign-in and\n * password reset requests and confirmations once a captcha tier rate limit\n * was exceeded.\n */\n onHcaptchaResult?: (\n data: HcaptchaVerifyData & {\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n tokens: HcaptchaClientTokens\n result: HcaptchaVerifyResult\n },\n ) => Awaitable<void>\n\n /**\n * This hook is called when a user requests a password reset, before the\n * reset password request is triggered on the account store. Use this to\n * potentially cancel the password reset.\n */\n onResetPasswordRequest?: (data: {\n input: ResetPasswordRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user requests a password reset, before the\n * reset password request is triggered on the account store. If not account\n * was found for the provided identifier, the `account` field will be `null`.\n */\n onResetPasswordRequested?: (data: {\n input: ResetPasswordRequestInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account | null\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user confirms a password reset, before the\n * password is actually reset on the account store.\n */\n onResetPasswordConfirm?: (data: {\n input: ResetPasswordConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n }) => Awaitable<void>\n\n /**\n * This hook is called after a user confirms a password reset, and the\n * password was successfully reset on the account store.\n */\n onResetPasswordConfirmed?: (data: {\n input: ResetPasswordConfirmInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n account: Account\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user successfully signs up.\n *\n * @throws {AccessDeniedError} to deny the sign-up\n */\n onSignedUp?: (data: {\n input: SignUpInput\n account: Account\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * `clientId` is populated when the sign-in is submitted in the context of\n * an OAuth authorization request (i.e. the user is logging in to approve a\n * client); it is omitted for first-party sign-ins that happen outside any\n * authorization flow.\n */\n onSignInAttempt?: (data: {\n input: SignInInput\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n deviceAccounts: readonly DeviceAccount[]\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * This hook is called when a user successfully signs in.\n *\n * `clientId` is populated when the sign-in is submitted in the context of\n * an OAuth authorization request; see {@link OAuthHooks.onSignInAttempt}.\n *\n * @throws {InvalidRequestError} when the sign-in should be denied\n */\n onSignedIn?: (data: {\n input: SignInInput\n account: Account\n remembered: boolean\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * This hook is called when a sign-in attempt is rejected by the account\n * store due to invalid credentials (e.g. unknown identifier, wrong\n * password). It is *not* called for unexpected server errors, nor for flows\n * that require an additional authentication factor.\n *\n * `sub` is populated when the store throws an\n * {@link InvalidCredentialsError} that carries the matched subject\n * identifier (i.e. identifier known, credentials wrong). It is `null` when\n * the identifier was unknown or when the store threw a plain\n * {@link InvalidRequestError} without distinguishing the two cases.\n *\n * `clientId` is populated when the sign-in is submitted in the context of\n * an OAuth authorization request; see {@link OAuthHooks.onSignInAttempt}.\n *\n * Errors thrown from this hook will prevent the sign-in attempt from being\n * processed further.\n */\n onSignInFailed?: (data: {\n input: SignInInput\n error: InvalidRequestError\n did: Did | null\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n clientId: ClientId | undefined\n }) => Awaitable<void>\n\n /**\n * Allows validating an authorization request (typically the requested scopes)\n * before it is created. Note that the validity against the client metadata is\n * already enforced by the OAuth provider.\n *\n * @throws {AuthorizationError}\n */\n onAuthorizationRequest?: (data: {\n client: Client\n clientAuth: null | ClientAuth\n parameters: Readonly<OAuthAuthorizationRequestParameters>\n }) => Awaitable<void>\n\n /**\n * This hook is called when a client is authorized.\n *\n * @throws {AuthorizationError} to deny the authorization request and redirect\n * the user to the client with an OAuth error (other errors will result in an\n * internal server error being displayed to the user)\n *\n * @note We use `deviceMetadata` instead of `clientMetadata` to make it clear\n * that this metadata is from the user device, which might be different from\n * the client metadata (because the OAuth client could live in a backend).\n */\n onAuthorized?: (data: {\n client: Client\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n deviceId: DeviceId\n deviceMetadata: RequestMetadata\n requestId: RequestId\n }) => Awaitable<void>\n\n /**\n * This hook is called whenever a token is about to be created. You can use\n * it to modify the token claims or perform additional validation.\n *\n * This hook should never throw an error.\n */\n onCreateToken?: (data: {\n client: Client\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n claims: TokenClaims\n }) => Awaitable<void | OmitKey<AccessTokenPayload, 'iss'>>\n\n /**\n * This hook is called whenever a token was just decoded, and basic validation\n * was performed (signature, expiration, not-before).\n *\n * It can be used to modify the payload (e.g., to add custom claims), or to\n * perform additional validation.\n *\n * This hook is called when authenticating requests through the\n * `authenticateRequest()` method in `OAuthVerifier` and `OAuthProvider`.\n *\n * Any error thrown here will be propagated.\n */\n onDecodeToken?: (data: {\n tokenType: OAuthTokenType\n token: OAuthAccessToken\n payload: AccessTokenPayload\n dpopProof: null | DpopProof\n }) => Promise<AccessTokenPayload | void>\n\n /**\n * This hook is called when an authorized client exchanges an authorization\n * code for an access token.\n *\n * @throws {OAuthError} to cancel the token creation and revoke the session\n */\n onTokenCreated?: (data: {\n client: Client\n clientAuth: ClientAuth\n clientMetadata: RequestMetadata\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n }) => Awaitable<void>\n\n /**\n * This hook is called when an authorized client refreshes an access token.\n *\n * @throws {OAuthError} to cancel the token refresh and revoke the session\n */\n onTokenRefreshed?: (data: {\n client: Client\n clientAuth: ClientAuth\n clientMetadata: RequestMetadata\n account: Account\n parameters: OAuthAuthorizationRequestParameters\n }) => Awaitable<void>\n}\n"]}
|
package/dist/oauth-provider.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Redis, RedisOptions } from 'ioredis';
|
|
2
2
|
import type { Jwks } from '@atproto/jwk';
|
|
3
3
|
import { LexResolver } from '@atproto/lex-resolver';
|
|
4
|
-
import { type OAuthAccessToken, type OAuthAuthorizationCodeGrantTokenRequest, type OAuthAuthorizationRequestJar, type OAuthAuthorizationRequestPar, type OAuthAuthorizationRequestParameters, type OAuthAuthorizationRequestQuery, type OAuthAuthorizationServerMetadata, type OAuthClientCredentials, type OAuthClientMetadata, type OAuthParResponse, type OAuthRefreshTokenGrantTokenRequest, type OAuthTokenIdentification, type OAuthTokenRequest, type OAuthTokenResponse, type OAuthTokenType } from '@atproto/oauth-types';
|
|
4
|
+
import { type OAuthAccessToken, type OAuthAuthorizationCodeGrantTokenRequest, type OAuthAuthorizationRequestJar, type OAuthAuthorizationRequestPar, type OAuthAuthorizationRequestParameters, type OAuthAuthorizationRequestQuery, type OAuthAuthorizationRequestUri, type OAuthAuthorizationServerMetadata, type OAuthClientCredentials, type OAuthClientMetadata, type OAuthParResponse, type OAuthRefreshTokenGrantTokenRequest, type OAuthTokenIdentification, type OAuthTokenRequest, type OAuthTokenResponse, type OAuthTokenType } from '@atproto/oauth-types';
|
|
5
5
|
import type { CreateDidResolverOptions } from '@atproto-labs/did-resolver';
|
|
6
6
|
import { type CreateHandleResolverNodeOptions } from '@atproto-labs/handle-resolver-node';
|
|
7
7
|
import type { SimpleStore } from '@atproto-labs/simple-store';
|
|
@@ -17,6 +17,7 @@ import type { Branding, BrandingConfig } from './customization/branding.js';
|
|
|
17
17
|
import { type Customization, type CustomizationConfig } from './customization/customization.js';
|
|
18
18
|
import { type DeviceInfo, DeviceManager, type DeviceManagerOptions } from './device/device-manager.js';
|
|
19
19
|
import { type DeviceStore } from './device/device-store.js';
|
|
20
|
+
import { HCaptchaManager } from './hcaptcha/hcaptcha-manager.js';
|
|
20
21
|
import { LexiconManager } from './lexicon/lexicon-manager.js';
|
|
21
22
|
import { type LexiconStore } from './lexicon/lexicon-store.js';
|
|
22
23
|
import type { HcaptchaConfig } from './lib/hcaptcha.js';
|
|
@@ -25,6 +26,9 @@ import type { MultiLangString } from './lib/util/locale.js';
|
|
|
25
26
|
import { type CustomMetadata } from './metadata/build-metadata.js';
|
|
26
27
|
import type { OAuthHooks } from './oauth-hooks.js';
|
|
27
28
|
import { type DpopProof, OAuthVerifier, type OAuthVerifierOptions, type VerifyTokenPayloadOptions } from './oauth-verifier.js';
|
|
29
|
+
import { RateLimitManager } from './rate-limit/rate-limit-manager.js';
|
|
30
|
+
import { DEFAULT_RATE_LIMIT_POLICIES, type RateLimitKeyGetter, type RateLimitPolicies, type RateLimitPolicy, type RateLimitPolicyContexts, type RateLimitPolicyName, type RateLimitRule, type RateLimitsOptions, authenticatedClientKey, identifierIpKey, identifierKey, ipKey, publicClientIpKey } from './rate-limit/rate-limit-policies.js';
|
|
31
|
+
import type { RateLimiter, RateLimiterFactory, RateLimiterOptions } from './rate-limit/rate-limiter.js';
|
|
28
32
|
import { type ReplayStore } from './replay/replay-store.js';
|
|
29
33
|
import { RequestManager } from './request/request-manager.js';
|
|
30
34
|
import { type RequestStore } from './request/request-store.js';
|
|
@@ -43,8 +47,8 @@ export type * from '@atproto/jwk-jose';
|
|
|
43
47
|
export { JoseKey } from '@atproto/jwk-jose';
|
|
44
48
|
export type * from '@atproto/lex-resolver';
|
|
45
49
|
export { LexResolver, LexResolverError } from '@atproto/lex-resolver';
|
|
46
|
-
export { AccessTokenMode };
|
|
47
|
-
export type { AccessTokenPayload, AuthorizationRedirectParameters, AuthorizationResultAuthorizePage as AuthorizationResultAuthorize, AuthorizationResultRedirect, Branding, BrandingConfig, CustomMetadata, Customization, CustomizationConfig, ErrorHandler, HcaptchaConfig, LoopbackMetadataGetter, MultiLangString, OAuthAuthorizationServerMetadata, VerifyTokenPayloadOptions, };
|
|
50
|
+
export { AccessTokenMode, DEFAULT_RATE_LIMIT_POLICIES, authenticatedClientKey, identifierIpKey, identifierKey, ipKey, publicClientIpKey, };
|
|
51
|
+
export type { AccessTokenPayload, AuthorizationRedirectParameters, AuthorizationResultAuthorizePage as AuthorizationResultAuthorize, AuthorizationResultRedirect, Branding, BrandingConfig, CustomMetadata, Customization, CustomizationConfig, ErrorHandler, HcaptchaConfig, LoopbackMetadataGetter, MultiLangString, OAuthAuthorizationServerMetadata, RateLimitKeyGetter, RateLimitPolicies, RateLimitPolicy, RateLimitPolicyContexts, RateLimitPolicyName, RateLimitRule, RateLimiter, RateLimiterFactory, RateLimiterOptions, RateLimitsOptions, VerifyTokenPayloadOptions, };
|
|
48
52
|
export type ClientJwksCache = SimpleStore<string, Jwks>;
|
|
49
53
|
export type ClientMetadataCache = SimpleStore<string, OAuthClientMetadata>;
|
|
50
54
|
export type OAuthStore = AccountStore & ClientStore & DeviceStore & LexiconStore & ReplayStore & RequestStore & TokenStore;
|
|
@@ -132,6 +136,16 @@ type OAuthProviderConfig = {
|
|
|
132
136
|
* @default is as specified by ATPROTO
|
|
133
137
|
*/
|
|
134
138
|
loopbackMetadata?: null | false | LoopbackMetadataGetter;
|
|
139
|
+
/**
|
|
140
|
+
* Enables rate limiting of the OAuth and account routes that create
|
|
141
|
+
* authorization requests, check credentials, or send emails. The host
|
|
142
|
+
* provides the storage backend through {@link RateLimitsOptions.factory}.
|
|
143
|
+
*
|
|
144
|
+
* When not provided, no rate limiting is performed. The default rules that
|
|
145
|
+
* have no points, which need no storage, still apply: sign-ups always require
|
|
146
|
+
* a captcha (when hCaptcha is configured).
|
|
147
|
+
*/
|
|
148
|
+
rateLimits?: RateLimitsOptions;
|
|
135
149
|
};
|
|
136
150
|
export type OAuthProviderOptions = OAuthProviderConfig & OAuthVerifierOptions & OAuthHooks & CreateDidResolverOptions & CreateHandleResolverNodeOptions & DeviceManagerOptions & CustomizationConfig;
|
|
137
151
|
export declare class OAuthProvider extends OAuthVerifier {
|
|
@@ -140,13 +154,15 @@ export declare class OAuthProvider extends OAuthVerifier {
|
|
|
140
154
|
readonly metadata: OAuthAuthorizationServerMetadata;
|
|
141
155
|
readonly customization: Customization;
|
|
142
156
|
readonly authenticationMaxAge: number;
|
|
157
|
+
readonly hcaptchaManager: HCaptchaManager;
|
|
158
|
+
readonly rateLimitManager: RateLimitManager;
|
|
143
159
|
readonly accountManager: AccountManager;
|
|
144
160
|
readonly deviceManager: DeviceManager;
|
|
145
161
|
readonly clientManager: ClientManager;
|
|
146
162
|
readonly lexiconManager: LexiconManager;
|
|
147
163
|
readonly requestManager: RequestManager;
|
|
148
164
|
readonly tokenManager: TokenManager;
|
|
149
|
-
constructor({ authenticationMaxAge, tokenMaxAge, accessTokenMode, metadata, loopbackMetadata, fetch: unsafeFetch, // Inherited from options
|
|
165
|
+
constructor({ authenticationMaxAge, tokenMaxAge, accessTokenMode, metadata, loopbackMetadata, rateLimits, fetch: unsafeFetch, // Inherited from options
|
|
150
166
|
safeFetch, lexResolver, store, accountStore, deviceStore, lexiconStore, tokenStore, requestStore, clientStore, replayStore, clientJwksCache, clientMetadataCache, ...rest }: OAuthProviderOptions);
|
|
151
167
|
get jwks(): Readonly<{
|
|
152
168
|
keys: readonly (Readonly<{
|
|
@@ -278,12 +294,15 @@ export declare class OAuthProvider extends OAuthVerifier {
|
|
|
278
294
|
/**
|
|
279
295
|
* @see {@link https://datatracker.ietf.org/doc/html/rfc9126}
|
|
280
296
|
*/
|
|
281
|
-
pushedAuthorizationRequest(credentials: OAuthClientCredentials, authorizationRequest: OAuthAuthorizationRequestPar, dpopProof: null | DpopProof): Promise<OAuthParResponse>;
|
|
282
|
-
private processAuthorizationRequest;
|
|
297
|
+
pushedAuthorizationRequest(credentials: OAuthClientCredentials, authorizationRequest: OAuthAuthorizationRequestPar, dpopProof: null | DpopProof, deviceMetadata: RequestMetadata): Promise<OAuthParResponse>;
|
|
283
298
|
/**
|
|
299
|
+
* Only requests created through
|
|
300
|
+
* {@link OAuthProvider.pushedAuthorizationRequest PAR} are accepted.
|
|
301
|
+
*
|
|
284
302
|
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-11#section-4.1.1}
|
|
303
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc9126#section-4}
|
|
285
304
|
*/
|
|
286
|
-
authorize(query: OAuthAuthorizationRequestQuery, { deviceId, deviceMetadata }: DeviceInfo): Promise<AuthorizationResultRedirect | AuthorizationResultAuthorizePage>;
|
|
305
|
+
authorize(query: Extract<OAuthAuthorizationRequestQuery, OAuthAuthorizationRequestUri>, { deviceId, deviceMetadata }: DeviceInfo): Promise<AuthorizationResultRedirect | AuthorizationResultAuthorizePage>;
|
|
287
306
|
token(clientCredentials: OAuthClientCredentials, clientMetadata: RequestMetadata, request: OAuthTokenRequest, dpopProof: null | DpopProof): Promise<OAuthTokenResponse>;
|
|
288
307
|
protected compareClientAuth(client: Client, clientAuth: ClientAuth, dpopProof: null | DpopProof, initial: {
|
|
289
308
|
parameters: OAuthAuthorizationRequestParameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../src/oauth-provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,uCAAuC,EAC5C,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,kCAAkC,EACvC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAGpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAE1E,OAAO,EACL,KAAK,+BAA+B,EAErC,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAEnB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EACL,aAAa,EACb,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