@fedify/fedify 0.12.0-dev.282 → 0.12.0-dev.284
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGES.md +19 -0
- package/esm/federation/middleware.js +0 -8
- package/esm/mod.js +0 -1
- package/esm/x/astro.js +84 -0
- package/package.json +7 -7
- package/types/federation/context.d.ts +0 -7
- package/types/federation/context.d.ts.map +1 -1
- package/types/federation/middleware.d.ts.map +1 -1
- package/types/mod.d.ts +0 -1
- package/types/mod.d.ts.map +1 -1
- package/types/testing/context.d.ts.map +1 -1
- package/types/x/astro.d.ts +83 -0
- package/types/x/astro.d.ts.map +1 -0
- package/esm/httpsig/mod.js +0 -104
- package/types/httpsig/mod.d.ts +0 -108
- package/types/httpsig/mod.d.ts.map +0 -1
- package/types/httpsig/mod.test.d.ts.map +0 -1
package/CHANGES.md
CHANGED
@@ -77,6 +77,16 @@ To be released.
|
|
77
77
|
- The last parameter of `Federation.sendActivity()` method is no longer
|
78
78
|
optional. Also, it now takes the required `contextData` option.
|
79
79
|
|
80
|
+
- Removed `Context.getHandleFromActorUri()` method which was deprecated in
|
81
|
+
version 0.9.0. Use `Context.parseUri()` method instead.
|
82
|
+
|
83
|
+
- Removed `@fedify/fedify/httpsig` module which was deprecated in version
|
84
|
+
0.9.0. Use `@fedify/fedify/sig` module instead.
|
85
|
+
|
86
|
+
- Removed `sign()` function.
|
87
|
+
- Removed `verify()` function.
|
88
|
+
- Removed `VerifyOptions` interface.
|
89
|
+
|
80
90
|
- Fixed a SSRF vulnerability in the built-in document loader.
|
81
91
|
[[CVE-2024-39687]]
|
82
92
|
|
@@ -86,17 +96,26 @@ To be released.
|
|
86
96
|
loader that throws an error when the given URL is not an HTTP or HTTPS
|
87
97
|
URL or refers to a private network address.
|
88
98
|
|
99
|
+
- Added `@fedify/fedify/x/astro` module for integrating with [Astro]
|
100
|
+
middleware. [[#50]]
|
101
|
+
|
102
|
+
- Added `createMiddleware()` function.
|
103
|
+
- Added `createFetchOptions()` function.
|
104
|
+
- Added `ContextDataFactory` type.
|
105
|
+
|
89
106
|
- Added more log messages using the [LogTape] library. Currently the below
|
90
107
|
logger categories are used:
|
91
108
|
|
92
109
|
- `["fedify", "federation", "queue"]`
|
93
110
|
|
111
|
+
[#50]: https://github.com/dahlia/fedify/issues/50
|
94
112
|
[#53]: https://github.com/dahlia/fedify/issues/53
|
95
113
|
[#66]: https://github.com/dahlia/fedify/issues/66
|
96
114
|
[#70]: https://github.com/dahlia/fedify/issues/70
|
97
115
|
[#81]: https://github.com/dahlia/fedify/issues/81
|
98
116
|
[#85]: https://github.com/dahlia/fedify/issues/85
|
99
117
|
[#92]: https://github.com/dahlia/fedify/pull/92
|
118
|
+
[Astro]: https://astro.build/
|
100
119
|
|
101
120
|
|
102
121
|
Version 0.11.2
|
@@ -1438,14 +1438,6 @@ class ContextImpl {
|
|
1438
1438
|
}
|
1439
1439
|
return null;
|
1440
1440
|
}
|
1441
|
-
getHandleFromActorUri(actorUri) {
|
1442
|
-
getLogger(["fedify", "federation"]).warn("Context.getHandleFromActorUri() is deprecated; " +
|
1443
|
-
"use Context.parseUri() instead.");
|
1444
|
-
const result = this.parseUri(actorUri);
|
1445
|
-
if (result?.type === "actor")
|
1446
|
-
return result.handle;
|
1447
|
-
return null;
|
1448
|
-
}
|
1449
1441
|
async getActorKeyPairs(handle) {
|
1450
1442
|
const logger = getLogger(["fedify", "federation", "actor"]);
|
1451
1443
|
if (this.#invokedFromActorKeyPairsDispatcher != null) {
|
package/esm/mod.js
CHANGED
package/esm/x/astro.js
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
/**
|
2
|
+
* Create options for the {@link Federation.fetch} method to integrate with
|
3
|
+
* Astro.
|
4
|
+
*
|
5
|
+
* @example src/middleware.ts
|
6
|
+
* ``` typescript
|
7
|
+
* import { defineMiddleware } from "astro:middleware";
|
8
|
+
* import { federation } from "./federation"; // Import the `Federation` object
|
9
|
+
*
|
10
|
+
* export const onRequest = defineMiddleware((context, next) => {
|
11
|
+
* return federation.fetch(context.request, {
|
12
|
+
* contextData: undefined,
|
13
|
+
* ...createFetchOptions(context, next),
|
14
|
+
* });
|
15
|
+
* });
|
16
|
+
* ```
|
17
|
+
*
|
18
|
+
* @typeParam TAstroContext A type of the Astro context.
|
19
|
+
* @param context An Astro context.
|
20
|
+
* @param next A function to call the next middleware.
|
21
|
+
* @returns Options for the {@link Federation.fetch} method.
|
22
|
+
* @since 0.12.0
|
23
|
+
*/
|
24
|
+
export function createFetchOptions(_context, next) {
|
25
|
+
return {
|
26
|
+
// If the `federation` object finds a request not responsible for it
|
27
|
+
// (i.e., not a federation-related request), it will call the `next`
|
28
|
+
// provided by the Astro framework to continue the request handling
|
29
|
+
// by Astro:
|
30
|
+
onNotFound: next,
|
31
|
+
// Similar to `onNotFound`, but slightly more tricky one.
|
32
|
+
// When the `federation` object finds a request not acceptable type-wise
|
33
|
+
// (i.e., a user-agent doesn't want JSON-LD), it will call the `next`
|
34
|
+
// provided by the Astro framework so that it renders HTML if there's some
|
35
|
+
// page. Otherwise, it will simply return a 406 Not Acceptable response.
|
36
|
+
// This kind of trick enables the Fedify and Astro to share the same routes
|
37
|
+
// and they do content negotiation depending on `Accept` header:
|
38
|
+
async onNotAcceptable(_request) {
|
39
|
+
const response = await next();
|
40
|
+
if (response.status !== 404)
|
41
|
+
return response;
|
42
|
+
return new Response("Not acceptable", {
|
43
|
+
status: 406,
|
44
|
+
headers: {
|
45
|
+
"Content-Type": "text/plain",
|
46
|
+
Vary: "Accept",
|
47
|
+
},
|
48
|
+
});
|
49
|
+
},
|
50
|
+
};
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Create an Astro middleware handler to integrate with the {@link Federation}
|
54
|
+
* object.
|
55
|
+
*
|
56
|
+
* @example src/middleware.ts
|
57
|
+
* ``` typescript
|
58
|
+
* import type { MiddlewareHandler } from "astro";
|
59
|
+
* import { federation } from "./federation"; // Import the `Federation` object
|
60
|
+
*
|
61
|
+
* export const onRequest: MiddlewareHandler = createMiddleware(
|
62
|
+
* federation,
|
63
|
+
* (astroContext) => "context data",
|
64
|
+
* );
|
65
|
+
* ```
|
66
|
+
*
|
67
|
+
* @typeParam TContextData A type of the context data for the {@link Federation}
|
68
|
+
* object.
|
69
|
+
* @typeParam TAstroContext A type of the Astro context.
|
70
|
+
* @param federation A {@link Federation} object to integrate with Astro.
|
71
|
+
* @param contextDataFactory A factory function to create a context data for the
|
72
|
+
* {@link Federation} object.
|
73
|
+
* @returns An Astro middleware handler.
|
74
|
+
* @since 0.12.0
|
75
|
+
*/
|
76
|
+
export function createMiddleware(federation, contextDataFactory) {
|
77
|
+
return async (context, next) => {
|
78
|
+
const contextData = await contextDataFactory(context);
|
79
|
+
return await federation.fetch(context.request, {
|
80
|
+
contextData,
|
81
|
+
...createFetchOptions(context, next),
|
82
|
+
});
|
83
|
+
};
|
84
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fedify/fedify",
|
3
|
-
"version": "0.12.0-dev.
|
3
|
+
"version": "0.12.0-dev.284+5b347b26",
|
4
4
|
"description": "An ActivityPub server framework",
|
5
5
|
"keywords": [
|
6
6
|
"ActivityPub",
|
@@ -35,12 +35,6 @@
|
|
35
35
|
"default": "./esm/federation/mod.js"
|
36
36
|
}
|
37
37
|
},
|
38
|
-
"./httpsig": {
|
39
|
-
"import": {
|
40
|
-
"types": "./types/httpsig/mod.d.ts",
|
41
|
-
"default": "./esm/httpsig/mod.js"
|
42
|
-
}
|
43
|
-
},
|
44
38
|
"./nodeinfo": {
|
45
39
|
"import": {
|
46
40
|
"types": "./types/nodeinfo/mod.d.ts",
|
@@ -71,6 +65,12 @@
|
|
71
65
|
"default": "./esm/webfinger/mod.js"
|
72
66
|
}
|
73
67
|
},
|
68
|
+
"./x/astro": {
|
69
|
+
"import": {
|
70
|
+
"types": "./types/x/astro.d.ts",
|
71
|
+
"default": "./esm/x/astro.js"
|
72
|
+
}
|
73
|
+
},
|
74
74
|
"./x/hono": {
|
75
75
|
"import": {
|
76
76
|
"types": "./types/x/hono.d.ts",
|
@@ -131,13 +131,6 @@ export interface Context<TContextData> {
|
|
131
131
|
* @since 0.9.0
|
132
132
|
*/
|
133
133
|
parseUri(uri: URL): ParseUriResult | null;
|
134
|
-
/**
|
135
|
-
* Extracts the actor's handle from an actor URI, if it is a valid actor URI.
|
136
|
-
* @param actorUri The actor's URI.
|
137
|
-
* @returns The actor's handle, or `null` if the URI is not a valid actor URI.
|
138
|
-
* @deprecated Use {@link Context.parseUri} instead.
|
139
|
-
*/
|
140
|
-
getHandleFromActorUri(actorUri: URL): string | null;
|
141
134
|
/**
|
142
135
|
* Gets the key pairs for an actor.
|
143
136
|
* @param handle The actor's handle.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/federation/context.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,OAAO,CAAC,YAAY;IACnC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,cA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AC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,YAAY;IAChD;;;;;;OAMG;IACH,EAAE,CAAC,SAAS,SAAS,QAAQ,EAE3B,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,SAAS,EACvC,QAAQ,EAAE,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,GAC/C,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAEtC;;;;;;OAMG;IACH,OAAO,CACL,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAAC,GACvC,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAEtC;;;;;;;;OAQG;IACH,sBAAsB,CACpB,UAAU,EAAE,wBAAwB,CAAC,YAAY,CAAC,GACjD,oBAAoB,CAAC,YAAY,CAAC,CAAC;CACvC;AAED,UAAU,2BAA2B,CAAC,YAAY,CAChD,SAAQ,mBAAmB;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,YAAY,CAAC;CAC3B"}
|
package/types/mod.d.ts
CHANGED
package/types/mod.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,cAAc,qBAAqB,CAAC;AACpC,
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/testing/context.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAKxE,wBAAgB,aAAa,CAAC,YAAY,EACxC,EACE,GAAG,EACH,IAAI,EACJ,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,YAAY,GACb,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GACpE,OAAO,CAAC,YAAY,CAAC,
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/testing/context.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAKxE,wBAAgB,aAAa,CAAC,YAAY,EACxC,EACE,GAAG,EACH,IAAI,EACJ,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,YAAY,GACb,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GACpE,OAAO,CAAC,YAAY,CAAC,CAuDvB;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAC/C,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,GAAG;IAC5C,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,YAAY,CAAC;CACpB,GACA,cAAc,CAAC,YAAY,CAAC,CAa9B"}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
/// <reference types="node" />
|
3
|
+
/**
|
4
|
+
* Fedify with Astro
|
5
|
+
* =================
|
6
|
+
*
|
7
|
+
* This module contains some utilities for integrating Fedify with
|
8
|
+
* the [Astro] framework.
|
9
|
+
*
|
10
|
+
* [Astro]: https://astro.build/
|
11
|
+
*
|
12
|
+
* @module
|
13
|
+
* @since 0.12.0
|
14
|
+
*/
|
15
|
+
import type { Federation, FederationFetchOptions } from "../federation/middleware.js";
|
16
|
+
interface AstroContext {
|
17
|
+
request: Request;
|
18
|
+
}
|
19
|
+
type RewritePayload = string | URL | Request;
|
20
|
+
type MiddlewareNext = (rewritePayload?: RewritePayload) => Promise<Response>;
|
21
|
+
type MiddlewareHandler<TAstroContext extends AstroContext> = (context: TAstroContext, next: MiddlewareNext) => Promise<Response> | Response | Promise<void> | void;
|
22
|
+
/**
|
23
|
+
* Create options for the {@link Federation.fetch} method to integrate with
|
24
|
+
* Astro.
|
25
|
+
*
|
26
|
+
* @example src/middleware.ts
|
27
|
+
* ``` typescript
|
28
|
+
* import { defineMiddleware } from "astro:middleware";
|
29
|
+
* import { federation } from "./federation"; // Import the `Federation` object
|
30
|
+
*
|
31
|
+
* export const onRequest = defineMiddleware((context, next) => {
|
32
|
+
* return federation.fetch(context.request, {
|
33
|
+
* contextData: undefined,
|
34
|
+
* ...createFetchOptions(context, next),
|
35
|
+
* });
|
36
|
+
* });
|
37
|
+
* ```
|
38
|
+
*
|
39
|
+
* @typeParam TAstroContext A type of the Astro context.
|
40
|
+
* @param context An Astro context.
|
41
|
+
* @param next A function to call the next middleware.
|
42
|
+
* @returns Options for the {@link Federation.fetch} method.
|
43
|
+
* @since 0.12.0
|
44
|
+
*/
|
45
|
+
export declare function createFetchOptions<TAstroContext extends AstroContext>(_context: TAstroContext, next: MiddlewareNext): Omit<FederationFetchOptions<void>, "contextData">;
|
46
|
+
/**
|
47
|
+
* The factory function to create a context data for
|
48
|
+
* the {@link Federation.fetch}.
|
49
|
+
*
|
50
|
+
* @typeParam TContextData A type of the context data.
|
51
|
+
* @typeParam TAstroContext A type of the Astro context.
|
52
|
+
* @param context An Astro context.
|
53
|
+
* @returns The context data for the {@link Federation.fetch}.
|
54
|
+
* @since 0.12.0
|
55
|
+
*/
|
56
|
+
export type ContextDataFactory<TContextData, TAstroContext extends AstroContext> = (context: TAstroContext) => TContextData | Promise<TContextData>;
|
57
|
+
/**
|
58
|
+
* Create an Astro middleware handler to integrate with the {@link Federation}
|
59
|
+
* object.
|
60
|
+
*
|
61
|
+
* @example src/middleware.ts
|
62
|
+
* ``` typescript
|
63
|
+
* import type { MiddlewareHandler } from "astro";
|
64
|
+
* import { federation } from "./federation"; // Import the `Federation` object
|
65
|
+
*
|
66
|
+
* export const onRequest: MiddlewareHandler = createMiddleware(
|
67
|
+
* federation,
|
68
|
+
* (astroContext) => "context data",
|
69
|
+
* );
|
70
|
+
* ```
|
71
|
+
*
|
72
|
+
* @typeParam TContextData A type of the context data for the {@link Federation}
|
73
|
+
* object.
|
74
|
+
* @typeParam TAstroContext A type of the Astro context.
|
75
|
+
* @param federation A {@link Federation} object to integrate with Astro.
|
76
|
+
* @param contextDataFactory A factory function to create a context data for the
|
77
|
+
* {@link Federation} object.
|
78
|
+
* @returns An Astro middleware handler.
|
79
|
+
* @since 0.12.0
|
80
|
+
*/
|
81
|
+
export declare function createMiddleware<TContextData, TAstroContext extends AstroContext>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData, TAstroContext>): MiddlewareHandler<TAstroContext>;
|
82
|
+
export {};
|
83
|
+
//# sourceMappingURL=astro.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../src/x/astro.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AAErC,UAAU,YAAY;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AACD,KAAK,cAAc,GAAG,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC;AAC7C,KAAK,cAAc,GAAG,CACpB,cAAc,CAAC,EAAE,cAAc,KAC5B,OAAO,CAAC,QAAQ,CAAC,CAAC;AACvB,KAAK,iBAAiB,CAAC,aAAa,SAAS,YAAY,IAAI,CAC3D,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,cAAc,KACjB,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,SAAS,YAAY,EACnE,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,cAAc,GACnB,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CA2BnD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,CAC5B,YAAY,EACZ,aAAa,SAAS,YAAY,IAChC,CACF,OAAO,EAAE,aAAa,KACnB,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EACZ,aAAa,SAAS,YAAY,EAElC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,EACpC,kBAAkB,EAAE,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAC,GAClE,iBAAiB,CAAC,aAAa,CAAC,CAQlC"}
|
package/esm/httpsig/mod.js
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
import { getLogger } from "@logtape/logtape";
|
2
|
-
import { signRequest, verifyRequest, } from "../sig/http.js";
|
3
|
-
import { exportJwk as newExportJwk, generateCryptoKeyPair as newGenerateCryptoKeyPair, importJwk as newImportJwk, } from "../sig/key.js";
|
4
|
-
import { doesActorOwnKey as newDoesActorOwnKey, getKeyOwner as newGetKeyOwner, } from "../sig/owner.js";
|
5
|
-
/**
|
6
|
-
* Signs a request using the given private key.
|
7
|
-
* @param request The request to sign.
|
8
|
-
* @param privateKey The private key to use for signing.
|
9
|
-
* @param keyId The key ID to use for the signature. It will be used by the
|
10
|
-
* verifier.
|
11
|
-
* @returns The signed request.
|
12
|
-
* @throws {TypeError} If the private key is invalid or unsupported.
|
13
|
-
* @deprecated
|
14
|
-
*/
|
15
|
-
export function sign(request, privateKey, keyId) {
|
16
|
-
getLogger(["fedify", "httpsig", "sign"]).warn("The sign() function is deprecated. Use signRequest() instead.");
|
17
|
-
return signRequest(request, privateKey, keyId);
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* Verifies the signature of a request.
|
21
|
-
*
|
22
|
-
* Note that this function consumes the request body, so it should not be used
|
23
|
-
* if the request body is already consumed. Consuming the request body after
|
24
|
-
* calling this function is okay, since this function clones the request
|
25
|
-
* under the hood.
|
26
|
-
*
|
27
|
-
* @param request The request to verify.
|
28
|
-
* @param options Options for verifying the request.
|
29
|
-
* @returns The public key of the verified signature, or `null` if the signature
|
30
|
-
* could not be verified.
|
31
|
-
* @deprecated
|
32
|
-
*/
|
33
|
-
export function verify(request, options = {}) {
|
34
|
-
getLogger(["fedify", "httpsig", "verify"]).warn("The verify() function is deprecated. Use verifyRequest() instead.");
|
35
|
-
return verifyRequest(request, options);
|
36
|
-
}
|
37
|
-
/**
|
38
|
-
* Checks if the actor of the given activity owns the specified key.
|
39
|
-
* @param activity The activity to check.
|
40
|
-
* @param key The public key to check.
|
41
|
-
* @param options Options for checking the key ownership.
|
42
|
-
* @returns Whether the actor is the owner of the key.
|
43
|
-
* @deprecated
|
44
|
-
*/
|
45
|
-
export function doesActorOwnKey(activity, key, options) {
|
46
|
-
getLogger(["fedify", "httpsig"]).warn("The doesActorOwnKey() function from @fedify/fedify/httpsig is deprecated. " +
|
47
|
-
"Use doesActorOwnKey() from @fedify/fedify/sig instead.");
|
48
|
-
return newDoesActorOwnKey(activity, key, options);
|
49
|
-
}
|
50
|
-
/**
|
51
|
-
* Gets the actor that owns the specified key. Returns `null` if the key has no
|
52
|
-
* known owner.
|
53
|
-
*
|
54
|
-
* @param keyId The ID of the key to check, or the key itself.
|
55
|
-
* @param options Options for getting the key owner.
|
56
|
-
* @returns The actor that owns the key, or `null` if the key has no known
|
57
|
-
* owner.
|
58
|
-
* @since 0.7.0
|
59
|
-
* @deprecated
|
60
|
-
*/
|
61
|
-
export function getKeyOwner(keyId, options) {
|
62
|
-
getLogger(["fedify", "httpsig"]).warn("The getKeyOwner() function from @fedify/fedify/httpsig is deprecated. " +
|
63
|
-
"Use getKeyOwner() from @fedify/fedify/sig instead.");
|
64
|
-
return newGetKeyOwner(keyId, options);
|
65
|
-
}
|
66
|
-
/**
|
67
|
-
* Generates a key pair which is appropriate for Fedify.
|
68
|
-
* @returns The generated key pair.
|
69
|
-
* @since 0.3.0
|
70
|
-
* @deprecated
|
71
|
-
*/
|
72
|
-
export function generateCryptoKeyPair() {
|
73
|
-
getLogger(["fedify", "httpsig", "key"]).warn("The generateCryptoKeyPair() from @fedify/fedify/httpsig is deprecated. " +
|
74
|
-
"Please use generateKeyPair() from @fedify/fedify/sig instead.");
|
75
|
-
return newGenerateCryptoKeyPair();
|
76
|
-
}
|
77
|
-
/**
|
78
|
-
* Exports a key in JWK format.
|
79
|
-
* @param key The key to export. Either public or private key.
|
80
|
-
* @returns The exported key in JWK format. The key is suitable for
|
81
|
-
* serialization and storage.
|
82
|
-
* @throws {TypeError} If the key is invalid or unsupported.
|
83
|
-
* @since 0.3.0
|
84
|
-
* @deprecated
|
85
|
-
*/
|
86
|
-
export function exportJwk(key) {
|
87
|
-
getLogger(["fedify", "httpsig", "key"]).warn("The exportJwk() function from @fedify/fedify/httpsig is deprecated. " +
|
88
|
-
"Please use exportJwk() from @fedify/fedify/sig instead.");
|
89
|
-
return newExportJwk(key);
|
90
|
-
}
|
91
|
-
/**
|
92
|
-
* Imports a key from JWK format.
|
93
|
-
* @param jwk The key in JWK format.
|
94
|
-
* @param type Which type of key to import, either `"public"`" or `"private"`".
|
95
|
-
* @returns The imported key.
|
96
|
-
* @throws {TypeError} If the key is invalid or unsupported.
|
97
|
-
* @since 0.3.0
|
98
|
-
* @deprecated
|
99
|
-
*/
|
100
|
-
export function importJwk(jwk, type) {
|
101
|
-
getLogger(["fedify", "httpsig", "key"]).warn("The importJwk() function from @fedify/fedify/httpsig is deprecated. " +
|
102
|
-
"Please use importJwk() from @fedify/fedify/sig instead.");
|
103
|
-
return newImportJwk(jwk, type);
|
104
|
-
}
|
package/types/httpsig/mod.d.ts
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
|
-
/**
|
4
|
-
* The implementation of the [HTTP
|
5
|
-
* Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12).
|
6
|
-
*
|
7
|
-
* @module
|
8
|
-
* @deprecated
|
9
|
-
*/
|
10
|
-
import * as dntShim from "../_dnt.shims.js";
|
11
|
-
import { type VerifyRequestOptions } from "../sig/http.js";
|
12
|
-
import { type DoesActorOwnKeyOptions as NewDoesActorOwnKeyOptions, type GetKeyOwnerOptions as NewGetKeyOwnerOptions } from "../sig/owner.js";
|
13
|
-
import type { Actor } from "../vocab/actor.js";
|
14
|
-
import type { Activity, CryptographicKey } from "../vocab/vocab.js";
|
15
|
-
/**
|
16
|
-
* Signs a request using the given private key.
|
17
|
-
* @param request The request to sign.
|
18
|
-
* @param privateKey The private key to use for signing.
|
19
|
-
* @param keyId The key ID to use for the signature. It will be used by the
|
20
|
-
* verifier.
|
21
|
-
* @returns The signed request.
|
22
|
-
* @throws {TypeError} If the private key is invalid or unsupported.
|
23
|
-
* @deprecated
|
24
|
-
*/
|
25
|
-
export declare function sign(request: Request, privateKey: dntShim.CryptoKey, keyId: URL): Promise<Request>;
|
26
|
-
/**
|
27
|
-
* Options for {@link verify}.
|
28
|
-
*
|
29
|
-
* @since 0.9.0
|
30
|
-
* @deprecated
|
31
|
-
*/
|
32
|
-
export type VerifyOptions = VerifyRequestOptions;
|
33
|
-
/**
|
34
|
-
* Verifies the signature of a request.
|
35
|
-
*
|
36
|
-
* Note that this function consumes the request body, so it should not be used
|
37
|
-
* if the request body is already consumed. Consuming the request body after
|
38
|
-
* calling this function is okay, since this function clones the request
|
39
|
-
* under the hood.
|
40
|
-
*
|
41
|
-
* @param request The request to verify.
|
42
|
-
* @param options Options for verifying the request.
|
43
|
-
* @returns The public key of the verified signature, or `null` if the signature
|
44
|
-
* could not be verified.
|
45
|
-
* @deprecated
|
46
|
-
*/
|
47
|
-
export declare function verify(request: Request, options?: VerifyRequestOptions): Promise<CryptographicKey | null>;
|
48
|
-
/**
|
49
|
-
* Options for {@link doesActorOwnKey}.
|
50
|
-
* @since 0.8.0
|
51
|
-
* @deprecated
|
52
|
-
*/
|
53
|
-
export type DoesActorOwnKeyOptions = NewDoesActorOwnKeyOptions;
|
54
|
-
/**
|
55
|
-
* Checks if the actor of the given activity owns the specified key.
|
56
|
-
* @param activity The activity to check.
|
57
|
-
* @param key The public key to check.
|
58
|
-
* @param options Options for checking the key ownership.
|
59
|
-
* @returns Whether the actor is the owner of the key.
|
60
|
-
* @deprecated
|
61
|
-
*/
|
62
|
-
export declare function doesActorOwnKey(activity: Activity, key: CryptographicKey, options: NewDoesActorOwnKeyOptions): Promise<boolean>;
|
63
|
-
/**
|
64
|
-
* Options for {@link getKeyOwner}.
|
65
|
-
* @since 0.8.0
|
66
|
-
* @deprecated
|
67
|
-
*/
|
68
|
-
export type GetKeyOwnerOptions = NewGetKeyOwnerOptions;
|
69
|
-
/**
|
70
|
-
* Gets the actor that owns the specified key. Returns `null` if the key has no
|
71
|
-
* known owner.
|
72
|
-
*
|
73
|
-
* @param keyId The ID of the key to check, or the key itself.
|
74
|
-
* @param options Options for getting the key owner.
|
75
|
-
* @returns The actor that owns the key, or `null` if the key has no known
|
76
|
-
* owner.
|
77
|
-
* @since 0.7.0
|
78
|
-
* @deprecated
|
79
|
-
*/
|
80
|
-
export declare function getKeyOwner(keyId: URL | CryptographicKey, options: NewGetKeyOwnerOptions): Promise<Actor | null>;
|
81
|
-
/**
|
82
|
-
* Generates a key pair which is appropriate for Fedify.
|
83
|
-
* @returns The generated key pair.
|
84
|
-
* @since 0.3.0
|
85
|
-
* @deprecated
|
86
|
-
*/
|
87
|
-
export declare function generateCryptoKeyPair(): Promise<dntShim.CryptoKeyPair>;
|
88
|
-
/**
|
89
|
-
* Exports a key in JWK format.
|
90
|
-
* @param key The key to export. Either public or private key.
|
91
|
-
* @returns The exported key in JWK format. The key is suitable for
|
92
|
-
* serialization and storage.
|
93
|
-
* @throws {TypeError} If the key is invalid or unsupported.
|
94
|
-
* @since 0.3.0
|
95
|
-
* @deprecated
|
96
|
-
*/
|
97
|
-
export declare function exportJwk(key: dntShim.CryptoKey): Promise<dntShim.JsonWebKey>;
|
98
|
-
/**
|
99
|
-
* Imports a key from JWK format.
|
100
|
-
* @param jwk The key in JWK format.
|
101
|
-
* @param type Which type of key to import, either `"public"`" or `"private"`".
|
102
|
-
* @returns The imported key.
|
103
|
-
* @throws {TypeError} If the key is invalid or unsupported.
|
104
|
-
* @since 0.3.0
|
105
|
-
* @deprecated
|
106
|
-
*/
|
107
|
-
export declare function importJwk(jwk: dntShim.JsonWebKey, type: "public" | "private"): Promise<dntShim.CryptoKey>;
|
108
|
-
//# sourceMappingURL=mod.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/httpsig/mod.ts"],"names":[],"mappings":";;AAAA;;;;;;GAMG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,gB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