@atproto/oauth-provider 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +6 -0
- package/dist/assets/assets-middleware.js +1 -1
- package/dist/assets/assets-middleware.js.map +1 -1
- package/dist/lib/http/accept.d.ts +1 -0
- package/dist/lib/http/accept.d.ts.map +1 -1
- package/dist/lib/http/accept.js +1 -0
- package/dist/lib/http/accept.js.map +1 -1
- package/dist/lib/http/middleware.js +1 -1
- package/dist/lib/http/middleware.js.map +1 -1
- package/dist/lib/http/response.d.ts +9 -5
- package/dist/lib/http/response.d.ts.map +1 -1
- package/dist/lib/http/response.js +18 -59
- package/dist/lib/http/response.js.map +1 -1
- package/dist/oauth-provider.d.ts.map +1 -1
- package/dist/oauth-provider.js +19 -9
- package/dist/oauth-provider.js.map +1 -1
- package/dist/output/send-web-page.d.ts +3 -3
- package/dist/output/send-web-page.d.ts.map +1 -1
- package/dist/output/send-web-page.js +2 -2
- package/dist/output/send-web-page.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/assets-middleware.ts +1 -1
- package/src/lib/http/accept.ts +1 -0
- package/src/lib/http/middleware.ts +1 -1
- package/src/lib/http/response.ts +37 -78
- package/src/oauth-provider.ts +18 -10
- package/src/output/send-web-page.ts +5 -3
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# @atproto/oauth-provider
|
2
2
|
|
3
|
+
## 0.2.7
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#2852](https://github.com/bluesky-social/atproto/pull/2852) [`709ba3015`](https://github.com/bluesky-social/atproto/commit/709ba301578c1956b8eb0d89bad717615a4fd7ba) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove response content-encoding logic
|
8
|
+
|
3
9
|
## 0.2.6
|
4
10
|
|
5
11
|
### Patch Changes
|
@@ -32,7 +32,7 @@ function authorizeAssetsMiddleware() {
|
|
32
32
|
if (query === asset.sha256) {
|
33
33
|
res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');
|
34
34
|
}
|
35
|
-
|
35
|
+
(0, index_js_1.writeStream)(res, asset.createStream(), { contentType: asset.type });
|
36
36
|
};
|
37
37
|
}
|
38
38
|
//# sourceMappingURL=assets-middleware.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"assets-middleware.js","sourceRoot":"","sources":["../../src/assets/assets-middleware.ts"],"names":[],"mappings":";;AASA,8DAoCC;AA7CD,mDAK6B;AAE7B,yCAAwD;AAExD,SAAgB,yBAAyB;IACvC,OAAO,KAAK,UAAU,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI;QACnD,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM;YAAE,OAAO,IAAI,EAAE,CAAA;QAChE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,4BAAiB,CAAC;YAAE,OAAO,IAAI,EAAE,CAAA;QAE1D,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAG7C,CAAA;QACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,4BAAiB,CAAC,MAAM,CAAC,CAAA;QACzD,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,EAAE,CAAA;QAE5B,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QACxD,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,EAAE,CAAA;QAEzB,IAAI,CAAC;YACH,oEAAoE;YACpE,uCAAuC;YACvC,IAAA,4BAAiB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAA;YAClD,IAAA,4BAAiB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,O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BAAQ,EAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QACxD,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,EAAE,CAAA;QAEzB,IAAI,CAAC;YACH,oEAAoE;YACpE,uCAAuC;YACvC,IAAA,4BAAiB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAA;YAClD,IAAA,4BAAiB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;QACxD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC;QAED,IAAI,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;YAClD,OAAO,KAAK,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QACtC,CAAC;QAED,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;QAEnC,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,qCAAqC,CAAC,CAAA;QACvE,CAAC;QAED,IAAA,sBAAW,EAAC,GAAG,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;IACrE,CAAC,CAAA;AACH,CAAC"}
|
@@ -22,6 +22,7 @@ type View<T, D, Req extends IncomingMessage = IncomingMessage, Res extends Serve
|
|
22
22
|
* }
|
23
23
|
* )
|
24
24
|
* )
|
25
|
+
* ```
|
25
26
|
*/
|
26
27
|
export declare function acceptMiddleware<D, T = void, Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse>(controller: (this: T, req: Req, res: Res) => D | PromiseLike<D>, views: Record<string, string | View<T, D, Req, Res>>, fallback?: Middleware<T>): (this: T, req: Req, res: Res, next: NextFunction) => Promise<void>;
|
27
28
|
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../../src/lib/http/accept.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAU,MAAM,cAAc,CAAA;AAC7C,OAAO,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,KAAK,IAAI,CACP,CAAC,EACD,CAAC,EACD,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,IACzC,CACF,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,EAC5B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,YAAY,KACf,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;AAE7B
|
1
|
+
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../../src/lib/http/accept.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAU,MAAM,cAAc,CAAA;AAC7C,OAAO,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,KAAK,IAAI,CACP,CAAC,EACD,CAAC,EACD,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,IACzC,CACF,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,EAC5B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,YAAY,KACf,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;AAE7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EACD,CAAC,GAAG,IAAI,EACR,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,EAE3C,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EAC/D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EACpD,QAAQ,GAAE,UAAU,CAAC,CAAC,CAAsD,GAC3E,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAuCpE"}
|
package/dist/lib/http/accept.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../../../src/lib/http/accept.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../../../src/lib/http/accept.ts"],"names":[],"mappings":";;AA2CA,4CAgDC;AA3FD,yCAAwC;AAExC,6CAA6C;AAoB7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,gBAAgB,CAM9B,UAA+D,EAC/D,KAAoD,EACpD,WAA0B,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE;IAE5E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CA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AAI,IAAI;oBAAE,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;gBAE7C,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;YACtC,CAAC;iBAAM,CAAC;gBACN,2BAA2B;gBAC3B,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;YAC3C,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,WAAW;gBAAE,GAAG,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;YACtD,IAAI,CAAC,GAAG,CAAC,CAAA;QACX,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
|
@@ -65,7 +65,7 @@ function createFinalHandler(req, res, options) {
|
|
65
65
|
const { status, ...payload } = buildFallbackPayload(req, err);
|
66
66
|
res.setHeader('Content-Security-Policy', "default-src 'none'");
|
67
67
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
68
|
-
(0, response_js_1.writeJson)(res, payload, status);
|
68
|
+
(0, response_js_1.writeJson)(res, payload, { status });
|
69
69
|
};
|
70
70
|
}
|
71
71
|
function buildFallbackPayload(req, err) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/lib/http/middleware.ts"],"names":[],"mappings":";;AAaA,gDAgCC;AAWD,8BAYC;AAMD,gDAyBC;AA4CD,oBAQC;AAtJD,+CAAyC;AAQzC;;;GAGG;AACH,SAAgB,kBAAkB,CAChC,WAA6D,EAC7D,EAAE,WAAW,KAA+B,EAAE;IAE9C,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CACrD,CAAC,CAAC,EAA8B,EAAE,CAAC,CAAC,IAAI,IAAI,CAC7C,CAAA;IAED,uEAAuE;IACvE,IAA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,GAAW,EAAE,IAAY;IACtD,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QACzD,MAAM,KAAK,GAAI,GAA+B,CAAC,GAAG,CAAC,CAAA;QACnD,IAAI,OAAO,KAAK,KAAK,IAAI;YAAE,OAAO,KAAK,CAAA;IACzC,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
@@ -2,9 +2,13 @@ import { Readable } from 'node:stream';
|
|
2
2
|
import { Handler, ServerResponse } from './types.js';
|
3
3
|
export declare function appendHeader(res: ServerResponse, header: string, value: string | readonly string[]): void;
|
4
4
|
export declare function writeRedirect(res: ServerResponse, url: string, status?: number): void;
|
5
|
-
export
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
export declare function
|
5
|
+
export type WriteResponseOptions = {
|
6
|
+
status?: number;
|
7
|
+
contentType?: string;
|
8
|
+
};
|
9
|
+
export declare function writeStream(res: ServerResponse, stream: Readable, { status, contentType, }?: WriteResponseOptions): void;
|
10
|
+
export declare function writeBuffer(res: ServerResponse, chunk: string | Buffer, { status, contentType, }?: WriteResponseOptions): void;
|
11
|
+
export declare function writeJson(res: ServerResponse, payload: unknown, { contentType, ...options }?: WriteResponseOptions): void;
|
12
|
+
export declare function staticJsonMiddleware(value: unknown, { contentType, ...options }?: WriteResponseOptions): Handler<unknown>;
|
13
|
+
export declare function writeHtml(res: ServerResponse, html: Buffer | string, { contentType, ...options }?: WriteResponseOptions): void;
|
10
14
|
//# sourceMappingURL=response.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/lib/http/response.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/lib/http/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,aAAa,CAAA;AAEhD,OAAO,E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
|
7
7
|
exports.writeJson = writeJson;
|
8
|
-
exports.
|
8
|
+
exports.staticJsonMiddleware = staticJsonMiddleware;
|
9
9
|
exports.writeHtml = writeHtml;
|
10
10
|
const node_stream_1 = require("node:stream");
|
11
|
-
const promises_1 = require("node:stream/promises");
|
12
|
-
const node_zlib_1 = require("node:zlib");
|
13
11
|
function appendHeader(res, header, value) {
|
14
12
|
const existing = res.getHeader(header);
|
15
13
|
if (existing == null) {
|
@@ -23,75 +21,36 @@ function appendHeader(res, header, value) {
|
|
23
21
|
function writeRedirect(res, url, status = 302) {
|
24
22
|
res.writeHead(status, { Location: url }).end();
|
25
23
|
}
|
26
|
-
function
|
27
|
-
if (accept?.includes('br'))
|
28
|
-
return 'br';
|
29
|
-
if (accept?.includes('gzip'))
|
30
|
-
return 'gzip';
|
31
|
-
return 'identity';
|
32
|
-
}
|
33
|
-
function getEncoder(encoding) {
|
34
|
-
switch (encoding) {
|
35
|
-
case 'br':
|
36
|
-
return (0, node_zlib_1.createBrotliCompress)({
|
37
|
-
// Default quality is too slow
|
38
|
-
params: { [node_zlib_1.constants.BROTLI_PARAM_QUALITY]: 5 },
|
39
|
-
});
|
40
|
-
case 'gzip':
|
41
|
-
return (0, node_zlib_1.createGzip)();
|
42
|
-
case 'identity':
|
43
|
-
return new node_stream_1.PassThrough();
|
44
|
-
default:
|
45
|
-
throw new Error(`Unsupported encoding: ${encoding}`);
|
46
|
-
}
|
47
|
-
}
|
48
|
-
const ifString = (value) => typeof value === 'string' ? value : undefined;
|
49
|
-
async function writeStream(res, stream, contentType = ifString(stream.headers?.['content-type']) ||
|
50
|
-
'application/octet-stream', status = 200) {
|
24
|
+
function writeStream(res, stream, { status = 200, contentType = 'application/octet-stream', } = {}) {
|
51
25
|
res.statusCode = status;
|
52
26
|
res.setHeader('content-type', contentType);
|
53
|
-
appendHeader(res, 'vary', 'accept-encoding');
|
54
|
-
const encoding = negotiateEncoding(res.req.headers['accept-encoding']);
|
55
|
-
res.setHeader('content-encoding', encoding);
|
56
|
-
res.setHeader('transfer-encoding', 'chunked');
|
57
27
|
if (res.req.method === 'HEAD') {
|
58
28
|
res.end();
|
59
29
|
stream.destroy();
|
60
|
-
return;
|
61
|
-
}
|
62
|
-
try {
|
63
|
-
await (0, promises_1.pipeline)(stream, getEncoder(encoding), res);
|
64
30
|
}
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
// If an abort signal is used, we can consider this function's job successful
|
70
|
-
if ('name' in err && err.name === 'AbortError')
|
71
|
-
return;
|
72
|
-
// If the client closes the connection, we don't care about the error
|
73
|
-
if ('code' in err && err.code === 'ERR_STREAM_PREMATURE_CLOSE')
|
74
|
-
return;
|
75
|
-
}
|
76
|
-
throw err;
|
31
|
+
else {
|
32
|
+
(0, node_stream_1.pipeline)([stream, res], (_err) => {
|
33
|
+
// The error will be propagated through the streams
|
34
|
+
});
|
77
35
|
}
|
78
36
|
}
|
79
|
-
|
80
|
-
|
81
|
-
|
37
|
+
function writeBuffer(res, chunk, { status = 200, contentType = 'application/octet-stream', } = {}) {
|
38
|
+
res.statusCode = status;
|
39
|
+
res.setHeader('content-type', contentType);
|
40
|
+
res.end(chunk);
|
82
41
|
}
|
83
|
-
|
42
|
+
function writeJson(res, payload, { contentType = 'application/json', ...options } = {}) {
|
84
43
|
const buffer = Buffer.from(JSON.stringify(payload));
|
85
|
-
|
44
|
+
writeBuffer(res, buffer, { ...options, contentType });
|
86
45
|
}
|
87
|
-
function
|
46
|
+
function staticJsonMiddleware(value, { contentType = 'application/json', ...options } = {}) {
|
88
47
|
const buffer = Buffer.from(JSON.stringify(value));
|
89
|
-
|
90
|
-
|
48
|
+
const staticOptions = { ...options, contentType };
|
49
|
+
return function (req, res) {
|
50
|
+
writeBuffer(res, buffer, staticOptions);
|
91
51
|
};
|
92
52
|
}
|
93
|
-
|
94
|
-
|
95
|
-
return writeBuffer(res, buffer, contentType, status);
|
53
|
+
function writeHtml(res, html, { contentType = 'text/html', ...options } = {}) {
|
54
|
+
writeBuffer(res, html, { ...options, contentType });
|
96
55
|
}
|
97
56
|
//# sourceMappingURL=response.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/lib/http/response.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/lib/http/response.ts"],"names":[],"mappings":";;AAIA,oCAYC;AAED,sCAMC;AAOD,kCAmBC;AAED,kCAWC;AAED,8BAOC;AAED,oDASC;AAED,8BAMC;AA3FD,6CAAgD;AAIhD,SAAgB,YAAY,CAC1B,GAAmB,EACnB,MAAc,EACd,KAAiC;IAEjC,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;QACnE,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC1C,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CAC3B,GAAmB,EACnB,GAAW,EACX,MAAM,GAAG,GAAG;IAEZ,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAA;AAChD,CAAC;AAOD,SAAgB,WAAW,CACzB,GAAmB,EACnB,MAAgB,EAChB,EACE,MAAM,GAAG,GAAG,EACZ,WAAW,GAAG,0BAA0B,MAChB,EAAE;IAE5B,GAAG,CAAC,UAAU,GAAG,MAAM,CAAA;IACvB,GAAG,CAAC,SAAS,CAA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WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,CAAA;IACzC,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,SAAS,CACvB,GAAmB,EACnB,IAAqB,EACrB,EAAE,WAAW,GAAG,WAAW,EAAE,GAAG,OAAO,KAA2B,EAAE;IAEpE,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,CAAC,CAAA;AACrD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../src/oauth-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAEL,gBAAgB,EAChB,uCAAuC,EACvC,4BAA4B,EAC5B,4BAA4B,EAC5B,mCAAmC,EACnC,8BAA8B,EAC9B,gCAAgC,EAChC,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,EAC1B,gBAAgB,EAChB,kCAAkC,EAClC,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EAQf,MAAM,sBAAsB,CAAA;
|
1
|
+
{"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../src/oauth-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAEL,gBAAgB,EAChB,uCAAuC,EACvC,4BAA4B,EAC5B,4BAA4B,EAC5B,mCAAmC,EACnC,8BAA8B,EAC9B,gCAAgC,EAChC,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,EAC1B,gBAAgB,EAChB,kCAAkC,EAClC,wBAAwB,EACxB,iBAAiB,EACjB,kBA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IAAI,EACR,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;IAKnD,WAAW,CAChB,CAAC,GAAG,IAAI,EACR,GAAG,SAAS,eAAe,GAAG,eAAe,EAC7C,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC;CAsfpC"}
|
package/dist/oauth-provider.js
CHANGED
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
22
|
__setModuleDefault(result, mod);
|
23
23
|
return result;
|
24
24
|
};
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
+
};
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
29
|
exports.OAuthProvider = exports.Keyset = void 0;
|
27
30
|
const fetch_node_1 = require("@atproto-labs/fetch-node");
|
@@ -29,6 +32,8 @@ const simple_store_memory_1 = require("@atproto-labs/simple-store-memory");
|
|
29
32
|
const jwk_1 = require("@atproto/jwk");
|
30
33
|
Object.defineProperty(exports, "Keyset", { enumerable: true, get: function () { return jwk_1.Keyset; } });
|
31
34
|
const oauth_types_1 = require("@atproto/oauth-types");
|
35
|
+
const accept_1 = require("@hapi/accept");
|
36
|
+
const http_errors_1 = __importDefault(require("http-errors"));
|
32
37
|
const zod_1 = __importStar(require("zod"));
|
33
38
|
const access_token_type_js_1 = require("./access-token/access-token-type.js");
|
34
39
|
const account_manager_js_1 = require("./account/account-manager.js");
|
@@ -519,7 +524,7 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
|
|
519
524
|
res.setHeader('Cache-Control', 'max-age=300');
|
520
525
|
next();
|
521
526
|
},
|
522
|
-
(0, index_js_1.
|
527
|
+
(0, index_js_1.staticJsonMiddleware)(json),
|
523
528
|
]);
|
524
529
|
/**
|
525
530
|
* Wrap an OAuth endpoint in a middleware that will set the appropriate
|
@@ -539,11 +544,18 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
|
|
539
544
|
res.appendHeader('Access-Control-Expose-Headers', name);
|
540
545
|
}
|
541
546
|
try {
|
547
|
+
// Ensure we can agree on a content encoding & type before starting to
|
548
|
+
// build the JSON response.
|
549
|
+
if (!(0, accept_1.mediaType)(req.headers['accept'], ['application/json'])) {
|
550
|
+
throw (0, http_errors_1.default)(406, 'Unsupported media type');
|
551
|
+
}
|
542
552
|
const result = await buildJson.call(this, req, res);
|
543
|
-
if (result !== undefined)
|
544
|
-
(0, index_js_1.writeJson)(res, result, status);
|
545
|
-
|
553
|
+
if (result !== undefined) {
|
554
|
+
(0, index_js_1.writeJson)(res, result, { status });
|
555
|
+
}
|
556
|
+
else if (!res.headersSent) {
|
546
557
|
res.writeHead(status ?? 204).end();
|
558
|
+
}
|
547
559
|
}
|
548
560
|
catch (err) {
|
549
561
|
if (!res.headersSent) {
|
@@ -552,7 +564,9 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
|
|
552
564
|
res.setHeader(name, err.wwwAuthenticateHeader);
|
553
565
|
res.appendHeader('Access-Control-Expose-Headers', name);
|
554
566
|
}
|
555
|
-
|
567
|
+
const payload = (0, build_error_payload_js_1.buildErrorPayload)(err);
|
568
|
+
const status = (0, build_error_payload_js_1.buildErrorStatus)(err);
|
569
|
+
(0, index_js_1.writeJson)(res, payload, { status });
|
556
570
|
}
|
557
571
|
else {
|
558
572
|
res.destroy();
|
@@ -574,10 +588,6 @@ class OAuthProvider extends oauth_verifier_js_1.OAuthVerifier {
|
|
574
588
|
(0, index_js_1.validateFetchDest)(req, res, ['document']);
|
575
589
|
(0, index_js_1.validateSameOrigin)(req, res, issuerOrigin);
|
576
590
|
await handler.call(this, req, res);
|
577
|
-
// Should never happen (fool proofing)
|
578
|
-
if (!res.headersSent) {
|
579
|
-
throw new Error('Navigation handler did not send a response');
|
580
|
-
}
|
581
591
|
}
|
582
592
|
catch (err) {
|
583
593
|
onError?.(req, res, err, `Failed to handle navigation request to "${req.url}"`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oauth-provider.js","sourceRoot":"","sources":["../src/oauth-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAwD;AAExD,2EAAqE;AACrE,sCAA2C;AA0HzC,uFA1Ha,YAAM,OA0Hb;AAzHR,sDA0B6B;AAE7B,2CAAiC;AAEjC,8EAAqE;AACrE,qEAA6D;AAC7D,iEAMmC;AAEnC,wEAAyE;AACzE,4DAAuE;AACvE,wDAAgE;AAChE,kEAGmC;AACnC,8DAAqE;AAErE,iDAAsE;AAEtE,kEAA0D;AAC1D,8DAAqE;AACrE,4EAAmE;AACnE,sGAA4F;AAC5F,kFAAyE;AACzE,8EAAqE;AACrE,4EAAmE;AACnE,sFAA6E;AAC7E,gFAAuE;AACvE,8EAAqE;AACrE,4DAAoD;AACpD,wFAA+E;AAC/E,kFAAyE;AACzE,kDAiB4B;AAC5B,gDAAuE;AAEvE,oEAA4E;AAE5E,2DAAyE;AAEzE,4EAGwC;AAExC,kEAA0D;AAC1D,oFAG4C;AAC5C,8DAAqE;AACrE,+CAA8C;AAE9C,qEAA6D;AAC7D,+EAAsE;AACtE,6EAAoE;AACpE,iEAAyE;AACzE,6DAAuE;AACvE,qDAA+C;AAC/C,+DAAuD;AACvD,2DAAiE;AA8GjE,MAAa,aAAc,SAAQ,iCAAa;IAC9B,QAAQ,CAAkC;IAC1C,aAAa,CAAgB;IAE7B,oBAAoB,CAAQ;IAE5B,cAAc,CAAgB;IAC9B,WAAW,CAAa;IACxB,aAAa,CAAe;IAC5B,cAAc,CAAgB;IAC9B,YAAY,CAAc;IAE1C,YAAmB,EACjB,QAAQ,EACR,aAAa,GAAG,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AiB,CACzB,sBAAsB,CAAC,GAAG,CAAC,IAAI,eAAe,EAC9C,GAAG,CACJ,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAY;IACtC,MAAM,IAAI,4CAAkB,CAC1B,sBAAsB,CAAC,GAAG,CAAC,IAAI,8BAA8B,EAC7D,GAAG,CACJ,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAY;IACvC,MAAM,IAAI,8CAAmB,CAC3B,sBAAsB,CAAC,GAAG,CAAC,IAAI,wBAAwB,EACvD,GAAG,CACJ,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,GAAY;IAC1C,IAAI,GAAG,YAAY,cAAQ,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAC3B,IAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;YACvB,6CAA6C;YAC7C,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAA;YAClC,OAAO,kBAAkB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,sBAAsB,KAAK,CAAC,OAAO,EAAE,CAAA;QACvF,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ServerResponse } from 'node:http';
|
2
2
|
import { BuildDocumentOptions, Html } from '../lib/html/index.js';
|
3
|
+
import { WriteResponseOptions } from '../lib/http/response.js';
|
3
4
|
export declare function declareBackendData(name: string, data: unknown): Html;
|
4
|
-
export
|
5
|
-
|
6
|
-
}): Promise<void>;
|
5
|
+
export type SendWebPageOptions = BuildDocumentOptions & WriteResponseOptions;
|
6
|
+
export declare function sendWebPage(res: ServerResponse, options: SendWebPageOptions): Promise<void>;
|
7
7
|
//# sourceMappingURL=send-web-page.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-web-page.d.ts","sourceRoot":"","sources":["../../src/output/send-web-page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,OAAO,EAGL,oBAAoB,EACpB,IAAI,EAEL,MAAM,sBAAsB,CAAA;
|
1
|
+
{"version":3,"file":"send-web-page.d.ts","sourceRoot":"","sources":["../../src/output/send-web-page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,OAAO,EAGL,oBAAoB,EACpB,IAAI,EAEL,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAa,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEzE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,QAM7D;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG,oBAAoB,CAAA;AAE5E,wBAAsB,WAAW,CAC/B,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
@@ -12,7 +12,7 @@ function declareBackendData(name, data) {
|
|
12
12
|
// "readBackendData" in "src/assets/app/backend-data.ts".
|
13
13
|
return (0, index_js_1.js) `window[${name}]=${data};document.currentScript.remove();`;
|
14
14
|
}
|
15
|
-
async function sendWebPage(res,
|
15
|
+
async function sendWebPage(res, options) {
|
16
16
|
// @TODO: make these headers configurable (?)
|
17
17
|
res.setHeader('Permissions-Policy', 'otp-credentials=*, document-domain=()');
|
18
18
|
res.setHeader('Cross-Origin-Embedder-Policy', 'credentialless');
|
@@ -35,7 +35,7 @@ async function sendWebPage(res, { status = 200, ...options }) {
|
|
35
35
|
`upgrade-insecure-requests`,
|
36
36
|
].join('; '));
|
37
37
|
const html = (0, index_js_1.buildDocument)(options);
|
38
|
-
return (0, response_js_1.writeHtml)(res, html.toString(),
|
38
|
+
return (0, response_js_1.writeHtml)(res, html.toString(), options);
|
39
39
|
}
|
40
40
|
function assetToHash(asset) {
|
41
41
|
return asset instanceof index_js_1.Html
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-web-page.js","sourceRoot":"","sources":["../../src/output/send-web-page.ts"],"names":[],"mappings":";;AAYA,gDAMC;
|
1
|
+
{"version":3,"file":"send-web-page.js","sourceRoot":"","sources":["../../src/output/send-web-page.ts"],"names":[],"mappings":";;AAYA,gDAMC;AAID,kCAoCC;AA1DD,6CAAwC;AAGxC,mDAM6B;AAC7B,yDAAyE;AAEzE,SAAgB,kBAAkB,CAAC,IAAY,EAAE,IAAa;IAC5D,8EAA8E;IAC9E,8EAA8E;IAC9E,8DAA8D;IAC9D,yDAAyD;IACzD,OAAO,IAAA,aAAE,EAAA,UAAU,IAAI,KAAK,IAAI,mCAAmC,CAAA;AACrE,CAAC;AAIM,KAAK,UAAU,WAAW,CAC/B,GAAmB,EACnB,OAA2B;IAE3B,6CAA6C;IAC7C,GAAG,CAAC,SAAS,CAAC,oBAAoB,EAAE,uCAAuC,CAAC,CAAA;IAC5E,GAAG,CAAC,SAAS,CAAC,8BAA8B,EAAE,gBAAgB,CAAC,CAAA;IAC/D,GAAG,CAAC,SAAS,CAAC,8BAA8B,EAAE,aAAa,CAAC,CAAA;IAC5D,GAAG,CAAC,SAAS,CAAC,4BAA4B,EAAE,aAAa,CAAC,CAAA;IAC1D,GAAG,CAAC,SAAS,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;IAC/C,GAAG,CAAC,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;IACxC,GAAG,CAAC,SAAS,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAA;IAClD,GAAG,CAAC,SAAS,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAA;IACtC,GAAG,CAAC,SAAS,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAA;IAC9D,GAAG,CAAC,SAAS,CACX,yBAAyB,EACzB;QACE,oBAAoB;QACpB,wBAAwB;QACxB,oBAAoB;QACpB,YAAY,OAAO,CAAC,IAAI,EAAE,MAAM,IAAI,QAAQ,EAAE;QAC9C,qBACE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EACpE,EAAE;QACF,oBACE,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EACnE,EAAE;QACF,6BAA6B;QAC7B,oBAAoB;QACpB,2BAA2B;KAC5B,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAA;IAED,MAAM,IAAI,GAAG,IAAA,wBAAa,EAAC,OAAO,CAAC,CAAA;IAEnC,OAAO,IAAA,uBAAS,EAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,WAAW,CAAC,KAAsB;IACzC,OAAO,KAAK,YAAY,eAAI;QAC1B,CAAC,CAAC,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAA;AAClB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,WAAW,IAAI,GAAG,CAAA;AAC3B,CAAC"}
|
package/package.json
CHANGED
@@ -41,6 +41,6 @@ export function authorizeAssetsMiddleware(): Middleware {
|
|
41
41
|
res.setHeader('Cache-Control', 'public, max-age=31536000, immutable')
|
42
42
|
}
|
43
43
|
|
44
|
-
|
44
|
+
writeStream(res, asset.createStream(), { contentType: asset.type })
|
45
45
|
}
|
46
46
|
}
|
package/src/lib/http/accept.ts
CHANGED
package/src/lib/http/response.ts
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { pipeline } from 'node:stream/promises'
|
3
|
-
import { constants, createBrotliCompress, createGzip } from 'node:zlib'
|
1
|
+
import { Readable, pipeline } from 'node:stream'
|
4
2
|
|
5
3
|
import { Handler, ServerResponse } from './types.js'
|
6
4
|
|
@@ -26,108 +24,69 @@ export function writeRedirect(
|
|
26
24
|
res.writeHead(status, { Location: url }).end()
|
27
25
|
}
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
return 'identity'
|
27
|
+
export type WriteResponseOptions = {
|
28
|
+
status?: number
|
29
|
+
contentType?: string
|
33
30
|
}
|
34
31
|
|
35
|
-
function
|
36
|
-
switch (encoding) {
|
37
|
-
case 'br':
|
38
|
-
return createBrotliCompress({
|
39
|
-
// Default quality is too slow
|
40
|
-
params: { [constants.BROTLI_PARAM_QUALITY]: 5 },
|
41
|
-
})
|
42
|
-
case 'gzip':
|
43
|
-
return createGzip()
|
44
|
-
case 'identity':
|
45
|
-
return new PassThrough()
|
46
|
-
default:
|
47
|
-
throw new Error(`Unsupported encoding: ${encoding}`)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
const ifString = (value: unknown): string | undefined =>
|
52
|
-
typeof value === 'string' ? value : undefined
|
53
|
-
|
54
|
-
export async function writeStream(
|
32
|
+
export function writeStream(
|
55
33
|
res: ServerResponse,
|
56
34
|
stream: Readable,
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
35
|
+
{
|
36
|
+
status = 200,
|
37
|
+
contentType = 'application/octet-stream',
|
38
|
+
}: WriteResponseOptions = {},
|
39
|
+
): void {
|
61
40
|
res.statusCode = status
|
62
41
|
res.setHeader('content-type', contentType)
|
63
|
-
appendHeader(res, 'vary', 'accept-encoding')
|
64
|
-
|
65
|
-
const encoding = negotiateEncoding(res.req.headers['accept-encoding'])
|
66
|
-
|
67
|
-
res.setHeader('content-encoding', encoding)
|
68
|
-
res.setHeader('transfer-encoding', 'chunked')
|
69
42
|
|
70
43
|
if (res.req.method === 'HEAD') {
|
71
44
|
res.end()
|
72
45
|
stream.destroy()
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
await pipeline(stream, getEncoder(encoding), res)
|
78
|
-
} catch (err) {
|
79
|
-
// Prevent the socket from being left open in a bad state
|
80
|
-
res.socket?.destroy()
|
81
|
-
|
82
|
-
if (err != null && typeof err === 'object') {
|
83
|
-
// If an abort signal is used, we can consider this function's job successful
|
84
|
-
if ('name' in err && err.name === 'AbortError') return
|
85
|
-
|
86
|
-
// If the client closes the connection, we don't care about the error
|
87
|
-
if ('code' in err && err.code === 'ERR_STREAM_PREMATURE_CLOSE') return
|
88
|
-
}
|
89
|
-
|
90
|
-
throw err
|
46
|
+
} else {
|
47
|
+
pipeline([stream, res], (_err: Error | null) => {
|
48
|
+
// The error will be propagated through the streams
|
49
|
+
})
|
91
50
|
}
|
92
51
|
}
|
93
52
|
|
94
|
-
export
|
53
|
+
export function writeBuffer(
|
95
54
|
res: ServerResponse,
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
55
|
+
chunk: string | Buffer,
|
56
|
+
{
|
57
|
+
status = 200,
|
58
|
+
contentType = 'application/octet-stream',
|
59
|
+
}: WriteResponseOptions = {},
|
60
|
+
): void {
|
61
|
+
res.statusCode = status
|
62
|
+
res.setHeader('content-type', contentType)
|
63
|
+
res.end(chunk)
|
102
64
|
}
|
103
65
|
|
104
|
-
export
|
66
|
+
export function writeJson(
|
105
67
|
res: ServerResponse,
|
106
68
|
payload: unknown,
|
107
|
-
|
108
|
-
|
109
|
-
): Promise<void> {
|
69
|
+
{ contentType = 'application/json', ...options }: WriteResponseOptions = {},
|
70
|
+
): void {
|
110
71
|
const buffer = Buffer.from(JSON.stringify(payload))
|
111
|
-
|
72
|
+
writeBuffer(res, buffer, { ...options, contentType })
|
112
73
|
}
|
113
74
|
|
114
|
-
export function
|
75
|
+
export function staticJsonMiddleware(
|
115
76
|
value: unknown,
|
116
|
-
contentType = 'application/json',
|
117
|
-
status = 200,
|
77
|
+
{ contentType = 'application/json', ...options }: WriteResponseOptions = {},
|
118
78
|
): Handler<unknown> {
|
119
79
|
const buffer = Buffer.from(JSON.stringify(value))
|
120
|
-
|
121
|
-
|
80
|
+
const staticOptions: WriteResponseOptions = { ...options, contentType }
|
81
|
+
return function (req, res) {
|
82
|
+
writeBuffer(res, buffer, staticOptions)
|
122
83
|
}
|
123
84
|
}
|
124
85
|
|
125
|
-
export
|
86
|
+
export function writeHtml(
|
126
87
|
res: ServerResponse,
|
127
88
|
html: Buffer | string,
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
const buffer = Buffer.isBuffer(html) ? html : Buffer.from(html)
|
132
|
-
return writeBuffer(res, buffer, contentType, status)
|
89
|
+
{ contentType = 'text/html', ...options }: WriteResponseOptions = {},
|
90
|
+
): void {
|
91
|
+
writeBuffer(res, html, { ...options, contentType })
|
133
92
|
}
|
package/src/oauth-provider.ts
CHANGED
@@ -29,6 +29,8 @@ import {
|
|
29
29
|
oauthTokenIdentificationSchema,
|
30
30
|
oauthTokenRequestSchema,
|
31
31
|
} from '@atproto/oauth-types'
|
32
|
+
import { mediaType } from '@hapi/accept'
|
33
|
+
import createHttpError from 'http-errors'
|
32
34
|
import type { Redis, RedisOptions } from 'ioredis'
|
33
35
|
import z, { ZodError } from 'zod'
|
34
36
|
|
@@ -75,7 +77,7 @@ import {
|
|
75
77
|
combineMiddlewares,
|
76
78
|
parseHttpRequest,
|
77
79
|
setupCsrfToken,
|
78
|
-
|
80
|
+
staticJsonMiddleware,
|
79
81
|
validateCsrfToken,
|
80
82
|
validateFetchDest,
|
81
83
|
validateFetchMode,
|
@@ -1028,7 +1030,7 @@ export class OAuthProvider extends OAuthVerifier {
|
|
1028
1030
|
res.setHeader('Cache-Control', 'max-age=300')
|
1029
1031
|
next()
|
1030
1032
|
},
|
1031
|
-
|
1033
|
+
staticJsonMiddleware(json),
|
1032
1034
|
])
|
1033
1035
|
|
1034
1036
|
/**
|
@@ -1056,9 +1058,18 @@ export class OAuthProvider extends OAuthVerifier {
|
|
1056
1058
|
}
|
1057
1059
|
|
1058
1060
|
try {
|
1061
|
+
// Ensure we can agree on a content encoding & type before starting to
|
1062
|
+
// build the JSON response.
|
1063
|
+
if (!mediaType(req.headers['accept'], ['application/json'])) {
|
1064
|
+
throw createHttpError(406, 'Unsupported media type')
|
1065
|
+
}
|
1066
|
+
|
1059
1067
|
const result = await buildJson.call(this, req, res)
|
1060
|
-
if (result !== undefined)
|
1061
|
-
|
1068
|
+
if (result !== undefined) {
|
1069
|
+
writeJson(res, result, { status })
|
1070
|
+
} else if (!res.headersSent) {
|
1071
|
+
res.writeHead(status ?? 204).end()
|
1072
|
+
}
|
1062
1073
|
} catch (err) {
|
1063
1074
|
if (!res.headersSent) {
|
1064
1075
|
if (err instanceof WWWAuthenticateError) {
|
@@ -1067,7 +1078,9 @@ export class OAuthProvider extends OAuthVerifier {
|
|
1067
1078
|
res.appendHeader('Access-Control-Expose-Headers', name)
|
1068
1079
|
}
|
1069
1080
|
|
1070
|
-
|
1081
|
+
const payload = buildErrorPayload(err)
|
1082
|
+
const status = buildErrorStatus(err)
|
1083
|
+
writeJson(res, payload, { status })
|
1071
1084
|
} else {
|
1072
1085
|
res.destroy()
|
1073
1086
|
}
|
@@ -1096,11 +1109,6 @@ export class OAuthProvider extends OAuthVerifier {
|
|
1096
1109
|
validateSameOrigin(req, res, issuerOrigin)
|
1097
1110
|
|
1098
1111
|
await handler.call(this, req, res)
|
1099
|
-
|
1100
|
-
// Should never happen (fool proofing)
|
1101
|
-
if (!res.headersSent) {
|
1102
|
-
throw new Error('Navigation handler did not send a response')
|
1103
|
-
}
|
1104
1112
|
} catch (err) {
|
1105
1113
|
onError?.(
|
1106
1114
|
req,
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
Html,
|
9
9
|
js,
|
10
10
|
} from '../lib/html/index.js'
|
11
|
-
import { writeHtml } from '../lib/http/response.js'
|
11
|
+
import { writeHtml, WriteResponseOptions } from '../lib/http/response.js'
|
12
12
|
|
13
13
|
export function declareBackendData(name: string, data: unknown) {
|
14
14
|
// The script tag is removed after the data is assigned to the global variable
|
@@ -18,9 +18,11 @@ export function declareBackendData(name: string, data: unknown) {
|
|
18
18
|
return js`window[${name}]=${data};document.currentScript.remove();`
|
19
19
|
}
|
20
20
|
|
21
|
+
export type SendWebPageOptions = BuildDocumentOptions & WriteResponseOptions
|
22
|
+
|
21
23
|
export async function sendWebPage(
|
22
24
|
res: ServerResponse,
|
23
|
-
|
25
|
+
options: SendWebPageOptions,
|
24
26
|
): Promise<void> {
|
25
27
|
// @TODO: make these headers configurable (?)
|
26
28
|
res.setHeader('Permissions-Policy', 'otp-credentials=*, document-domain=()')
|
@@ -53,7 +55,7 @@ export async function sendWebPage(
|
|
53
55
|
|
54
56
|
const html = buildDocument(options)
|
55
57
|
|
56
|
-
return writeHtml(res, html.toString(),
|
58
|
+
return writeHtml(res, html.toString(), options)
|
57
59
|
}
|
58
60
|
|
59
61
|
function assetToHash(asset: Html | AssetRef): string {
|