@oxy.so/core 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/crypto/deviceBackup.js +75 -0
- package/dist/cjs/crypto/keyManager.js +285 -12
- package/dist/cjs/mixins/OxyServices.linkedAccounts.js +79 -0
- package/dist/cjs/mixins/OxyServices.user.js +5 -1
- package/dist/cjs/mixins/index.js +4 -0
- package/dist/cjs/server/securityHeaders.js +3 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/crypto/deviceBackup.js +70 -0
- package/dist/esm/crypto/keyManager.js +252 -12
- package/dist/esm/mixins/OxyServices.linkedAccounts.js +76 -0
- package/dist/esm/mixins/OxyServices.user.js +5 -1
- package/dist/esm/mixins/index.js +4 -0
- package/dist/esm/server/securityHeaders.js +3 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/crypto/deviceBackup.d.ts +60 -0
- package/dist/types/crypto/keyManager.d.ts +79 -12
- package/dist/types/index.d.ts +1 -0
- package/dist/types/mixins/OxyServices.linkedAccounts.d.ts +107 -0
- package/dist/types/mixins/OxyServices.user.d.ts +7 -2
- package/dist/types/mixins/index.d.ts +2 -1
- package/dist/types/models/interfaces.d.ts +30 -0
- package/dist/types/server/securityHeaders.d.ts +5 -0
- package/package.json +2 -2
- package/src/crypto/__tests__/keyManager.deviceBackup.test.ts +310 -0
- package/src/crypto/deviceBackup.ts +108 -0
- package/src/crypto/keyManager.ts +278 -13
- package/src/index.ts +1 -0
- package/src/mixins/OxyServices.linkedAccounts.ts +129 -0
- package/src/mixins/OxyServices.user.ts +7 -2
- package/src/mixins/__tests__/linkedAccounts.test.ts +109 -0
- package/src/mixins/index.ts +6 -0
- package/src/models/interfaces.ts +30 -1
- package/src/server/__tests__/securityHeaders.test.ts +7 -0
- package/src/server/securityHeaders.ts +8 -0
package/src/models/interfaces.ts
CHANGED
|
@@ -115,6 +115,13 @@ export interface User {
|
|
|
115
115
|
* lists, profile search) — the two are separate fields on the User document.
|
|
116
116
|
*/
|
|
117
117
|
description?: string;
|
|
118
|
+
/**
|
|
119
|
+
* ActivityPub actor URIs this account is also known as — its live,
|
|
120
|
+
* OAuth-proven linked Mastodon-API accounts. Emitted by
|
|
121
|
+
* `GET /profiles/username/:username`; a relying app passes it to the shared
|
|
122
|
+
* actor builder (`@oxy.so/federation`) so its actor publishes it.
|
|
123
|
+
*/
|
|
124
|
+
alsoKnownAs?: string[];
|
|
118
125
|
phone?: string;
|
|
119
126
|
address?: string;
|
|
120
127
|
/** Legacy free-text birthday, kept for backward compatibility. Prefer `dateOfBirth`. */
|
|
@@ -263,7 +270,22 @@ export interface LoginResponse {
|
|
|
263
270
|
export interface Notification {
|
|
264
271
|
id: string;
|
|
265
272
|
message: string;
|
|
266
|
-
|
|
273
|
+
/** One of `OXY_NOTIFICATION_TYPES` (`@oxy.so/contracts`). */
|
|
274
|
+
type?: string;
|
|
275
|
+
/**
|
|
276
|
+
* `system` notifications only (with `message`): the text an Oxy service sent
|
|
277
|
+
* about the recipient's own account. Render these two instead of composing a
|
|
278
|
+
* sentence from actor + entity.
|
|
279
|
+
*/
|
|
280
|
+
title?: string;
|
|
281
|
+
/** `system` notifications only: an optional deep link (https or the sending app's scheme). */
|
|
282
|
+
url?: string;
|
|
283
|
+
/**
|
|
284
|
+
* What `entityId` names: `post` | `reply` | `profile`, or `app` — an opaque id
|
|
285
|
+
* in the notifying application's namespace (`system` notifications only).
|
|
286
|
+
*/
|
|
287
|
+
entityType?: string;
|
|
288
|
+
entityId?: string;
|
|
267
289
|
}
|
|
268
290
|
|
|
269
291
|
export interface Wallet {
|
|
@@ -666,6 +688,13 @@ export interface ServiceAssetMetadata {
|
|
|
666
688
|
* play. Treat absence as "no adaptive stream, play the progressive original".
|
|
667
689
|
*/
|
|
668
690
|
hlsReadyAt?: string;
|
|
691
|
+
/**
|
|
692
|
+
* The Oxy user who owns the file (`null` for a system-owned file such as the
|
|
693
|
+
* federated media cache). PRESENT ONLY for Oxy's own applications (service
|
|
694
|
+
* tokens with `tier: 'internal'`), so a first-party service can check that an
|
|
695
|
+
* asset a user attached is really that user's. Absent for every other caller.
|
|
696
|
+
*/
|
|
697
|
+
ownerUserId?: string | null;
|
|
669
698
|
}
|
|
670
699
|
|
|
671
700
|
/**
|
|
@@ -211,6 +211,13 @@ describe('@oxy.so/core/server buildOxyPagesHeaders on a sensitive origin (ADR 00
|
|
|
211
211
|
expect(sensitive).toContain('https://api.oxy.so');
|
|
212
212
|
expect(sensitive).toContain("frame-ancestors 'none'");
|
|
213
213
|
});
|
|
214
|
+
|
|
215
|
+
it('sends no-transform so the edge never injects the beacon, and only there', () => {
|
|
216
|
+
expect(buildOxyPagesHeaders({ sensitive: true })).toContain(
|
|
217
|
+
'Cache-Control: public, max-age=0, must-revalidate, no-transform',
|
|
218
|
+
);
|
|
219
|
+
expect(buildOxyPagesHeaders()).not.toContain('Cache-Control');
|
|
220
|
+
});
|
|
214
221
|
});
|
|
215
222
|
|
|
216
223
|
describe('@oxy.so/core/server extractInlineScripts', () => {
|
|
@@ -366,6 +366,11 @@ export interface OxyPagesHeadersOptions {
|
|
|
366
366
|
* the app — is REMOVED from `script-src` and `connect-src`, so third-party
|
|
367
367
|
* measurement cannot run there even when the zone has Web Analytics enabled.
|
|
368
368
|
* A structural block in the policy the page is served with, not a build flag.
|
|
369
|
+
*
|
|
370
|
+
* It also sends `Cache-Control: no-transform`, which stops the edge from
|
|
371
|
+
* injecting the beacon at all — otherwise every page load logs a CSP
|
|
372
|
+
* violation for a script we never asked for. The rest of the value is Pages'
|
|
373
|
+
* own default, so caching is unchanged.
|
|
369
374
|
*/
|
|
370
375
|
sensitive?: boolean;
|
|
371
376
|
/**
|
|
@@ -429,6 +434,9 @@ export function buildOxyPagesHeaders(options: OxyPagesHeadersOptions = {}): stri
|
|
|
429
434
|
if (options.hsts !== false) {
|
|
430
435
|
lines.push(' Strict-Transport-Security: max-age=31536000; includeSubDomains; preload');
|
|
431
436
|
}
|
|
437
|
+
if (options.sensitive) {
|
|
438
|
+
lines.push(' Cache-Control: public, max-age=0, must-revalidate, no-transform');
|
|
439
|
+
}
|
|
432
440
|
lines.push('');
|
|
433
441
|
return lines.join('\n');
|
|
434
442
|
}
|