@oxy.so/core 7.26.0 → 7.28.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.
@@ -666,6 +666,20 @@ const dict = {
666
666
  month: 'Month',
667
667
  year: 'Year',
668
668
  },
669
+ pronouns: {
670
+ title: 'Pronouns',
671
+ subtitle: 'How people should refer to you',
672
+ label: 'Pronouns',
673
+ options: {
674
+ unspecified: 'Not set',
675
+ he_him: 'He/him',
676
+ she_her: 'She/her',
677
+ they_them: 'They/them',
678
+ he_they: 'He/they',
679
+ she_they: 'She/they',
680
+ it_its: 'It/its',
681
+ },
682
+ },
669
683
  locations: {
670
684
  title: 'Locations',
671
685
  subtitle: "Places you've been or live",
@@ -368,6 +368,20 @@ const dict = {
368
368
  month: 'Mes',
369
369
  year: 'Año',
370
370
  },
371
+ pronouns: {
372
+ title: 'Pronombres',
373
+ subtitle: 'Cómo deben referirse a ti las personas',
374
+ label: 'Pronombres',
375
+ options: {
376
+ unspecified: 'Sin definir',
377
+ he_him: 'He/him',
378
+ she_her: 'She/her',
379
+ they_them: 'They/them',
380
+ he_they: 'He/they',
381
+ she_they: 'She/they',
382
+ it_its: 'It/its',
383
+ },
384
+ },
371
385
  locations: {
372
386
  title: 'Ubicaciones',
373
387
  subtitle: 'Lugares donde has estado o vives',
@@ -80,9 +80,26 @@ export class IdentityApi {
80
80
  * Resolve the W3C DID document for any user. The API derives it on demand
81
81
  * from the account's `authMethods` + `publicKey` — there is no stored
82
82
  * document. Public (no auth required); short-TTL cached.
83
+ *
84
+ * `{ fresh: true }` reads the document as it is NOW: it skips (and drops)
85
+ * this client's cached copy, is not joined to an in-flight read, and sends
86
+ * `Cache-Control: no-cache` so no HTTP cache on the way answers for the
87
+ * origin. Use it whenever the answer decides where money goes: `#key-1` is
88
+ * the account's Peable receive key and changes on a rotation or an
89
+ * organization key replacement, and a cached copy would derive an address
90
+ * from the previous key for up to the cache TTL.
83
91
  */
84
- async resolveDid(userId) {
85
- return this.ctx.request('GET', `/u/${encodeURIComponent(userId)}/did.json`, undefined, {
92
+ async resolveDid(userId, options = {}) {
93
+ const path = `/u/${encodeURIComponent(userId)}/did.json`;
94
+ if (options.fresh) {
95
+ this.ctx.http.invalidateCache({ keys: [`GET:${path}`] });
96
+ return this.ctx.request('GET', path, undefined, {
97
+ cache: false,
98
+ deduplicate: false,
99
+ headers: { 'Cache-Control': 'no-cache' },
100
+ });
101
+ }
102
+ return this.ctx.request('GET', path, undefined, {
86
103
  cache: true,
87
104
  cacheTTL: SHORT_TTL,
88
105
  });
@@ -58,6 +58,12 @@ export function deriveScopedSeedFromKey(privateKeyHex, info) {
58
58
  * `HMAC-SHA256(SOCIAL_RECEIVE_CHAIN_CODE_KEY, compressed identity public key)`.
59
59
  * Identical to `@fairco.in/core`'s `deriveSocialReceiveSpendingKey`.
60
60
  *
61
+ * INTERNAL to `@oxy.so/core` (not exported from `@oxy.so/core/crypto`): the
62
+ * derivation is non-hardened and the chain code is a public function of the
63
+ * identity public key, so `identity = child - I_L mod n` — whoever holds one
64
+ * child private key and the public key holds the identity key. Callers get
65
+ * signatures ({@link signSocialReceiveDigest}), never the child key.
66
+ *
61
67
  * @returns the child private key and its compressed public key, lowercase hex.
62
68
  */
63
69
  export function deriveSocialReceiveKey(privateKeyHex, index) {
@@ -24,8 +24,12 @@ export { hkdfSha256 } from './kdf.js';
24
24
  export { encryptAead, decryptAead, AEAD_KEY_LENGTH, AEAD_NONCE_LENGTH } from './aead.js';
25
25
  export { deriveSharedSecret } from './ecdh.js';
26
26
  // What the identity key computes without leaving its holder: the same functions
27
- // Commons' identity host implements natively on Android.
28
- export { SCOPED_SEED_KDF_SALT, SOCIAL_RECEIVE_CHAIN_CODE_KEY, MAX_SOCIAL_RECEIVE_INDEX, deriveScopedSeedFromKey, deriveSocialReceiveKey, signSocialReceiveDigest, authChallengeDigest, } from './identityDerivations.js';
27
+ // Commons' identity host implements natively on Android. The social-receive
28
+ // CHILD private key (`deriveSocialReceiveKey`) is deliberately not here: the
29
+ // derivation is non-hardened under a chain code anyone can compute from the
30
+ // public key, so one leaked child private key reveals the identity key. Only
31
+ // signatures (`signSocialReceiveDigest`) leave this module.
32
+ export { SCOPED_SEED_KDF_SALT, SOCIAL_RECEIVE_CHAIN_CODE_KEY, MAX_SOCIAL_RECEIVE_INDEX, deriveScopedSeedFromKey, signSocialReceiveDigest, authChallengeDigest, } from './identityDerivations.js';
29
33
  // Identity proofs — the one signed format for operations on a personal root
30
34
  // (docs/adr/0024-one-oxy-account-root-holders.md D7)
31
35
  export { digestIdentityPayload, signIdentityProof } from './identityProof.js';