@oxy.so/core 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,359 @@
1
+ /**
2
+ * Present-requester assertions (ADR 0025): the format, the JWKS resolver, the
3
+ * audience middleware and the two SDK calls.
4
+ *
5
+ * Built around what must be REFUSED. An assertion is the only thing that lets a
6
+ * product's service token speak for a signed-in person at Alia, so every way to
7
+ * forge, stretch, redirect or reuse one has its own case.
8
+ */
9
+
10
+ import { generateKeyPairSync, randomUUID, sign as signBytes, type KeyObject } from 'node:crypto';
11
+ import type { NextFunction, Request, Response } from 'express';
12
+ import { OxyServices } from '../../OxyServices';
13
+ import {
14
+ createOxyJwksKeyResolver,
15
+ createOxyRequesterAssertionAuth,
16
+ OXY_REQUESTER_ASSERTION_HEADER,
17
+ OxyRequesterAssertionError,
18
+ signOxyRequesterAssertion,
19
+ verifyOxyRequesterAssertion,
20
+ type OxyRequesterAssertionClaims,
21
+ type OxyRequesterAssertionIntrospection,
22
+ type OxyRequesterAssertionRequest,
23
+ } from '../requesterAssertion';
24
+
25
+ const NOW = new Date('2026-09-17T12:00:00.000Z');
26
+ const NOW_SECONDS = Math.floor(NOW.getTime() / 1000);
27
+ const ISSUER = 'https://api.oxy.so';
28
+ const KEY = generateKeyPairSync('ed25519');
29
+ const OTHER_KEY = generateKeyPairSync('ed25519');
30
+ const KEY_ID = 'cap-test-1';
31
+
32
+ function claims(overrides: Partial<OxyRequesterAssertionClaims> = {}): OxyRequesterAssertionClaims {
33
+ return {
34
+ iss: ISSUER,
35
+ aud: 'alia',
36
+ sub: 'requester-1',
37
+ jti: randomUUID(),
38
+ iat: NOW_SECONDS,
39
+ exp: NOW_SECONDS + 120,
40
+ azp: 'homiio-app',
41
+ cid: 'sindi-credential',
42
+ agentId: 'sindi-agent',
43
+ ...overrides,
44
+ };
45
+ }
46
+
47
+ function sign(value: OxyRequesterAssertionClaims, privateKey: KeyObject = KEY.privateKey): string {
48
+ return signOxyRequesterAssertion(value, { keyId: KEY_ID, privateKey });
49
+ }
50
+
51
+ /** Hand-rolled JWS so tests can produce what the real signer refuses to. */
52
+ function rawToken(header: Record<string, unknown>, payload: Record<string, unknown>, privateKey = KEY.privateKey): string {
53
+ const input = `${Buffer.from(JSON.stringify(header)).toString('base64url')}.${Buffer.from(JSON.stringify(payload)).toString('base64url')}`;
54
+ return `${input}.${signBytes(null, Buffer.from(input), privateKey).toString('base64url')}`;
55
+ }
56
+
57
+ function verify(token: string, overrides: Partial<Parameters<typeof verifyOxyRequesterAssertion>[1]> = {}) {
58
+ return verifyOxyRequesterAssertion(token, {
59
+ publicKey: KEY.publicKey,
60
+ issuer: ISSUER,
61
+ audience: 'alia',
62
+ now: NOW,
63
+ ...overrides,
64
+ });
65
+ }
66
+
67
+ function codeOf(run: () => unknown): string {
68
+ try {
69
+ run();
70
+ } catch (error) {
71
+ if (error instanceof OxyRequesterAssertionError) return error.code;
72
+ throw error;
73
+ }
74
+ throw new Error('expected a rejection');
75
+ }
76
+
77
+ describe('requester assertion format', () => {
78
+ it('round-trips a signed assertion', () => {
79
+ const value = claims();
80
+ expect(verify(sign(value))).toEqual(value);
81
+ });
82
+
83
+ it('refuses a signature from any other key', () => {
84
+ expect(codeOf(() => verify(sign(claims()), { publicKey: OTHER_KEY.publicKey }))).toBe('invalid_signature');
85
+ expect(codeOf(() => verify(sign(claims(), OTHER_KEY.privateKey)))).toBe('invalid_signature');
86
+ });
87
+
88
+ it('refuses a payload altered after signing', () => {
89
+ const [header, , signature] = sign(claims()).split('.');
90
+ const forged = Buffer.from(JSON.stringify(claims({ sub: 'someone-else' }))).toString('base64url');
91
+ expect(codeOf(() => verify(`${header}.${forged}.${signature}`))).toBe('invalid_signature');
92
+ });
93
+
94
+ it('refuses an unknown key', () => {
95
+ expect(codeOf(() => verify(sign(claims()), { publicKey: undefined }))).toBe('unknown_key');
96
+ });
97
+
98
+ it('refuses expired, future and over-long assertions', () => {
99
+ expect(codeOf(() => verify(sign(claims({ iat: NOW_SECONDS - 200, exp: NOW_SECONDS - 80 }))))).toBe('expired');
100
+ expect(codeOf(() => verify(sign(claims({ iat: NOW_SECONDS + 60, exp: NOW_SECONDS + 180 }))))).toBe('not_yet_valid');
101
+ const long = rawToken({ alg: 'EdDSA', typ: 'OXY-REQUESTER+JWT', kid: KEY_ID }, claims({ exp: NOW_SECONDS + 3600 }));
102
+ expect(codeOf(() => verify(long))).toBe('ttl_exceeded');
103
+ expect(() => sign(claims({ exp: NOW_SECONDS + 3600 }))).toThrow(OxyRequesterAssertionError);
104
+ });
105
+
106
+ it('refuses the wrong audience and the wrong issuer', () => {
107
+ expect(codeOf(() => verify(sign(claims({ aud: 'syra' }))))).toBe('wrong_audience');
108
+ expect(codeOf(() => verify(sign(claims({ iss: 'https://evil.example' }))))).toBe('wrong_issuer');
109
+ });
110
+
111
+ it('refuses other token types, alg none and extra header members', () => {
112
+ const payload = claims();
113
+ expect(codeOf(() => verify(rawToken({ alg: 'EdDSA', typ: 'OXY-CAPABILITY+JWT', kid: KEY_ID }, payload)))).toBe('malformed');
114
+ expect(codeOf(() => verify(rawToken({ alg: 'EdDSA', typ: 'JWT', kid: KEY_ID }, payload)))).toBe('malformed');
115
+ expect(codeOf(() => verify(rawToken({ alg: 'none', typ: 'OXY-REQUESTER+JWT', kid: KEY_ID }, payload)))).toBe('malformed');
116
+ expect(codeOf(() => verify(rawToken({ alg: 'EdDSA', typ: 'OXY-REQUESTER+JWT', kid: KEY_ID, jku: 'x' }, payload)))).toBe('malformed');
117
+ const [header, body] = sign(payload).split('.');
118
+ expect(codeOf(() => verify(`${header}.${body}.`))).toBe('malformed');
119
+ expect(codeOf(() => verify('not-a-token'))).toBe('malformed');
120
+ });
121
+
122
+ it('refuses unknown or missing claims', () => {
123
+ const header = { alg: 'EdDSA', typ: 'OXY-REQUESTER+JWT', kid: KEY_ID };
124
+ expect(codeOf(() => verify(rawToken(header, { ...claims(), scopes: ['*'] })))).toBe('invalid_claims');
125
+ const { agentId: _agentId, ...withoutAgent } = claims();
126
+ expect(codeOf(() => verify(rawToken(header, withoutAgent)))).toBe('invalid_claims');
127
+ });
128
+ });
129
+
130
+ describe('JWKS key resolver', () => {
131
+ const jwk = { ...KEY.publicKey.export({ format: 'jwk' }), use: 'sig', alg: 'EdDSA', kid: KEY_ID };
132
+
133
+ function fetchReturning(body: unknown) {
134
+ return jest.fn(async () => new Response(JSON.stringify(body), { status: 200 }));
135
+ }
136
+
137
+ it('resolves and caches a published Ed25519 key', async () => {
138
+ const fetchImpl = fetchReturning({ keys: [jwk] });
139
+ const resolve = createOxyJwksKeyResolver({ jwksUrl: 'https://api.oxy.so/jwks', fetch: fetchImpl as never });
140
+ const key = await resolve(KEY_ID);
141
+ expect(key?.asymmetricKeyType).toBe('ed25519');
142
+ expect(verify(sign(claims()), { publicKey: key })).toBeDefined();
143
+ await resolve(KEY_ID);
144
+ expect(fetchImpl).toHaveBeenCalledTimes(1);
145
+ });
146
+
147
+ it('rate-limits refreshes caused by unknown key ids', async () => {
148
+ let clock = 0;
149
+ const fetchImpl = fetchReturning({ keys: [jwk] });
150
+ const resolve = createOxyJwksKeyResolver({ jwksUrl: 'https://api.oxy.so/jwks', fetch: fetchImpl as never, clock: () => clock });
151
+ for (let i = 0; i < 10; i += 1) expect(await resolve(`forged-${i}`)).toBeUndefined();
152
+ expect(fetchImpl).toHaveBeenCalledTimes(1);
153
+ clock += 61_000;
154
+ await resolve('forged-late');
155
+ expect(fetchImpl).toHaveBeenCalledTimes(2);
156
+ });
157
+
158
+ it('never accepts a key set that publishes private material', async () => {
159
+ const privateJwk = { ...KEY.privateKey.export({ format: 'jwk' }), use: 'sig', alg: 'EdDSA', kid: KEY_ID };
160
+ const resolve = createOxyJwksKeyResolver({ jwksUrl: 'https://api.oxy.so/jwks', fetch: fetchReturning({ keys: [privateJwk] }) as never });
161
+ expect(await resolve(KEY_ID)).toBeUndefined();
162
+ });
163
+ });
164
+
165
+ describe('createOxyRequesterAssertionAuth', () => {
166
+ const serviceApp = {
167
+ appId: 'homiio-app',
168
+ appName: 'Homiio',
169
+ credentialId: 'sindi-credential',
170
+ ownerAccountId: 'homiio-owner',
171
+ scopes: ['inference:invoke'],
172
+ environment: 'live' as const,
173
+ };
174
+
175
+ function activeAnswer(value: OxyRequesterAssertionClaims): OxyRequesterAssertionIntrospection {
176
+ return {
177
+ active: true,
178
+ requesterAccountId: value.sub,
179
+ agentId: value.agentId,
180
+ applicationId: value.azp,
181
+ credentialId: value.cid,
182
+ jti: value.jti,
183
+ expiresAt: new Date(value.exp * 1000).toISOString(),
184
+ };
185
+ }
186
+
187
+ function harness(introspect: (input: unknown) => Promise<OxyRequesterAssertionIntrospection>) {
188
+ const introspector = {
189
+ introspectRequesterAssertion: jest.fn(introspect),
190
+ getBaseURL: () => 'https://api.oxy.so',
191
+ };
192
+ const middleware = createOxyRequesterAssertionAuth(introspector, {
193
+ audience: 'alia',
194
+ now: () => NOW,
195
+ resolvePublicKey: async (keyId) => (keyId === KEY_ID ? KEY.publicKey : undefined),
196
+ });
197
+ const run = async (request: Partial<OxyRequesterAssertionRequest> & { headers: Record<string, unknown> }) => {
198
+ let statusCode = 200;
199
+ let body: Record<string, unknown> | undefined;
200
+ const res = {
201
+ status(code: number) { statusCode = code; return this; },
202
+ json(value: Record<string, unknown>) { body = value; return this; },
203
+ } as unknown as Response;
204
+ const next = jest.fn() as unknown as NextFunction;
205
+ await middleware(request as unknown as Request, res, next);
206
+ return { statusCode, body, next: next as unknown as jest.Mock, request: request as OxyRequesterAssertionRequest };
207
+ };
208
+ return { introspector, run };
209
+ }
210
+
211
+ it('does nothing without the header', async () => {
212
+ const { run, introspector } = harness(async () => ({ active: false }));
213
+ const result = await run({ headers: {}, serviceApp });
214
+ expect(result.next).toHaveBeenCalledTimes(1);
215
+ expect(result.request.userId).toBeUndefined();
216
+ expect(introspector.introspectRequesterAssertion).not.toHaveBeenCalled();
217
+ });
218
+
219
+ it('attaches the requester only after live introspection succeeds', async () => {
220
+ const value = claims();
221
+ const assertion = sign(value);
222
+ const { run, introspector } = harness(async () => activeAnswer(value));
223
+ const result = await run({ headers: { [OXY_REQUESTER_ASSERTION_HEADER]: assertion }, serviceApp, userId: null, user: null });
224
+ expect(result.next).toHaveBeenCalledTimes(1);
225
+ expect(result.request.userId).toBe('requester-1');
226
+ expect(result.request.user).toEqual({ id: 'requester-1' });
227
+ expect(result.request.oxyRequester).toMatchObject({ userId: 'requester-1', agentId: 'sindi-agent', jti: value.jti });
228
+ expect(introspector.introspectRequesterAssertion).toHaveBeenCalledWith({
229
+ assertion,
230
+ presenter: { applicationId: 'homiio-app', credentialId: 'sindi-credential' },
231
+ });
232
+ });
233
+
234
+ it('requires a verified service token as presenter', async () => {
235
+ const { run } = harness(async () => activeAnswer(claims()));
236
+ const result = await run({ headers: { [OXY_REQUESTER_ASSERTION_HEADER]: sign(claims()) } });
237
+ expect(result.statusCode).toBe(401);
238
+ expect(result.body?.code).toBe('service_token_required');
239
+ expect(result.next).not.toHaveBeenCalled();
240
+ });
241
+
242
+ it('refuses to combine with offline delegation or an existing identity', async () => {
243
+ const { run, introspector } = harness(async () => activeAnswer(claims()));
244
+ const assertion = sign(claims());
245
+ for (const request of [
246
+ { headers: { [OXY_REQUESTER_ASSERTION_HEADER]: assertion, 'x-oxy-user-id': 'victim' }, serviceApp },
247
+ { headers: { [OXY_REQUESTER_ASSERTION_HEADER]: assertion }, serviceApp, serviceActingAs: { userId: 'victim', scopes: [] } },
248
+ { headers: { [OXY_REQUESTER_ASSERTION_HEADER]: assertion }, serviceApp, userId: 'victim' },
249
+ ]) {
250
+ const result = await run(request);
251
+ expect(result.statusCode).toBe(400);
252
+ expect(result.next).not.toHaveBeenCalled();
253
+ }
254
+ expect(introspector.introspectRequesterAssertion).not.toHaveBeenCalled();
255
+ });
256
+
257
+ it('refuses an assertion presented by another application or credential without spending it', async () => {
258
+ const { run, introspector } = harness(async () => activeAnswer(claims()));
259
+ for (const presenter of [
260
+ { ...serviceApp, appId: 'other-app' },
261
+ { ...serviceApp, credentialId: 'other-credential' },
262
+ ]) {
263
+ const result = await run({ headers: { [OXY_REQUESTER_ASSERTION_HEADER]: sign(claims()) }, serviceApp: presenter });
264
+ expect(result.statusCode).toBe(401);
265
+ expect(result.body?.code).toBe('presenter_mismatch');
266
+ }
267
+ expect(introspector.introspectRequesterAssertion).not.toHaveBeenCalled();
268
+ });
269
+
270
+ it('refuses forged, expired and wrong-audience assertions before introspection', async () => {
271
+ const { run, introspector } = harness(async () => activeAnswer(claims()));
272
+ for (const [token, code] of [
273
+ [sign(claims(), OTHER_KEY.privateKey), 'invalid_signature'],
274
+ [sign(claims({ iat: NOW_SECONDS - 300, exp: NOW_SECONDS - 180 })), 'expired'],
275
+ [sign(claims({ aud: 'kaana' })), 'wrong_audience'],
276
+ [signOxyRequesterAssertion(claims(), { keyId: 'unknown', privateKey: KEY.privateKey }), 'unknown_key'],
277
+ ['garbage', 'malformed'],
278
+ ] as const) {
279
+ const result = await run({ headers: { [OXY_REQUESTER_ASSERTION_HEADER]: token }, serviceApp });
280
+ expect(result.statusCode).toBe(401);
281
+ expect(result.body?.code).toBe(code);
282
+ }
283
+ expect(introspector.introspectRequesterAssertion).not.toHaveBeenCalled();
284
+ });
285
+
286
+ it('refuses a replayed (inactive) assertion and a mismatched introspection answer', async () => {
287
+ const value = claims();
288
+ const answers: OxyRequesterAssertionIntrospection[] = [
289
+ { active: false },
290
+ { ...activeAnswer(value), requesterAccountId: 'someone-else' },
291
+ { ...activeAnswer(value), agentId: 'other-agent' },
292
+ { ...activeAnswer(value), jti: randomUUID() },
293
+ ];
294
+ const { run } = harness(async () => answers.shift() as OxyRequesterAssertionIntrospection);
295
+ for (let i = 0; i < 4; i += 1) {
296
+ const result = await run({ headers: { [OXY_REQUESTER_ASSERTION_HEADER]: sign(value) }, serviceApp });
297
+ expect(result.statusCode).toBe(401);
298
+ expect(result.body?.error).toBe('REQUESTER_ASSERTION_INACTIVE');
299
+ expect(result.request.userId).toBeUndefined();
300
+ }
301
+ });
302
+
303
+ it('reports each rejection with ids only', async () => {
304
+ const events: unknown[] = [];
305
+ const introspector = {
306
+ introspectRequesterAssertion: jest.fn(async () => ({ active: false })),
307
+ getBaseURL: () => 'https://api.oxy.so',
308
+ };
309
+ const middleware = createOxyRequesterAssertionAuth(introspector, {
310
+ audience: 'alia',
311
+ now: () => NOW,
312
+ resolvePublicKey: async () => KEY.publicKey,
313
+ onRejected: (event) => events.push(event),
314
+ });
315
+ const assertion = sign(claims());
316
+ const res = { status() { return this; }, json() { return this; } } as unknown as Response;
317
+ await middleware({ headers: { [OXY_REQUESTER_ASSERTION_HEADER]: assertion }, serviceApp } as unknown as Request, res, jest.fn());
318
+ expect(events).toEqual([{ code: 'inactive', status: 401, applicationId: 'homiio-app' }]);
319
+ expect(JSON.stringify(events)).not.toContain(assertion);
320
+ });
321
+
322
+ it('fails closed when Oxy cannot be asked', async () => {
323
+ const { run } = harness(async () => { throw new Error('ECONNREFUSED'); });
324
+ const result = await run({ headers: { [OXY_REQUESTER_ASSERTION_HEADER]: sign(claims()) }, serviceApp });
325
+ expect(result.statusCode).toBe(503);
326
+ expect(result.next).not.toHaveBeenCalled();
327
+ });
328
+ });
329
+
330
+ describe('OxyServices requester assertion calls', () => {
331
+ afterEach(() => jest.restoreAllMocks());
332
+
333
+ it('mints with the product service token and sends the subject token only in the body', async () => {
334
+ const oxy = new OxyServices({ baseURL: 'http://test.invalid' });
335
+ jest.spyOn(oxy, 'getServiceToken').mockResolvedValue('product-service-token');
336
+ const spy = jest.spyOn(oxy, 'makeRequest').mockResolvedValue({ assertion: 'a', expiresAt: 'e', requesterAccountId: 'u', agentId: 'g' } as never);
337
+ await oxy.mintRequesterAssertion({ agentId: 'sindi-agent', subjectToken: 'human-bearer' });
338
+ const [method, url, data, options] = spy.mock.calls[0] ?? [];
339
+ expect(method).toBe('POST');
340
+ expect(url).toBe('/internal/native-agents/requester-assertions');
341
+ expect(data).toEqual({ agentId: 'sindi-agent', subjectToken: 'human-bearer' });
342
+ expect(options?.headers).toEqual({ Authorization: 'Bearer product-service-token' });
343
+ expect(options?.retry).toBe(false);
344
+ expect(JSON.stringify(options)).not.toContain('human-bearer');
345
+ });
346
+
347
+ it('introspects with the audience service token and never retries a consuming call', async () => {
348
+ const oxy = new OxyServices({ baseURL: 'http://test.invalid' });
349
+ jest.spyOn(oxy, 'getServiceToken').mockResolvedValue('alia-service-token');
350
+ const spy = jest.spyOn(oxy, 'makeRequest').mockResolvedValue({ active: false } as never);
351
+ const presenter = { applicationId: 'homiio-app', credentialId: 'sindi-credential' };
352
+ await expect(oxy.introspectRequesterAssertion({ assertion: 'signed', presenter })).resolves.toEqual({ active: false });
353
+ const [method, url, data, options] = spy.mock.calls[0] ?? [];
354
+ expect([method, url]).toEqual(['POST', '/internal/native-agents/requester-assertions/introspect']);
355
+ expect(data).toEqual({ assertion: 'signed', presenter });
356
+ expect(options?.headers).toEqual({ Authorization: 'Bearer alia-service-token' });
357
+ expect(options?.retry).toBe(false);
358
+ });
359
+ });
@@ -1,9 +1,11 @@
1
1
  import type { NextFunction, Request, RequestHandler, Response } from 'express';
