@fedify/fedify 2.1.0-dev.405 → 2.1.0-dev.408
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/dist/{builder-BWjjqZUb.js → builder-DqJQtxW4.js} +3 -3
- package/dist/client-BxMZiQaD.d.ts +224 -0
- package/dist/client-C97KOq3x.d.cts +222 -0
- package/dist/compat/mod.d.cts +6 -6
- package/dist/compat/mod.d.ts +6 -6
- package/dist/compat/transformers.test.js +11 -11
- package/dist/context-Dy5ro7zD.d.ts +2515 -0
- package/dist/context-o4OhjMHe.d.cts +2513 -0
- package/dist/{deno-CPzYQsYM.js → deno-D_VnPW-Y.js} +1 -1
- package/dist/{docloader-Cd_GiG4f.js → docloader-D7xSU1xb.js} +2 -2
- package/dist/federation/builder.test.js +3 -3
- package/dist/federation/handler.test.js +11 -11
- package/dist/federation/idempotency.test.js +11 -11
- package/dist/federation/inbox.test.js +2 -2
- package/dist/federation/middleware.test.js +11 -11
- package/dist/federation/mod.cjs +4 -4
- package/dist/federation/mod.d.cts +6 -6
- package/dist/federation/mod.d.ts +6 -6
- package/dist/federation/mod.js +4 -4
- package/dist/federation/send.test.js +5 -5
- package/dist/federation/webfinger.test.js +11 -11
- package/dist/{http-CEU_3RKK.cjs → http-B-epypwc.cjs} +1 -1
- package/dist/{http-CQ_YeeLl.js → http-C3oMHumD.js} +1 -1
- package/dist/{http-Du61KL0a.js → http-CFILUWFj.js} +2 -2
- package/dist/http-Cz3MlXAZ.d.cts +244 -0
- package/dist/http-DkHdFfrc.d.ts +246 -0
- package/dist/{inbox-DtFkWTEQ.js → inbox-FsU-ifET.js} +1 -1
- package/dist/{key-BzVQ8XYL.js → key-Cw2GXzkv.js} +1 -1
- package/dist/kv-BL4nlICN.d.cts +110 -0
- package/dist/kv-DXEUEP6z.d.ts +113 -0
- package/dist/{kv-cache-C8OMhVH8.js → kv-cache-K6GW8-uS.js} +1 -1
- package/dist/{kv-cache-DBmcvmxf.cjs → kv-cache-YG3yAJRb.cjs} +1 -1
- package/dist/{ld-CwNrP01q.js → ld-D4-RbyP8.js} +2 -2
- package/dist/{middleware-CRWZ3XGF.js → middleware-ByN4qQt0.js} +4 -4
- package/dist/{middleware-HEyCssxh.js → middleware-CVGms5AS.js} +11 -11
- package/dist/{middleware-Cw6aAfgI.js → middleware-Co3x1vLV.js} +10 -10
- package/dist/{middleware-C6hCNOnW.cjs → middleware-CzNcdhiV.cjs} +4 -4
- package/dist/middleware-DWhDjC7Z.cjs +12 -0
- package/dist/{middleware-BcNc3Cp1.js → middleware-D_wNj9p6.js} +4 -4
- package/dist/mod-Bm_GwNTL.d.cts +80 -0
- package/dist/mod-CIR7gJW8.d.ts +64 -0
- package/dist/mod-CwZXZJ9d.d.ts +91 -0
- package/dist/mod-DPkRU3EK.d.cts +266 -0
- package/dist/mod-DQWhp0xs.d.ts +82 -0
- package/dist/mod-DUWcVv49.d.ts +268 -0
- package/dist/mod-DXsQakeS.d.cts +89 -0
- package/dist/mod-DwqZ5l67.d.cts +62 -0
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +9 -9
- package/dist/mod.d.ts +9 -9
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.js +11 -11
- package/dist/nodeinfo/mod.d.cts +1 -1
- package/dist/nodeinfo/mod.d.ts +1 -1
- package/dist/otel/mod.d.cts +145 -145
- package/dist/otel/mod.d.ts +145 -145
- package/dist/owner-1AbPBOOZ.d.cts +66 -0
- package/dist/{owner-BuJ3B1oy.js → owner-BJOuHY_S.js} +1 -1
- package/dist/owner-gd0Q9FuU.d.ts +68 -0
- package/dist/{proof-B0VK41oO.js → proof-BNcJ_Sa_.js} +1 -1
- package/dist/{proof-B_ndUlKU.cjs → proof-BmYdRz_f.cjs} +1 -1
- package/dist/{proof-BjgSTnKs.js → proof-VvmjtuyP.js} +2 -2
- package/dist/{send-CsYzNMCy.js → send-DYC2LvJZ.js} +2 -2
- package/dist/sig/http.test.js +3 -3
- package/dist/sig/key.test.js +2 -2
- package/dist/sig/ld.test.js +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.js +3 -3
- package/dist/sig/proof.test.js +3 -3
- package/dist/utils/docloader.test.js +4 -4
- package/dist/utils/mod.cjs +2 -2
- package/dist/utils/mod.d.cts +3 -3
- package/dist/utils/mod.d.ts +3 -3
- package/dist/utils/mod.js +2 -2
- package/package.json +5 -5
- package/dist/client-CwkOPN13.d.cts +0 -222
- package/dist/client-a7NwzhA2.d.ts +0 -224
- package/dist/context-BdNW_8a3.d.cts +0 -2554
- package/dist/context-C-GVKcJR.d.ts +0 -2556
- package/dist/http-CCEu-x1_.d.cts +0 -253
- package/dist/http-CODSJcKx.d.ts +0 -255
- package/dist/kv-g9jFc34-.d.cts +0 -110
- package/dist/kv-jg_8SMc1.d.ts +0 -113
- package/dist/middleware-DAtmZEMk.cjs +0 -12
- package/dist/mod-5PNty1K9.d.cts +0 -80
- package/dist/mod-BcpEGTWV.d.cts +0 -62
- package/dist/mod-COO7VMcm.d.cts +0 -266
- package/dist/mod-CevNbUol.d.ts +0 -91
- package/dist/mod-CtO31FCx.d.ts +0 -64
- package/dist/mod-Da9fNDyC.d.ts +0 -82
- package/dist/mod-ErTjUJs9.d.cts +0 -89
- package/dist/mod-q2IR8UiH.d.ts +0 -268
- package/dist/owner-9yZ5Ibsb.d.cts +0 -66
- package/dist/owner-DQYAbVmX.d.ts +0 -68
package/dist/otel/mod.d.ts
CHANGED
|
@@ -1,231 +1,231 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { KvKey, KvStore } from "../kv-
|
|
3
|
+
import { KvKey, KvStore } from "../kv-DXEUEP6z.js";
|
|
4
4
|
import { ExportResultCode } from "@opentelemetry/core";
|
|
5
5
|
import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
|
|
6
6
|
|
|
7
7
|
//#region src/otel/exporter.d.ts
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
* The direction of an activity in the trace.
|
|
10
|
+
*
|
|
11
|
+
* @since 1.10.0
|
|
12
|
+
*/
|
|
13
13
|
type ActivityDirection = "inbound" | "outbound";
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
* Signature verification details for an inbound activity.
|
|
16
|
+
*
|
|
17
|
+
* @since 1.10.0
|
|
18
|
+
*/
|
|
19
19
|
interface SignatureVerificationDetails {
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
* Whether HTTP Signatures were verified.
|
|
22
|
+
*/
|
|
23
23
|
readonly httpSignaturesVerified: boolean;
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
* The key ID used for HTTP signature verification, if available.
|
|
26
|
+
*/
|
|
27
27
|
readonly httpSignaturesKeyId?: string;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
* Whether Linked Data Signatures were verified.
|
|
30
|
+
*/
|
|
31
31
|
readonly ldSignaturesVerified: boolean;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
* A record of an activity captured from a trace span.
|
|
35
|
+
* This interface stores the activity data along with trace context
|
|
36
|
+
* for distributed tracing support.
|
|
37
|
+
*
|
|
38
|
+
* @since 1.10.0
|
|
39
|
+
*/
|
|
40
40
|
interface TraceActivityRecord {
|
|
41
41
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
* The trace ID from OpenTelemetry.
|
|
43
|
+
*/
|
|
44
44
|
readonly traceId: string;
|
|
45
45
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
* The span ID from OpenTelemetry.
|
|
47
|
+
*/
|
|
48
48
|
readonly spanId: string;
|
|
49
49
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
* The parent span ID, if any.
|
|
51
|
+
*/
|
|
52
52
|
readonly parentSpanId?: string;
|
|
53
53
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
* Whether this is an inbound or outbound activity.
|
|
55
|
+
*/
|
|
56
56
|
readonly direction: ActivityDirection;
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
* The ActivityPub activity type (e.g., "Create", "Follow", "Like").
|
|
59
|
+
*/
|
|
60
60
|
readonly activityType: string;
|
|
61
61
|
/**
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
* The activity's ID URL, if present.
|
|
63
|
+
*/
|
|
64
64
|
readonly activityId?: string;
|
|
65
65
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
* The actor ID URL (sender of the activity).
|
|
67
|
+
*/
|
|
68
68
|
readonly actorId?: string;
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
* The full JSON representation of the activity.
|
|
71
|
+
*/
|
|
72
72
|
readonly activityJson: string;
|
|
73
73
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
* Whether the activity was verified (for inbound activities).
|
|
75
|
+
*/
|
|
76
76
|
readonly verified?: boolean;
|
|
77
77
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
* Detailed signature verification information (for inbound activities).
|
|
79
|
+
*/
|
|
80
80
|
readonly signatureDetails?: SignatureVerificationDetails;
|
|
81
81
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
* The timestamp when this record was created (ISO 8601 format).
|
|
83
|
+
*/
|
|
84
84
|
readonly timestamp: string;
|
|
85
85
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
* The target inbox URL (for outbound activities).
|
|
87
|
+
*/
|
|
88
88
|
readonly inboxUrl?: string;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
* Summary information about a trace.
|
|
92
|
+
*
|
|
93
|
+
* @since 1.10.0
|
|
94
|
+
*/
|
|
95
95
|
interface TraceSummary {
|
|
96
96
|
/**
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
* The trace ID.
|
|
98
|
+
*/
|
|
99
99
|
readonly traceId: string;
|
|
100
100
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
* The timestamp of the first activity in the trace.
|
|
102
|
+
*/
|
|
103
103
|
readonly timestamp: string;
|
|
104
104
|
/**
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
* The number of activities in the trace.
|
|
106
|
+
*/
|
|
107
107
|
readonly activityCount: number;
|
|
108
108
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
* Activity types present in this trace.
|
|
110
|
+
*/
|
|
111
111
|
readonly activityTypes: readonly string[];
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
* Options for configuring the {@link FedifySpanExporter}.
|
|
115
|
+
*
|
|
116
|
+
* @since 1.10.0
|
|
117
|
+
*/
|
|
118
118
|
interface FedifySpanExporterOptions {
|
|
119
119
|
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
* The time-to-live for stored trace data.
|
|
121
|
+
* If not specified, data will be stored indefinitely
|
|
122
|
+
* (or until manually deleted).
|
|
123
|
+
*/
|
|
124
124
|
readonly ttl?: Temporal.Duration;
|
|
125
125
|
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
* The key prefix for storing trace data in the KvStore.
|
|
127
|
+
* Defaults to `["fedify", "traces"]`.
|
|
128
|
+
*/
|
|
129
129
|
readonly keyPrefix?: KvKey;
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
* Options for the {@link FedifySpanExporter.getRecentTraces} method.
|
|
133
|
+
*
|
|
134
|
+
* @since 1.10.0
|
|
135
|
+
*/
|
|
136
136
|
interface GetRecentTracesOptions {
|
|
137
137
|
/**
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
* Maximum number of traces to return.
|
|
139
|
+
* If not specified, returns all available traces.
|
|
140
|
+
*/
|
|
141
141
|
limit?: number;
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
144
|
+
* A SpanExporter that persists ActivityPub activity traces to a
|
|
145
|
+
* {@link KvStore}. This enables distributed tracing across multiple
|
|
146
|
+
* nodes in a Fedify deployment.
|
|
147
|
+
*
|
|
148
|
+
* The exporter captures activity data from OpenTelemetry span events
|
|
149
|
+
* (`activitypub.activity.received` and `activitypub.activity.sent`)
|
|
150
|
+
* and stores them in the KvStore with trace context preserved.
|
|
151
|
+
*
|
|
152
|
+
* @example Basic usage with MemoryKvStore
|
|
153
|
+
* ```typescript ignore
|
|
154
|
+
* import { MemoryKvStore } from "@fedify/fedify";
|
|
155
|
+
* import { FedifySpanExporter } from "@fedify/fedify/otel";
|
|
156
|
+
* import {
|
|
157
|
+
* BasicTracerProvider,
|
|
158
|
+
* SimpleSpanProcessor,
|
|
159
|
+
* } from "@opentelemetry/sdk-trace-base";
|
|
160
|
+
*
|
|
161
|
+
* const kv = new MemoryKvStore();
|
|
162
|
+
* const exporter = new FedifySpanExporter(kv, {
|
|
163
|
+
* ttl: Temporal.Duration.from({ hours: 1 }),
|
|
164
|
+
* });
|
|
165
|
+
*
|
|
166
|
+
* const provider = new BasicTracerProvider({
|
|
167
|
+
* spanProcessors: [new SimpleSpanProcessor(exporter)],
|
|
168
|
+
* });
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @example Querying stored traces
|
|
172
|
+
* ```typescript ignore
|
|
173
|
+
* import { MemoryKvStore } from "@fedify/fedify";
|
|
174
|
+
* import { FedifySpanExporter } from "@fedify/fedify/otel";
|
|
175
|
+
*
|
|
176
|
+
* const kv = new MemoryKvStore();
|
|
177
|
+
* const exporter = new FedifySpanExporter(kv);
|
|
178
|
+
* const traceId = "abc123";
|
|
179
|
+
*
|
|
180
|
+
* // Get all activities for a specific trace
|
|
181
|
+
* const activities = await exporter.getActivitiesByTraceId(traceId);
|
|
182
|
+
*
|
|
183
|
+
* // Get recent traces
|
|
184
|
+
* const recentTraces = await exporter.getRecentTraces({ limit: 100 });
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @since 1.10.0
|
|
188
|
+
*/
|
|
189
189
|
declare class FedifySpanExporter implements SpanExporter {
|
|
190
190
|
#private;
|
|
191
191
|
/**
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
* Creates a new FedifySpanExporter.
|
|
193
|
+
*
|
|
194
|
+
* @param kv The KvStore to persist trace data to.
|
|
195
|
+
* @param options Configuration options.
|
|
196
|
+
*/
|
|
197
197
|
constructor(kv: KvStore, options?: FedifySpanExporterOptions);
|
|
198
198
|
/**
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
* Exports spans to the KvStore.
|
|
200
|
+
*
|
|
201
|
+
* @param spans The spans to export.
|
|
202
|
+
* @param resultCallback Callback to invoke with the export result.
|
|
203
|
+
*/
|
|
204
204
|
export(spans: ReadableSpan[], resultCallback: (result: {
|
|
205
205
|
code: ExportResultCode;
|
|
206
206
|
}) => void): void;
|
|
207
207
|
/**
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
* Gets all activity records for a specific trace ID.
|
|
209
|
+
*
|
|
210
|
+
* @param traceId The trace ID to query.
|
|
211
|
+
* @returns An array of activity records belonging to the trace.
|
|
212
|
+
*/
|
|
213
213
|
getActivitiesByTraceId(traceId: string): Promise<TraceActivityRecord[]>;
|
|
214
214
|
/**
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
* Gets recent traces with summary information.
|
|
216
|
+
*
|
|
217
|
+
* @param options Options for the query.
|
|
218
|
+
* @returns An array of trace summaries.
|
|
219
|
+
*/
|
|
220
220
|
getRecentTraces(options?: GetRecentTracesOptions): Promise<TraceSummary[]>;
|
|
221
221
|
/**
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
* Forces the exporter to flush any buffered data.
|
|
223
|
+
* This is a no-op because we write directly to the KvStore without buffering.
|
|
224
|
+
*/
|
|
225
225
|
forceFlush(): Promise<void>;
|
|
226
226
|
/**
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
* Shuts down the exporter.
|
|
228
|
+
*/
|
|
229
229
|
shutdown(): Promise<void>;
|
|
230
230
|
}
|
|
231
231
|
//#endregion
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
|
|
2
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
3
|
+
import { TracerProvider } from "@opentelemetry/api";
|
|
4
|
+
|
|
5
|
+
//#region src/sig/owner.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Options for {@link doesActorOwnKey}.
|
|
8
|
+
* @since 0.8.0
|
|
9
|
+
*/
|
|
10
|
+
interface DoesActorOwnKeyOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The document loader to use for fetching the actor.
|
|
13
|
+
*/
|
|
14
|
+
documentLoader?: DocumentLoader;
|
|
15
|
+
/**
|
|
16
|
+
* The context loader to use for JSON-LD context retrieval.
|
|
17
|
+
*/
|
|
18
|
+
contextLoader?: DocumentLoader;
|
|
19
|
+
/**
|
|
20
|
+
* The OpenTelemetry tracer provider to use for tracing. If omitted,
|
|
21
|
+
* the global tracer provider is used.
|
|
22
|
+
* @since 1.3.0
|
|
23
|
+
*/
|
|
24
|
+
tracerProvider?: TracerProvider;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the actor of the given activity owns the specified key.
|
|
28
|
+
* @param activity The activity to check.
|
|
29
|
+
* @param key The public key to check.
|
|
30
|
+
* @param options Options for checking the key ownership.
|
|
31
|
+
* @returns Whether the actor is the owner of the key.
|
|
32
|
+
*/
|
|
33
|
+
declare function doesActorOwnKey(activity: Activity, key: CryptographicKey, options: DoesActorOwnKeyOptions): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Options for {@link getKeyOwner}.
|
|
36
|
+
* @since 0.8.0
|
|
37
|
+
*/
|
|
38
|
+
interface GetKeyOwnerOptions {
|
|
39
|
+
/**
|
|
40
|
+
* The document loader to use for fetching the key and its owner.
|
|
41
|
+
*/
|
|
42
|
+
documentLoader?: DocumentLoader;
|
|
43
|
+
/**
|
|
44
|
+
* The context loader to use for JSON-LD context retrieval.
|
|
45
|
+
*/
|
|
46
|
+
contextLoader?: DocumentLoader;
|
|
47
|
+
/**
|
|
48
|
+
* The OpenTelemetry tracer provider to use for tracing. If omitted,
|
|
49
|
+
* the global tracer provider is used.
|
|
50
|
+
* @since 1.3.0
|
|
51
|
+
*/
|
|
52
|
+
tracerProvider?: TracerProvider;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Gets the actor that owns the specified key. Returns `null` if the key has no
|
|
56
|
+
* known owner.
|
|
57
|
+
*
|
|
58
|
+
* @param keyId The ID of the key to check, or the key itself.
|
|
59
|
+
* @param options Options for getting the key owner.
|
|
60
|
+
* @returns The actor that owns the key, or `null` if the key has no known
|
|
61
|
+
* owner.
|
|
62
|
+
* @since 0.7.0
|
|
63
|
+
*/
|
|
64
|
+
declare function getKeyOwner(keyId: URL | CryptographicKey, options: GetKeyOwnerOptions): Promise<Actor | null>;
|
|
65
|
+
//#endregion
|
|
66
|
+
export { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
6
|
+
import { deno_default } from "./deno-D_VnPW-Y.js";
|
|
7
7
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
8
8
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
|
|
4
|
+
import { TracerProvider } from "@opentelemetry/api";
|
|
5
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/sig/owner.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Options for {@link doesActorOwnKey}.
|
|
10
|
+
* @since 0.8.0
|
|
11
|
+
*/
|
|
12
|
+
interface DoesActorOwnKeyOptions {
|
|
13
|
+
/**
|
|
14
|
+
* The document loader to use for fetching the actor.
|
|
15
|
+
*/
|
|
16
|
+
documentLoader?: DocumentLoader;
|
|
17
|
+
/**
|
|
18
|
+
* The context loader to use for JSON-LD context retrieval.
|
|
19
|
+
*/
|
|
20
|
+
contextLoader?: DocumentLoader;
|
|
21
|
+
/**
|
|
22
|
+
* The OpenTelemetry tracer provider to use for tracing. If omitted,
|
|
23
|
+
* the global tracer provider is used.
|
|
24
|
+
* @since 1.3.0
|
|
25
|
+
*/
|
|
26
|
+
tracerProvider?: TracerProvider;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Checks if the actor of the given activity owns the specified key.
|
|
30
|
+
* @param activity The activity to check.
|
|
31
|
+
* @param key The public key to check.
|
|
32
|
+
* @param options Options for checking the key ownership.
|
|
33
|
+
* @returns Whether the actor is the owner of the key.
|
|
34
|
+
*/
|
|
35
|
+
declare function doesActorOwnKey(activity: Activity, key: CryptographicKey, options: DoesActorOwnKeyOptions): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Options for {@link getKeyOwner}.
|
|
38
|
+
* @since 0.8.0
|
|
39
|
+
*/
|
|
40
|
+
interface GetKeyOwnerOptions {
|
|
41
|
+
/**
|
|
42
|
+
* The document loader to use for fetching the key and its owner.
|
|
43
|
+
*/
|
|
44
|
+
documentLoader?: DocumentLoader;
|
|
45
|
+
/**
|
|
46
|
+
* The context loader to use for JSON-LD context retrieval.
|
|
47
|
+
*/
|
|
48
|
+
contextLoader?: DocumentLoader;
|
|
49
|
+
/**
|
|
50
|
+
* The OpenTelemetry tracer provider to use for tracing. If omitted,
|
|
51
|
+
* the global tracer provider is used.
|
|
52
|
+
* @since 1.3.0
|
|
53
|
+
*/
|
|
54
|
+
tracerProvider?: TracerProvider;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Gets the actor that owns the specified key. Returns `null` if the key has no
|
|
58
|
+
* known owner.
|
|
59
|
+
*
|
|
60
|
+
* @param keyId The ID of the key to check, or the key itself.
|
|
61
|
+
* @param options Options for getting the key owner.
|
|
62
|
+
* @returns The actor that owns the key, or `null` if the key has no known
|
|
63
|
+
* owner.
|
|
64
|
+
* @since 0.7.0
|
|
65
|
+
*/
|
|
66
|
+
declare function getKeyOwner(keyId: URL | CryptographicKey, options: GetKeyOwnerOptions): Promise<Actor | null>;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { deno_default, fetchKey, validateCryptoKey } from "./http-
|
|
5
|
+
import { deno_default, fetchKey, validateCryptoKey } from "./http-C3oMHumD.js";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "@fedify/vocab";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
const require_chunk = require('./chunk-CGaQZ11T.cjs');
|
|
6
|
-
const require_http = require('./http-
|
|
6
|
+
const require_http = require('./http-B-epypwc.cjs');
|
|
7
7
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
8
8
|
const __fedify_vocab = require_chunk.__toESM(require("@fedify/vocab"));
|
|
9
9
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
|
6
|
+
import { deno_default } from "./deno-D_VnPW-Y.js";
|
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-Cw2GXzkv.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
|
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { deno_default } from "./deno-D_VnPW-Y.js";
|
|
7
|
+
import { doubleKnock } from "./http-CFILUWFj.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
|
package/dist/sig/http.test.js
CHANGED
|
@@ -7,9 +7,9 @@ import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
|
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { exportJwk } from "../key-
|
|
12
|
-
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-
|
|
10
|
+
import "../deno-D_VnPW-Y.js";
|
|
11
|
+
import { exportJwk } from "../key-Cw2GXzkv.js";
|
|
12
|
+
import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-CFILUWFj.js";
|
|
13
13
|
import { assertExists, assertStringIncludes } from "../std__assert-DWivtrGR.js";
|
|
14
14
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
15
15
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
package/dist/sig/key.test.js
CHANGED
|
@@ -7,8 +7,8 @@ import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
|
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import "../assert-MZs1qjMx.js";
|
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-
|
|
10
|
+
import "../deno-D_VnPW-Y.js";
|
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-Cw2GXzkv.js";
|
|
12
12
|
import "../std__assert-DWivtrGR.js";
|
|
13
13
|
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
14
14
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
package/dist/sig/ld.test.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
|
-
import "../deno-
|
|
10
|
-
import { generateCryptoKeyPair } from "../key-
|
|
11
|
-
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-
|
|
9
|
+
import "../deno-D_VnPW-Y.js";
|
|
10
|
+
import { generateCryptoKeyPair } from "../key-Cw2GXzkv.js";
|
|
11
|
+
import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-D4-RbyP8.js";
|
|
12
12
|
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
|
13
13
|
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
|
14
14
|
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-ZbcByPg9.js";
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
|
-
const require_http = require('../http-
|
|
6
|
-
const require_proof = require('../proof-
|
|
5
|
+
const require_http = require('../http-B-epypwc.cjs');
|
|
6
|
+
const require_proof = require('../proof-BmYdRz_f.cjs');
|
|
7
7
|
require('../sig-vX39WyWI.cjs');
|
|
8
8
|
|
|
9
9
|
exports.attachSignature = require_proof.attachSignature;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-
|
|
2
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-
|
|
3
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-
|
|
1
|
+
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-Cz3MlXAZ.cjs";
|
|
2
|
+
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-1AbPBOOZ.cjs";
|
|
3
|
+
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-DPkRU3EK.cjs";
|
|
4
4
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-
|
|
4
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-
|
|
5
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-
|
|
3
|
+
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-DkHdFfrc.js";
|
|
4
|
+
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-gd0Q9FuU.js";
|
|
5
|
+
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-DUWcVv49.js";
|
|
6
6
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-
|
|
6
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-
|
|
5
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-C3oMHumD.js";
|
|
6
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-BNcJ_Sa_.js";
|
|
7
7
|
import "../sig-BNhspNOf.js";
|
|
8
8
|
|
|
9
9
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|