2
2
  import type { OxyServices } from '../OxyServices';
3
+ import type { OxyAuthRefusal } from '../mixins/OxyServices.utility';
4
+ import { logger } from '../logger';
3
5
  import { OXY_SERVICE_ENVIRONMENTS, type OxyServiceEnvironment } from '../utils/oxyServiceEnvironment';
4
6
 
5
7
  export { OXY_SERVICE_ENVIRONMENTS };
6
- export type { OxyServiceEnvironment };
8
+ export type { OxyServiceEnvironment, OxyAuthRefusal };
7
9
 
8
10
  export interface OxyRequestUser {
9
11
  id: string;
@@ -40,6 +42,12 @@ export interface OxyAuthRequest extends Request {
40
42
  sessionId?: string | null;
41
43
  serviceApp?: OxyServiceAppContext;
42
44
  serviceActingAs?: OxyServiceActingAsContext;
45
+ /**
46
+ * Why the presented credential was refused, when one was and the request
47
+ * still reached the handler (the optional path). Read it with
48
+ * {@link getOxyAuthRefusal} — never put it in a response body.
49
+ */
50
+ oxyAuthRefusal?: OxyAuthRefusal;
43
51
  }
44
52
 
45
53
  export interface OxyAuthenticatedRequest extends OxyAuthRequest {
@@ -210,9 +218,37 @@ export function getRequiredOxyUserId(req: Request): string {
210
218
  return userId;
211
219
  }
212
220
 
221
+ /**
222
+ * Why the credential on this request was refused, or `null` when none was
223
+ * presented (or it was accepted).
224
+ *
225
+ * Set by `oxy.auth()` — including the `optional: true` mount the composed
226
+ * helpers use, where a refusal otherwise leaves no trace: the request simply
227
+ * arrives unauthenticated and the host answers its own generic 401. Hosts log
228
+ * this beside their own 401; it is diagnostic and **must not be put into a
229
+ * response body**, which is exactly what it is kept out of.
230
+ */
231
+ export function getOxyAuthRefusal(req: Request): OxyAuthRefusal | null {
232
+ return (req as OxyAuthRequest).oxyAuthRefusal ?? null;
233
+ }
234
+
213
235
  export function requireOxyAuth(req: Request, res: Response, next: NextFunction): void {
214
236
  const userId = getOxyUserId(req);
215
237
  if (!userId) {
238
+ // The body stays exactly as generic as it was. The LOG does not: this 401
239
+ // is the one a caller sees when the optional resolver already refused a
240
+ // real credential, and printing that code here is what turns "Homiio got
241
+ // 401, Alia logged nothing" into one greppable line.
242
+ const refusal = getOxyAuthRefusal(req);
243
+ if (refusal) {
244
+ logger.warn(`[oxy.auth] 401 after refusal ${refusal.code}: ${refusal.reason}`, {
245
+ component: 'auth',
246
+ method: 'requireOxyAuth',
247
+ code: refusal.code,
248
+ stage: refusal.stage,
249
+ reason: refusal.reason,
250
+ });
251
+ }
216
252
  res.status(401).json({
217
253
  error: 'Unauthorized',
218
254
  message: 'Authentication required',
@@ -18,6 +18,7 @@
18
18
  export {
19
19
  createOptionalOxyAuth,
20
20
  createOxyAuthMiddleware,
21
+ getOxyAuthRefusal,
21
22
  getOxyBillingPrincipal,
22
23
  getOxyDelegatedUserId,
23
24
  getOxyRequestAttribution,
@@ -30,6 +31,7 @@ export {
30
31
  } from './auth';
31
32
  export type {
32
33
  OxyAuthenticatedRequest,
34
+ OxyAuthRefusal,
33
35
  OxyAuthMiddlewareOptions,
34
36
  OxyAuthRequest,
35
37
  OxyBillingPrincipal,
@@ -109,6 +111,33 @@ export type {
109
111
  CapabilityTicketVerificationOptions,
110
112
  } from './capabilityTicket';
111
113
 
114
+ // Present-requester assertions (ADR 0025): a product backend trades a signed-in
115
+ // person's live session with Oxy for a one-use assertion its audience consumes.
116
+ export {
117
+ createOxyJwksKeyResolver,
118
+ createOxyRequesterAssertionAuth,
119
+ OXY_REQUESTER_ASSERTION_DEFAULT_ISSUER,
120
+ OXY_REQUESTER_ASSERTION_HEADER,
121
+ OXY_REQUESTER_ASSERTION_MAX_TTL_SECONDS,
122
+ OXY_REQUESTER_ASSERTION_TYPE,
123
+ OxyRequesterAssertionError,
124
+ oxyRequesterAssertionClaimsSchema,
125
+ readOxyRequesterAssertionKeyId,
126
+ signOxyRequesterAssertion,
127
+ verifyOxyRequesterAssertion,
128
+ } from './requesterAssertion';
129
+ export type {
130
+ OxyJwksKeyResolverOptions,
131
+ OxyRequesterAssertionAuthOptions,
132
+ OxyRequesterAssertionClaims,
133
+ OxyRequesterAssertionErrorCode,
134
+ OxyRequesterAssertionIntrospection,
135
+ OxyRequesterAssertionIntrospector,
136
+ OxyRequesterAssertionRequest,
137
+ OxyRequesterAssertionVerificationOptions,
138
+ OxyRequesterContext,
139
+ } from './requesterAssertion';
140
+
112
141
  // Constant-time secret comparison.
113
142
  export { verifySecret } from './verifySecret';
114
143