@oxy.so/core 4.5.0-oxy-one.1 → 4.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.
Files changed (282) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/HttpService.js +63 -19
  3. package/dist/cjs/api/accounts.js +10 -3
  4. package/dist/cjs/api/agency.js +3 -1
  5. package/dist/cjs/api/apps.js +15 -4
  6. package/dist/cjs/api/assets.js +39 -11
  7. package/dist/cjs/api/auth.js +28 -8
  8. package/dist/cjs/api/billing.js +24 -7
  9. package/dist/cjs/api/civic.js +14 -4
  10. package/dist/cjs/api/follows.js +9 -2
  11. package/dist/cjs/api/identity.js +31 -9
  12. package/dist/cjs/api/nodes.js +3 -1
  13. package/dist/cjs/api/privacy.js +8 -2
  14. package/dist/cjs/api/session.js +15 -4
  15. package/dist/cjs/api/store.js +15 -5
  16. package/dist/cjs/api/topics.js +10 -3
  17. package/dist/cjs/api/users.js +16 -4
  18. package/dist/cjs/boot/sessionColdBoot.js +40 -13
  19. package/dist/cjs/constants/version.js +6 -6
  20. package/dist/cjs/crypto/identityMarker.js +3 -1
  21. package/dist/cjs/crypto/identityProof.js +6 -1
  22. package/dist/cjs/crypto/keyManager.js +87 -32
  23. package/dist/cjs/crypto/recoveryPhrase.js +2 -2
  24. package/dist/cjs/crypto/signatureService.js +3 -4
  25. package/dist/cjs/i18n/index.js +16 -3
  26. package/dist/cjs/i18n/locales/ar-SA.js +366 -366
  27. package/dist/cjs/i18n/locales/ca-ES.js +366 -366
  28. package/dist/cjs/i18n/locales/de-DE.js +366 -366
  29. package/dist/cjs/i18n/locales/en-US.js +1994 -1994
  30. package/dist/cjs/i18n/locales/es-ES.js +1994 -1994
  31. package/dist/cjs/i18n/locales/fr-FR.js +366 -366
  32. package/dist/cjs/i18n/locales/it-IT.js +366 -366
  33. package/dist/cjs/i18n/locales/ja-JP.js +366 -366
  34. package/dist/cjs/i18n/locales/ko-KR.js +366 -366
  35. package/dist/cjs/i18n/locales/pt-PT.js +366 -366
  36. package/dist/cjs/i18n/locales/zh-CN.js +366 -366
  37. package/dist/cjs/inference/OxyInferenceClient.js +12 -18
  38. package/dist/cjs/models/interfaces.js +11 -11
  39. package/dist/cjs/server/OxyServer.js +86 -28
  40. package/dist/cjs/server/agentAccount.js +6 -2
  41. package/dist/cjs/server/aliaMachineCredential.js +39 -14
  42. package/dist/cjs/server/auth.js +5 -4
  43. package/dist/cjs/server/capabilityTicket.js +5 -5
  44. package/dist/cjs/server/index.js +2 -1
  45. package/dist/cjs/server/liveCapabilityTicket.js +4 -1
  46. package/dist/cjs/server/middleware.js +61 -42
  47. package/dist/cjs/server/namespaces.js +28 -7
  48. package/dist/cjs/server/requesterAssertion.js +36 -30
  49. package/dist/cjs/server/serviceTokenLifetime.js +7 -4
  50. package/dist/cjs/server/traffic.js +53 -14
  51. package/dist/cjs/server/trafficNodeHttp.js +33 -8
  52. package/dist/cjs/server/workloadIdentity.client.js +4 -0
  53. package/dist/cjs/server/workloadIdentity.js +28 -1
  54. package/dist/cjs/session/SessionClient.js +54 -17
  55. package/dist/cjs/session/accountDelegationAccess.js +4 -6
  56. package/dist/cjs/session/accountDialogController.js +1 -1
  57. package/dist/cjs/session/authStateStore.js +18 -9
  58. package/dist/cjs/session/identityPin.js +6 -2
  59. package/dist/cjs/session/refresh.js +81 -23
  60. package/dist/cjs/session/sharedDeviceCredential.js +28 -15
  61. package/dist/cjs/shared/utils/errorUtils.js +1 -1
  62. package/dist/cjs/shared/utils/networkUtils.js +1 -1
  63. package/dist/cjs/shared/utils/themeUtils.js +1 -1
  64. package/dist/cjs/utils/accountCacheSweep.js +3 -1
  65. package/dist/cjs/utils/accountUtils.js +1 -3
  66. package/dist/cjs/utils/asyncUtils.js +1 -1
  67. package/dist/cjs/utils/authHelpers.js +2 -1
  68. package/dist/cjs/utils/avatarUtils.js +4 -2
  69. package/dist/cjs/utils/cache.js +1 -1
  70. package/dist/cjs/utils/cacheKey.js +3 -1
  71. package/dist/cjs/utils/deviceManager.js +4 -4
  72. package/dist/cjs/utils/errorUtils.js +6 -4
  73. package/dist/cjs/utils/languageUtils.js +404 -57
  74. package/dist/cjs/utils/profileLinks.js +1 -3
  75. package/dist/cjs/utils/requestUtils.js +7 -1
  76. package/dist/cjs/utils/userIdentity.js +1 -1
  77. package/dist/cjs/utils/validationUtils.js +5 -6
  78. package/dist/esm/HttpService.js +64 -20
  79. package/dist/esm/api/accounts.js +11 -4
  80. package/dist/esm/api/agency.js +3 -1
  81. package/dist/esm/api/apps.js +15 -4
  82. package/dist/esm/api/assets.js +39 -11
  83. package/dist/esm/api/auth.js +28 -8
  84. package/dist/esm/api/billing.js +25 -8
  85. package/dist/esm/api/civic.js +14 -4
  86. package/dist/esm/api/follows.js +9 -2
  87. package/dist/esm/api/identity.js +31 -9
  88. package/dist/esm/api/nodes.js +3 -1
  89. package/dist/esm/api/privacy.js +8 -2
  90. package/dist/esm/api/session.js +15 -4
  91. package/dist/esm/api/store.js +15 -5
  92. package/dist/esm/api/topics.js +10 -3
  93. package/dist/esm/api/users.js +16 -4
  94. package/dist/esm/boot/sessionColdBoot.js +41 -14
  95. package/dist/esm/constants/version.js +6 -6
  96. package/dist/esm/crypto/identityMarker.js +3 -1
  97. package/dist/esm/crypto/identityProof.js +6 -1
  98. package/dist/esm/crypto/internal.js +1 -1
  99. package/dist/esm/crypto/keyManager.js +87 -32
  100. package/dist/esm/crypto/recoveryPhrase.js +2 -2
  101. package/dist/esm/crypto/signatureService.js +3 -4
  102. package/dist/esm/i18n/index.js +16 -3
  103. package/dist/esm/i18n/locales/ar-SA.js +366 -366
  104. package/dist/esm/i18n/locales/ca-ES.js +366 -366
  105. package/dist/esm/i18n/locales/de-DE.js +366 -366
  106. package/dist/esm/i18n/locales/en-US.js +1994 -1994
  107. package/dist/esm/i18n/locales/es-ES.js +1994 -1994
  108. package/dist/esm/i18n/locales/fr-FR.js +366 -366
  109. package/dist/esm/i18n/locales/it-IT.js +366 -366
  110. package/dist/esm/i18n/locales/ja-JP.js +366 -366
  111. package/dist/esm/i18n/locales/ko-KR.js +366 -366
  112. package/dist/esm/i18n/locales/pt-PT.js +366 -366
  113. package/dist/esm/i18n/locales/zh-CN.js +366 -366
  114. package/dist/esm/index.js +1 -1
  115. package/dist/esm/inference/OxyInferenceClient.js +13 -19
  116. package/dist/esm/models/interfaces.js +11 -11
  117. package/dist/esm/server/OxyServer.js +87 -29
  118. package/dist/esm/server/agentAccount.js +6 -2
  119. package/dist/esm/server/aliaMachineCredential.js +39 -14
  120. package/dist/esm/server/auth.js +6 -5
  121. package/dist/esm/server/capabilityTicket.js +6 -6
  122. package/dist/esm/server/index.js +5 -5
  123. package/dist/esm/server/liveCapabilityTicket.js +6 -3
  124. package/dist/esm/server/middleware.js +62 -43
  125. package/dist/esm/server/namespaces.js +31 -10
  126. package/dist/esm/server/requesterAssertion.js +36 -30
  127. package/dist/esm/server/serviceTokenLifetime.js +7 -4
  128. package/dist/esm/server/traffic.js +55 -16
  129. package/dist/esm/server/trafficNodeHttp.js +34 -9
  130. package/dist/esm/server/userInvalidation.js +1 -1
  131. package/dist/esm/server/workloadIdentity.client.js +3 -0
  132. package/dist/esm/server/workloadIdentity.js +27 -1
  133. package/dist/esm/session/SessionClient.js +54 -17
  134. package/dist/esm/session/accountDelegationAccess.js +5 -7
  135. package/dist/esm/session/accountDialogController.js +1 -1
  136. package/dist/esm/session/authStateStore.js +18 -9
  137. package/dist/esm/session/identityPin.js +6 -2
  138. package/dist/esm/session/refresh.js +82 -24
  139. package/dist/esm/session/sharedDeviceCredential.js +28 -15
  140. package/dist/esm/shared/utils/errorUtils.js +1 -1
  141. package/dist/esm/shared/utils/networkUtils.js +1 -1
  142. package/dist/esm/shared/utils/themeUtils.js +1 -1
  143. package/dist/esm/utils/accountCacheSweep.js +3 -1
  144. package/dist/esm/utils/accountUtils.js +1 -3
  145. package/dist/esm/utils/asyncUtils.js +1 -1
  146. package/dist/esm/utils/authHelpers.js +2 -1
  147. package/dist/esm/utils/avatarUtils.js +4 -2
  148. package/dist/esm/utils/cache.js +1 -1
  149. package/dist/esm/utils/cacheKey.js +3 -1
  150. package/dist/esm/utils/deviceManager.js +4 -4
  151. package/dist/esm/utils/errorUtils.js +6 -4
  152. package/dist/esm/utils/languageUtils.js +404 -57
  153. package/dist/esm/utils/profileLinks.js +1 -3
  154. package/dist/esm/utils/requestUtils.js +7 -1
  155. package/dist/esm/utils/userIdentity.js +1 -1
  156. package/dist/esm/utils/validationUtils.js +5 -6
  157. package/dist/types/HttpService.d.ts +1 -1
  158. package/dist/types/api/accounts.d.ts +1 -1
  159. package/dist/types/api/apps.d.ts +4 -4
  160. package/dist/types/crypto/internal.d.ts +1 -1
  161. package/dist/types/index.d.ts +4 -4
  162. package/dist/types/server/index.d.ts +6 -6
  163. package/dist/types/server/workloadIdentity.client.d.ts +5 -1
  164. package/dist/types/server/workloadIdentity.d.ts +26 -0
  165. package/dist/types/session/accountDelegationAccess.d.ts +1 -1
  166. package/dist/types/session/index.d.ts +1 -1
  167. package/dist/types/utils/userIdentity.d.ts +1 -1
  168. package/dist/types/utils/validationUtils.d.ts +4 -5
  169. package/package.json +2 -3
  170. package/src/HttpService.ts +183 -53
  171. package/src/OxyServices.errors.ts +7 -3
  172. package/src/OxyServices.ts +6 -2
  173. package/src/api/accounts.ts +76 -26
  174. package/src/api/agency.ts +24 -9
  175. package/src/api/appData.ts +12 -2
  176. package/src/api/apps.ts +81 -31
  177. package/src/api/assets.ts +113 -43
  178. package/src/api/auth.ts +145 -77
  179. package/src/api/billing.ts +112 -65
  180. package/src/api/civic.ts +61 -19
  181. package/src/api/contacts.ts +4 -1
  182. package/src/api/devices.ts +54 -21
  183. package/src/api/follows.ts +88 -31
  184. package/src/api/identity.ts +101 -33
  185. package/src/api/linkedAccounts.ts +26 -8
  186. package/src/api/nodes.ts +18 -6
  187. package/src/api/notifications.ts +26 -6
  188. package/src/api/privacy.ts +42 -8
  189. package/src/api/reputation.ts +18 -7
  190. package/src/api/session.ts +23 -5
  191. package/src/api/store.ts +81 -31
  192. package/src/api/topics.ts +18 -6
  193. package/src/api/users.ts +98 -35
  194. package/src/boot/sessionColdBoot.ts +60 -19
  195. package/src/civic/payloads.ts +1 -4
  196. package/src/client/context.ts +6 -1
  197. package/src/constants/version.ts +7 -6
  198. package/src/crypto/aead.ts +1 -5
  199. package/src/crypto/ecdh.ts +1 -4
  200. package/src/crypto/identityDerivations.ts +5 -1
  201. package/src/crypto/identityMarker.ts +3 -1
  202. package/src/crypto/identityProof.ts +6 -1
  203. package/src/crypto/index.ts +11 -11
  204. package/src/crypto/internal.ts +6 -1
  205. package/src/crypto/keyManager.ts +348 -98
  206. package/src/crypto/recoveryPhrase.ts +14 -9
  207. package/src/crypto/registrationPow.ts +1 -1
  208. package/src/crypto/signatureService.ts +14 -6
  209. package/src/i18n/accountCategoryLabels.ts +1 -4
  210. package/src/i18n/accountRoleLabels.ts +1 -4
  211. package/src/i18n/index.ts +25 -7
  212. package/src/i18n/locales/ar-SA.ts +375 -366
  213. package/src/i18n/locales/ca-ES.ts +382 -366
  214. package/src/i18n/locales/de-DE.ts +387 -366
  215. package/src/i18n/locales/en-US.ts +2034 -1994
  216. package/src/i18n/locales/es-ES.ts +2043 -1994
  217. package/src/i18n/locales/fr-FR.ts +387 -366
  218. package/src/i18n/locales/it-IT.ts +380 -366
  219. package/src/i18n/locales/ja-JP.ts +380 -366
  220. package/src/i18n/locales/ko-KR.ts +377 -366
  221. package/src/i18n/locales/pt-PT.ts +383 -366
  222. package/src/i18n/locales/zh-CN.ts +373 -366
  223. package/src/i18n/trustTierLabels.ts +1 -4
  224. package/src/index.ts +371 -349
  225. package/src/inference/OxyInferenceClient.ts +784 -780
  226. package/src/models/interfaces.ts +30 -27
  227. package/src/server/OxyServer.ts +227 -68
  228. package/src/server/agentAccount.ts +8 -2
  229. package/src/server/aliaMachineCredential.ts +57 -16
  230. package/src/server/auth.ts +9 -5
  231. package/src/server/capabilityTicket.ts +30 -21
  232. package/src/server/index.ts +29 -6
  233. package/src/server/liveCapabilityTicket.ts +31 -9
  234. package/src/server/middleware.ts +212 -121
  235. package/src/server/namespaces.ts +247 -94
  236. package/src/server/rateLimit.ts +2 -4
  237. package/src/server/requesterAssertion.ts +93 -54
  238. package/src/server/serviceTokenLifetime.ts +9 -4
  239. package/src/server/traffic.ts +117 -23
  240. package/src/server/trafficNodeHttp.ts +61 -14
  241. package/src/server/userInvalidation.ts +1 -4
  242. package/src/server/workloadIdentity.client.ts +12 -1
  243. package/src/server/workloadIdentity.ts +52 -5
  244. package/src/session/SessionClient.ts +170 -49
  245. package/src/session/accountDelegationAccess.ts +24 -31
  246. package/src/session/accountDialogController.ts +59 -14
  247. package/src/session/accountSwitchTargets.ts +10 -15
  248. package/src/session/authStateStore.ts +121 -81
  249. package/src/session/deviceDirectory.ts +1 -3
  250. package/src/session/identityPin.ts +10 -11
  251. package/src/session/identitySession.ts +3 -1
  252. package/src/session/index.ts +87 -82
  253. package/src/session/refresh.ts +138 -44
  254. package/src/session/sessionClientHost.ts +1 -3
  255. package/src/session/sharedDeviceCredential.ts +35 -14
  256. package/src/session/socketLoader.ts +9 -2
  257. package/src/shared/utils/errorUtils.ts +5 -2
  258. package/src/shared/utils/networkUtils.ts +5 -8
  259. package/src/shared/utils/themeUtils.ts +2 -6
  260. package/src/types/buffer.d.ts +66 -21
  261. package/src/types/expo-secure-store.d.ts +5 -1
  262. package/src/utils/accountCacheSweep.ts +4 -5
  263. package/src/utils/accountUtils.ts +107 -108
  264. package/src/utils/apiUtils.ts +3 -3
  265. package/src/utils/asyncUtils.ts +2 -2
  266. package/src/utils/authHelpers.ts +10 -5
  267. package/src/utils/avatarUtils.ts +11 -6
  268. package/src/utils/cache.ts +9 -10
  269. package/src/utils/cacheKey.ts +5 -1
  270. package/src/utils/coldBoot.ts +1 -3
  271. package/src/utils/commonsDelivery.ts +1 -4
  272. package/src/utils/deviceManager.ts +15 -14
  273. package/src/utils/errorUtils.ts +68 -86
  274. package/src/utils/languageUtils.ts +407 -58
  275. package/src/utils/oauthPkce.ts +1 -4
  276. package/src/utils/platform.ts +0 -1
  277. package/src/utils/profileLinks.ts +2 -5
  278. package/src/utils/requestUtils.ts +18 -14
  279. package/src/utils/sessionUtils.ts +34 -33
  280. package/src/utils/userHandle.ts +3 -1
  281. package/src/utils/userIdentity.ts +1 -1
  282. package/src/utils/validationUtils.ts +11 -9
@@ -205,9 +205,7 @@ class OxyInferenceClient {
205
205
  return __classPrivateFieldGet(this, _OxyInferenceClient_instances, "m", _OxyInferenceClient_request).call(this, 'POST', '/v1/responses', {
206
206
  body: request,
207
207
  ...(options.signal === undefined ? {} : { signal: options.signal }),
208
- ...(options.idempotencyKey === undefined
209
- ? {}
210
- : { idempotencyKey: options.idempotencyKey }),
208
+ ...(options.idempotencyKey === undefined ? {} : { idempotencyKey: options.idempotencyKey }),
211
209
  ...(options.delegatedUserId === undefined
212
210
  ? {}
213
211
  : { delegatedUserId: options.delegatedUserId }),
@@ -224,7 +222,8 @@ class OxyInferenceClient {
224
222
  delegatedUserId: options.delegatedUserId,
225
223
  });
226
224
  const parsed = contracts_1.decisionSuccessSchema.safeParse(payload);
227
- if (!parsed.success || parsed.data.model !== input.model ||
225
+ if (!parsed.success ||
226
+ parsed.data.model !== input.model ||
228
227
  !(0, contracts_1.decisionAnswersMatch)(input, parsed.data.data)) {
229
228
  throw new OxyInferenceProtocolError('Invalid or mismatched decisions response.');
230
229
  }
@@ -236,9 +235,7 @@ class OxyInferenceClient {
236
235
  method: 'POST',
237
236
  headers: await __classPrivateFieldGet(this, _OxyInferenceClient_instances, "m", _OxyInferenceClient_headers).call(this, 'audio/*', {
238
237
  hasBody: true,
239
- ...(options.idempotencyKey === undefined
240
- ? {}
241
- : { idempotencyKey: options.idempotencyKey }),
238
+ ...(options.idempotencyKey === undefined ? {} : { idempotencyKey: options.idempotencyKey }),
242
239
  ...(options.delegatedUserId === undefined
243
240
  ? {}
244
241
  : { delegatedUserId: options.delegatedUserId }),
@@ -310,9 +307,7 @@ class OxyInferenceClient {
310
307
  method: 'POST',
311
308
  headers: await __classPrivateFieldGet(this, _OxyInferenceClient_instances, "m", _OxyInferenceClient_headers).call(this, 'text/event-stream', {
312
309
  hasBody: true,
313
- ...(options.idempotencyKey === undefined
314
- ? {}
315
- : { idempotencyKey: options.idempotencyKey }),
310
+ ...(options.idempotencyKey === undefined ? {} : { idempotencyKey: options.idempotencyKey }),
316
311
  ...(options.delegatedUserId === undefined
317
312
  ? {}
318
313
  : { delegatedUserId: options.delegatedUserId }),
@@ -411,9 +406,7 @@ exports.OxyInferenceClient = OxyInferenceClient;
411
406
  _OxyInferenceClient_baseURL = new WeakMap(), _OxyInferenceClient_credential = new WeakMap(), _OxyInferenceClient_fetch = new WeakMap(), _OxyInferenceClient_instances = new WeakSet(), _OxyInferenceClient_bearer =
412
407
  /** The bearer for this request, from whichever lane was configured. */
413
408
  async function _OxyInferenceClient_bearer() {
414
- const value = typeof __classPrivateFieldGet(this, _OxyInferenceClient_credential, "f") === 'string'
415
- ? __classPrivateFieldGet(this, _OxyInferenceClient_credential, "f")
416
- : await __classPrivateFieldGet(this, _OxyInferenceClient_credential, "f").call(this);
409
+ const value = typeof __classPrivateFieldGet(this, _OxyInferenceClient_credential, "f") === 'string' ? __classPrivateFieldGet(this, _OxyInferenceClient_credential, "f") : await __classPrivateFieldGet(this, _OxyInferenceClient_credential, "f").call(this);
417
410
  if (value === null || value === undefined || value.length === 0) {
418
411
  throw new Error('OxyInferenceClient has no bearer: the configured credential resolved to nothing. On the Oxy auth lane this usually means the session is not restored yet.');
419
412
  }
@@ -451,9 +444,7 @@ async function _OxyInferenceClient_request(method, path, options) {
451
444
  method,
452
445
  headers: await __classPrivateFieldGet(this, _OxyInferenceClient_instances, "m", _OxyInferenceClient_headers).call(this, 'application/json', {
453
446
  hasBody: options.body !== undefined,
454
- ...(options.idempotencyKey === undefined
455
- ? {}
456
- : { idempotencyKey: options.idempotencyKey }),
447
+ ...(options.idempotencyKey === undefined ? {} : { idempotencyKey: options.idempotencyKey }),
457
448
  ...(options.delegatedUserId === undefined
458
449
  ? {}
459
450
  : { delegatedUserId: options.delegatedUserId }),
@@ -467,8 +458,11 @@ async function _OxyInferenceClient_request(method, path, options) {
467
458
  }
468
459
  if (options.bindRequestId) {
469
460
  const requestId = response.headers.get('X-Oxy-Request-Id');
470
- if (!requestId || typeof payload !== 'object' || payload === null ||
471
- !('requestId' in payload) || payload.requestId !== requestId) {
461
+ if (!requestId ||
462
+ typeof payload !== 'object' ||
463
+ payload === null ||
464
+ !('requestId' in payload) ||
465
+ payload.requestId !== requestId) {
472
466
  throw new OxyInferenceProtocolError('Decisions response request ID does not match its header.', requestId ?? undefined);
473
467
  }
474
468
  }
@@ -6,15 +6,15 @@ exports.SECURITY_EVENT_SEVERITY_MAP = void 0;
6
6
  * Maps each event type to its default severity level
7
7
  */
8
8
  exports.SECURITY_EVENT_SEVERITY_MAP = {
9
- 'sign_in': 'low',
10
- 'sign_out': 'low',
11
- 'profile_updated': 'low',
12
- 'email_changed': 'medium',
13
- 'device_added': 'medium',
14
- 'device_removed': 'medium',
15
- 'security_settings_changed': 'medium',
16
- 'account_recovery': 'high',
17
- 'private_key_exported': 'high',
18
- 'backup_created': 'high',
19
- 'suspicious_activity': 'critical',
9
+ sign_in: 'low',
10
+ sign_out: 'low',
11
+ profile_updated: 'low',
12
+ email_changed: 'medium',
13
+ device_added: 'medium',
14
+ device_removed: 'medium',
15
+ security_settings_changed: 'medium',
16
+ account_recovery: 'high',
17
+ private_key_exported: 'high',
18
+ backup_created: 'high',
19
+ suspicious_activity: 'critical',
20
20
  };
@@ -35,8 +35,9 @@ const serviceTokenLifetime_1 = require("./serviceTokenLifetime");
35
35
  function reusableServiceToken(token) {
36
36
  try {
37
37
  const claims = (0, jwt_decode_1.jwtDecode)(token);
38
- return (0, serviceTokenLifetime_1.hasBoundedServiceTokenLifetime)(claims) && typeof claims.exp === 'number'
39
- && claims.exp > Math.floor(Date.now() / 1000);
38
+ return ((0, serviceTokenLifetime_1.hasBoundedServiceTokenLifetime)(claims) &&
39
+ typeof claims.exp === 'number' &&
40
+ claims.exp > Math.floor(Date.now() / 1000));
40
41
  }
41
42
  catch {
42
43
  return false;
@@ -84,7 +85,11 @@ class OxyServer extends OxyServices_1.OxyServices {
84
85
  this.actingAsPending = new Map();
85
86
  this.actingAsGenerations = new Map();
86
87
  /** Public keys only; never private material. */
87
- this.jwksCache = { keys: new Map(), expiresAt: 0, lastAttemptAt: 0 };
88
+ this.jwksCache = {
89
+ keys: new Map(),
90
+ expiresAt: 0,
91
+ lastAttemptAt: 0,
92
+ };
88
93
  /**
89
94
  * Before this instant a request without a user session does not try to mint
90
95
  * a service token and goes out anonymous. Set after a failed mint.
@@ -228,7 +233,9 @@ class OxyServer extends OxyServices_1.OxyServices {
228
233
  });
229
234
  throw new ServiceCredentialMismatchError();
230
235
  }
231
- if (entry.token && reusableServiceToken(entry.token) && entry.expiresAt > now + TOKEN_REUSE_MARGIN_MS) {
236
+ if (entry.token &&
237
+ reusableServiceToken(entry.token) &&
238
+ entry.expiresAt > now + TOKEN_REUSE_MARGIN_MS) {
232
239
  return entry.token;
233
240
  }
234
241
  if (entry.pending) {
@@ -287,7 +294,8 @@ class OxyServer extends OxyServices_1.OxyServices {
287
294
  throw new Error('A user session is required');
288
295
  const answer = await this.request('GET', `/v1/products/${encodeURIComponent(parsed.productId)}/access/${encodeURIComponent(parsed.subjectAccountId)}/grants`, undefined, { cache: false, retry: false, headers: { Authorization: `Bearer ${accessToken}` } });
289
296
  const snapshot = contracts_1.subjectProductGrantSnapshotSchema.parse(answer);
290
- if (snapshot.access.subjectAccountId !== parsed.subjectAccountId || snapshot.access.productId !== parsed.productId)
297
+ if (snapshot.access.subjectAccountId !== parsed.subjectAccountId ||
298
+ snapshot.access.productId !== parsed.productId)
291
299
  throw new Error('Product grant response attribution differs');
292
300
  return snapshot;
293
301
  }
@@ -296,7 +304,8 @@ class OxyServer extends OxyServices_1.OxyServices {
296
304
  const parsed = contracts_1.subjectProductAccessQuerySchema.parse(query);
297
305
  const answer = await this.serviceRequest('GET', `/v1/products/${encodeURIComponent(parsed.productId)}/access/${encodeURIComponent(parsed.subjectAccountId)}/service-grants`, undefined, { cache: false, retry: false });
298
306
  const snapshot = contracts_1.subjectProductGrantSnapshotSchema.parse(answer);
299
- if (snapshot.access.subjectAccountId !== parsed.subjectAccountId || snapshot.access.productId !== parsed.productId)
307
+ if (snapshot.access.subjectAccountId !== parsed.subjectAccountId ||
308
+ snapshot.access.productId !== parsed.productId)
300
309
  throw new Error('Product grant response attribution differs');
301
310
  return snapshot;
302
311
  }
@@ -318,7 +327,13 @@ class OxyServer extends OxyServices_1.OxyServices {
318
327
  */
319
328
  async verifyActingAs(appId, userId, options = {}) {
320
329
  const pair = JSON.stringify([appId, userId]);
321
- const cacheKey = JSON.stringify([appId, userId, options.credentialId, options.ownerAccountId, options.environment]);
330
+ const cacheKey = JSON.stringify([
331
+ appId,
332
+ userId,
333
+ options.credentialId,
334
+ options.ownerAccountId,
335
+ options.environment,
336
+ ]);
322
337
  if (options.cache === true) {
323
338
  const cached = this.actingAs.get(cacheKey);
324
339
  if (cached && cached.expiresAt > Date.now()) {
@@ -401,18 +416,32 @@ class OxyServer extends OxyServices_1.OxyServices {
401
416
  entry.secretBuf = secretBuf;
402
417
  }
403
418
  else {
404
- this.serviceTokens.set(cacheKey, { token: response.token, expiresAt, secretBuf, pending: null, apiKey: key });
419
+ this.serviceTokens.set(cacheKey, {
420
+ token: response.token,
421
+ expiresAt,
422
+ secretBuf,
423
+ pending: null,
424
+ apiKey: key,
425
+ });
405
426
  }
406
427
  return response.token;
407
428
  }
408
429
  /** A token obtained by attestation, cached like a credential's (one identity per process). */
409
430
  async workloadServiceToken() {
410
431
  const entry = this.serviceTokens.get(WORKLOAD_CACHE_KEY);
411
- if (entry?.token && reusableServiceToken(entry.token) && entry.expiresAt > Date.now() + TOKEN_REUSE_MARGIN_MS)
432
+ if (entry?.token &&
433
+ reusableServiceToken(entry.token) &&
434
+ entry.expiresAt > Date.now() + TOKEN_REUSE_MARGIN_MS)
412
435
  return entry.token;
413
436
  if (entry?.pending)
414
437
  return entry.pending;
415
- const seeded = entry ?? { token: '', expiresAt: 0, secretBuf: Buffer.alloc(0), pending: null, apiKey: WORKLOAD_CACHE_KEY };
438
+ const seeded = entry ?? {
439
+ token: '',
440
+ expiresAt: 0,
441
+ secretBuf: Buffer.alloc(0),
442
+ pending: null,
443
+ apiKey: WORKLOAD_CACHE_KEY,
444
+ };
416
445
  this.serviceTokens.set(WORKLOAD_CACHE_KEY, seeded);
417
446
  const pending = (async () => {
418
447
  const granted = await (0, workloadIdentity_1.requestWorkloadServiceToken)({ baseUrl: this.baseURL });
@@ -442,8 +471,22 @@ class OxyServer extends OxyServices_1.OxyServices {
442
471
  async lookupActingAs(appId, userId, options, pair, cacheKey, generation, serial, startedAt) {
443
472
  try {
444
473
  const serviceToken = await this.serviceToken();
445
- const result = await this.request('GET', '/internal/service-acting-as/verify', { appId, userId, ...(options.credentialId ? { credentialId: options.credentialId,
446
- ownerAccountId: options.ownerAccountId, environment: options.environment } : {}) }, { cache: false, retry: false, timeout: 5000, headers: { Authorization: `Bearer ${serviceToken}` } });
474
+ const result = await this.request('GET', '/internal/service-acting-as/verify', {
475
+ appId,
476
+ userId,
477
+ ...(options.credentialId
478
+ ? {
479
+ credentialId: options.credentialId,
480
+ ownerAccountId: options.ownerAccountId,
481
+ environment: options.environment,
482
+ }
483
+ : {}),
484
+ }, {
485
+ cache: false,
486
+ retry: false,
487
+ timeout: 5000,
488
+ headers: { Authorization: `Bearer ${serviceToken}` },
489
+ });
447
490
  // A deadline bounds how long an already old response can authorize. It
448
491
  // is not by itself a measurement of end-to-end revocation latency.
449
492
  if (this.actingAsGenerations.get(pair) !== generation || serial < generation.completed)
@@ -458,10 +501,11 @@ class OxyServer extends OxyServices_1.OxyServices {
458
501
  const epoch = BigInt(rawEpoch);
459
502
  if (epoch > 9223372036854775807n)
460
503
  return null;
461
- if (typeof result.authorized !== 'boolean' || !Array.isArray(result.scopes)
462
- || !result.scopes.every((scope) => typeof scope === 'string' && scope.length > 0 && scope.trim() === scope)
463
- || new Set(result.scopes).size !== result.scopes.length
464
- || (!result.authorized && result.scopes.length !== 0))
504
+ if (typeof result.authorized !== 'boolean' ||
505
+ !Array.isArray(result.scopes) ||
506
+ !result.scopes.every((scope) => typeof scope === 'string' && scope.length > 0 && scope.trim() === scope) ||
507
+ new Set(result.scopes).size !== result.scopes.length ||
508
+ (!result.authorized && result.scopes.length !== 0))
465
509
  return null;
466
510
  const older = epoch < generation.epoch;
467
511
  if (epoch > generation.epoch)
@@ -469,7 +513,8 @@ class OxyServer extends OxyServices_1.OxyServices {
469
513
  if (result.authorized && older)
470
514
  return null;
471
515
  const verified = result.authorized === true
472
- ? { authorized: true, scopes: result.scopes, epoch: rawEpoch } : null;
516
+ ? { authorized: true, scopes: result.scopes, epoch: rawEpoch }
517
+ : null;
473
518
  if (options.cache === true)
474
519
  this.rememberActingAs(cacheKey, verified, startedAt + (verified ? ACTING_AS_GRANT_TTL_MS : ACTING_AS_DENIAL_TTL_MS));
475
520
  return verified;
@@ -480,7 +525,10 @@ class OxyServer extends OxyServices_1.OxyServices {
480
525
  this.clearActingAsPair(appId, userId);
481
526
  }
482
527
  logger_1.logger.warn('[oxy.auth] verifyActingAs lookup failed — not cached', {
483
- component: 'auth', method: 'verifyActingAs', appId, userId,
528
+ component: 'auth',
529
+ method: 'verifyActingAs',
530
+ appId,
531
+ userId,
484
532
  }, error);
485
533
  return null;
486
534
  }
@@ -519,11 +567,11 @@ class OxyServer extends OxyServices_1.OxyServices {
519
567
  catch {
520
568
  throw new middleware_1.OxyAccountEventError('Account event token is malformed');
521
569
  }
522
- if (Object.keys(header).length !== 3
523
- || header.alg !== 'EdDSA'
524
- || header.typ !== 'secevent+jwt'
525
- || typeof header.kid !== 'string'
526
- || !/^[A-Za-z0-9._-]{1,128}$/.test(header.kid)) {
570
+ if (Object.keys(header).length !== 3 ||
571
+ header.alg !== 'EdDSA' ||
572
+ header.typ !== 'secevent+jwt' ||
573
+ typeof header.kid !== 'string' ||
574
+ !/^[A-Za-z0-9._-]{1,128}$/.test(header.kid)) {
527
575
  throw new middleware_1.OxyAccountEventError('Account event token header is not supported');
528
576
  }
529
577
  const nodeCrypto = await (0, protocol_1.loadNodeCrypto)();
@@ -532,7 +580,9 @@ class OxyServer extends OxyServices_1.OxyServices {
532
580
  jwk = await (0, middleware_1.resolveServiceTokenPublicKey)(header.kid, options.jwksUrl ?? new URL('/.well-known/jwks.json', this.baseURL).toString(), this.jwksCache);
533
581
  }
534
582
  catch (error) {
535
- throw new middleware_1.OxyAccountEventError(error instanceof Error ? error.message.replace('Service token', 'Account event') : 'Signing key is unavailable');
583
+ throw new middleware_1.OxyAccountEventError(error instanceof Error
584
+ ? error.message.replace('Service token', 'Account event')
585
+ : 'Signing key is unavailable');
536
586
  }
537
587
  const signature = Buffer.from(signatureB64, 'base64url');
538
588
  if (signature.toString('base64url') !== signatureB64 || signature.length !== 64) {
@@ -540,7 +590,10 @@ class OxyServer extends OxyServices_1.OxyServices {
540
590
  }
541
591
  let verified = false;
542
592
  try {
543
- const publicKey = nodeCrypto.createPublicKey({ key: jwk, format: 'jwk' });
593
+ const publicKey = nodeCrypto.createPublicKey({
594
+ key: jwk,
595
+ format: 'jwk',
596
+ });
544
597
  verified = nodeCrypto.verify(null, Buffer.from(`${headerB64}.${payloadB64}`), publicKey, signature);
545
598
  }
546
599
  catch {
@@ -551,7 +604,7 @@ class OxyServer extends OxyServices_1.OxyServices {
551
604
  if (payload.iss !== middleware_1.OXY_JWT_ISSUER) {
552
605
  throw new middleware_1.OxyAccountEventError('Account event token issuer is not Oxy');
553
606
  }
554
- const audience = options.audience ?? await this.configuredServiceAppId();
607
+ const audience = options.audience ?? (await this.configuredServiceAppId());
555
608
  if (typeof payload.aud !== 'string' || payload.aud !== audience) {
556
609
  throw new middleware_1.OxyAccountEventError('Account event token is addressed to another application');
557
610
  }
@@ -567,7 +620,10 @@ class OxyServer extends OxyServices_1.OxyServices {
567
620
  }
568
621
  const entries = Object.entries(events);
569
622
  const deleted = events[middleware_1.OXY_ACCOUNT_DELETED_EVENT_URI];
570
- if (entries.length !== 1 || typeof deleted !== 'object' || deleted === null || Array.isArray(deleted)) {
623
+ if (entries.length !== 1 ||
624
+ typeof deleted !== 'object' ||
625
+ deleted === null ||
626
+ Array.isArray(deleted)) {
571
627
  throw new middleware_1.OxyAccountEventError('Account event token carries an unknown event');
572
628
  }
573
629
  const body = deleted;
@@ -577,7 +633,9 @@ class OxyServer extends OxyServices_1.OxyServices {
577
633
  if (typeof body.occurredAt !== 'string' || Number.isNaN(Date.parse(body.occurredAt))) {
578
634
  throw new middleware_1.OxyAccountEventError('Account event has no occurrence time');
579
635
  }
580
- if (body.username !== undefined && body.username !== null && typeof body.username !== 'string') {
636
+ if (body.username !== undefined &&
637
+ body.username !== null &&
638
+ typeof body.username !== 'string') {
581
639
  throw new middleware_1.OxyAccountEventError('Account event username is malformed');
582
640
  }
583
641
  return {
@@ -10,8 +10,12 @@ async function signInAgentAccount(options) {
10
10
  const publicKey = (0, secp256k1_1.normalizeSecp256k1PublicKey)(signer.publicKey.trim());
11
11
  const claims = await client.auth.agent.requestChallenge(publicKey);
12
12
  const timestamp = Date.now();
13
- if (claims.action !== 'agent_signin' || claims.accountId !== accountId || claims.actorId !== accountId
14
- || (0, secp256k1_1.normalizeSecp256k1PublicKey)(claims.publicKey) !== publicKey || !claims.authMethodId || claims.expiresAt <= timestamp) {
13
+ if (claims.action !== 'agent_signin' ||
14
+ claims.accountId !== accountId ||
15
+ claims.actorId !== accountId ||
16
+ (0, secp256k1_1.normalizeSecp256k1PublicKey)(claims.publicKey) !== publicKey ||
17
+ !claims.authMethodId ||
18
+ claims.expiresAt <= timestamp) {
15
19
  throw new Error('Agent challenge does not match this account and signer');
16
20
  }
17
21
  const signature = await signer.signMessage((0, contracts_1.buildAgentProofMessage)(claims, timestamp));
@@ -8,20 +8,34 @@ exports.createOxyAliaMachineCredentialAuth = createOxyAliaMachineCredentialAuth;
8
8
  exports.OXY_ALIA_RESOURCE_APPLICATION_ID = '6a2f851751b784a86fd0e934';
9
9
  exports.OXY_ALIA_MACHINE_SCOPES = ['alia:chat', 'inference:invoke'];
10
10
  function id(value) {
11
- return typeof value === 'string' && value.length > 0 && value.length <= 128 && value.trim() === value;
11
+ return (typeof value === 'string' && value.length > 0 && value.length <= 128 && value.trim() === value);
12
12
  }
13
13
  /** Strict response boundary: extra user/tier fields cannot smuggle authority. */
14
14
  function isOxyAliaMachinePrincipal(value) {
15
15
  if (!value || typeof value !== 'object' || Array.isArray(value))
16
16
  return false;
17
17
  const p = value;
18
- const keys = ['kind', 'audience', 'applicationId', 'credentialId', 'ownerAccountId', 'environment', 'scopes'];
19
- return Object.keys(p).length === keys.length && keys.every(key => Object.prototype.hasOwnProperty.call(p, key))
20
- && p.kind === 'machine' && p.audience === exports.OXY_ALIA_RESOURCE_APPLICATION_ID
21
- && id(p.applicationId) && id(p.credentialId) && id(p.ownerAccountId)
22
- && typeof p.environment === 'string' && ['production', 'staging', 'development'].includes(p.environment)
23
- && Array.isArray(p.scopes) && p.scopes.length === 2
24
- && exports.OXY_ALIA_MACHINE_SCOPES.every(scope => p.scopes.includes(scope));
18
+ const keys = [
19
+ 'kind',
20
+ 'audience',
21
+ 'applicationId',
22
+ 'credentialId',
23
+ 'ownerAccountId',
24
+ 'environment',
25
+ 'scopes',
26
+ ];
27
+ return (Object.keys(p).length === keys.length &&
28
+ keys.every((key) => Object.prototype.hasOwnProperty.call(p, key)) &&
29
+ p.kind === 'machine' &&
30
+ p.audience === exports.OXY_ALIA_RESOURCE_APPLICATION_ID &&
31
+ id(p.applicationId) &&
32
+ id(p.credentialId) &&
33
+ id(p.ownerAccountId) &&
34
+ typeof p.environment === 'string' &&
35
+ ['production', 'staging', 'development'].includes(p.environment) &&
36
+ Array.isArray(p.scopes) &&
37
+ p.scopes.length === 2 &&
38
+ exports.OXY_ALIA_MACHINE_SCOPES.every((scope) => p.scopes.includes(scope)));
25
39
  }
26
40
  // Keep the forwarding credential out of enumerable request/principal objects,
27
41
  // logs, response serialization and persistent SDK/session state. No cache.
@@ -29,7 +43,9 @@ const forwardingCredentials = new WeakMap();
29
43
  /** Only for the request-scoped Oxy inference client; never for a user API. */
30
44
  function getOxyAliaMachineCredentialBearer(req) {
31
45
  const bound = forwardingCredentials.get(req);
32
- return bound && req.machineCredential === bound.principal ? bound.bearer : null;
46
+ return bound && req.machineCredential === bound.principal
47
+ ? bound.bearer
48
+ : null;
33
49
  }
34
50
  /** Opt into Alia's app-only chat lane on its two chat routes, never globally. */
35
51
  function createOxyAliaMachineCredentialAuth(server, options) {
@@ -41,19 +57,28 @@ function createOxyAliaMachineCredentialAuth(server, options) {
41
57
  return;
42
58
  }
43
59
  const existing = req;
44
- if (existing.user || existing.userId || existing.serviceApp || existing.oxyRequester
45
- || req.machineCredential
46
- || req.headers['x-oxy-user-id'] !== undefined || req.headers['x-oxy-requester-assertion'] !== undefined) {
60
+ if (existing.user ||
61
+ existing.userId ||
62
+ existing.serviceApp ||
63
+ existing.oxyRequester ||
64
+ req.machineCredential ||
65
+ req.headers['x-oxy-user-id'] !== undefined ||
66
+ req.headers['x-oxy-requester-assertion'] !== undefined) {
47
67
  res.status(403).json({ error: 'MACHINE_USER_DELEGATION_UNSUPPORTED' });
48
68
  return;
49
69
  }
50
70
  try {
51
71
  const answer = await server.apps.introspectAliaMachineCredential(token);
52
- if (!answer.active || !isOxyAliaMachinePrincipal(answer.principal) || answer.principal.environment !== options.environment) {
72
+ if (!answer.active ||
73
+ !isOxyAliaMachinePrincipal(answer.principal) ||
74
+ answer.principal.environment !== options.environment) {
53
75
  res.status(401).json({ error: 'MACHINE_CREDENTIAL_INVALID' });
54
76
  return;
55
77
  }
56
- const principal = Object.freeze({ ...answer.principal, scopes: Object.freeze(['alia:chat', 'inference:invoke']) });
78
+ const principal = Object.freeze({
79
+ ...answer.principal,
80
+ scopes: Object.freeze(['alia:chat', 'inference:invoke']),
81
+ });
57
82
  req.machineCredential = principal;
58
83
  forwardingCredentials.set(req, { principal, bearer: token });
59
84
  next();
@@ -36,9 +36,7 @@ function ensureUser(req, userId) {
36
36
  }
37
37
  function getOxyUserId(req) {
38
38
  const authReq = req;
39
- return (normalizeId(authReq.userId) ??
40
- normalizeId(authReq.user?.id) ??
41
- normalizeId(authReq.user?._id));
39
+ return (normalizeId(authReq.userId) ?? normalizeId(authReq.user?.id) ?? normalizeId(authReq.user?._id));
42
40
  }
43
41
  /**
44
42
  * Who acted, and as whom, on this user session (issue #1520), or `null` when
@@ -182,7 +180,10 @@ function requireOxyAuth(req, res, next) {
182
180
  next();
183
181
  }
184
182
  function createOptionalOxyAuth(oxy, options = {}) {
185
- const resolveSession = oxy.middleware.auth({ ...options.auth, optional: true });
183
+ const resolveSession = oxy.middleware.auth({
184
+ ...options.auth,
185
+ optional: true,
186
+ });
186
187
  return (req, res, next) => {
187
188
  if (getOxyUserId(req)) {
188
189
  next();
@@ -63,11 +63,11 @@ function verifyCapabilityTicket(token, options) {
63
63
  throw new CapabilityTicketError('malformed', 'Capability ticket header is not supported');
64
64
  }
65
65
  const headerRecord = header;
66
- if (Object.keys(headerRecord).length !== 3
67
- || headerRecord.alg !== ALGORITHM
68
- || headerRecord.typ !== TOKEN_TYPE
69
- || typeof headerRecord.kid !== 'string'
70
- || headerRecord.kid.length === 0) {
66
+ if (Object.keys(headerRecord).length !== 3 ||
67
+ headerRecord.alg !== ALGORITHM ||
68
+ headerRecord.typ !== TOKEN_TYPE ||
69
+ typeof headerRecord.kid !== 'string' ||
70
+ headerRecord.kid.length === 0) {
71
71
  throw new CapabilityTicketError('malformed', 'Capability ticket header is not supported');
72
72
  }
73
73
  const publicKey = options.resolvePublicKey(headerRecord.kid);
@@ -17,7 +17,7 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.inlineScriptCspHash = exports.formatOxyCspPolicy = exports.extractInlineScripts = exports.cspSourcesFor = exports.createOxySecurityHeaders = exports.buildOxyPagesHeaders = exports.buildOxyCspDirectives = exports.createOxyCors = exports.UPSTREAM_HEADERS_TIMEOUT_MS = exports.MAX_URL_LENGTH = exports.MAX_REDIRECTS = exports.DEFAULT_USER_AGENT = exports.BLOCKED_HOSTNAMES = exports.ALLOWED_PROTOCOLS = exports.ALLOWED_PORTS = exports.UpstreamError = exports.SsrfRejection = exports.safeFetch = exports.isBlockedIp = exports.assertSafePublicUrl = exports.createOxyRateLimit = exports.OXY_SERVICE_ENVIRONMENTS = exports.requireOxyAuth = exports.isOxyAuthenticated = exports.getRequiredOxyUserId = exports.getRequiredOxyBillingPrincipal = exports.getOxyUserId = exports.getOxyRequestAttribution = exports.getOxyDelegatedUserId = exports.getOxyBillingPrincipal = exports.getOxyAuthRefusal = exports.getOxyActor = exports.createOxyAuthMiddleware = exports.createOptionalOxyAuth = exports.OXY_ACCOUNT_DELETED_EVENT_URI = exports.OxyAccountEventError = exports.OXY_ALIA_MACHINE_SCOPES = exports.OXY_ALIA_RESOURCE_APPLICATION_ID = exports.isOxyAliaMachinePrincipal = exports.getOxyAliaMachineCredentialBearer = exports.createOxyAliaMachineCredentialAuth = exports.ServerReputationApi = exports.ServerNotificationsApi = exports.ServerLinkedAccountsApi = exports.ServerAssetsApi = exports.ServerAgencyApi = exports.ServerAppsApi = exports.ANONYMOUS_SERVICE_TOKEN_RETRY_MS = exports.ServiceCredentialMismatchError = exports.OxyServer = void 0;
20
- exports.signInAgentAccount = exports.hasBoundedServiceTokenLifetime = exports.OXY_SERVICE_TOKEN_MAX_LIFETIME_SECONDS = exports.requestWorkloadServiceToken = exports.canAttestWorkloadIdentity = exports.withoutNodeHttpObservation = exports.observeNodeHttp = exports.createEcosystemTraffic = exports.isAllowedDeviceJoinOrigin = exports.isOfficialWebOrigin = exports.isLoopbackOrigin = exports.registrableApex = exports.OXY_IDENTITY_CACHE_PREFIXES = exports.oxyUserByIdCacheKey = exports.evictOxyIdentityCache = exports.publishOxyUserInvalidation = exports.createOxyUserInvalidationHandler = exports.createLiveCapabilityTicketVerifier = exports.verifySecret = exports.verifyOxyRequesterAssertion = exports.signOxyRequesterAssertion = exports.readOxyRequesterAssertionKeyId = exports.oxyRequesterAssertionClaimsSchema = exports.OxyRequesterAssertionError = exports.OXY_REQUESTER_ASSERTION_TYPE = exports.OXY_REQUESTER_ASSERTION_MAX_TTL_SECONDS = exports.OXY_REQUESTER_ASSERTION_HEADER = exports.OXY_REQUESTER_ASSERTION_DEFAULT_ISSUER = exports.createOxyRequesterAssertionAuth = exports.createOxyJwksKeyResolver = exports.verifyCapabilityTicket = exports.readCapabilityAuthorization = exports.issueCapabilityTicket = exports.inputSatisfiesCapabilityLimits = exports.createCapabilityTicketMiddleware = exports.CapabilityTicketError = exports.OXY_CSP_BASELINE = void 0;
20
+ exports.signInAgentAccount = exports.hasBoundedServiceTokenLifetime = exports.OXY_SERVICE_TOKEN_MAX_LIFETIME_SECONDS = exports.requestWorkloadServiceToken = exports.canAttestWorkloadIdentity = exports.attestWorkloadIdentity = exports.withoutNodeHttpObservation = exports.observeNodeHttp = exports.createEcosystemTraffic = exports.isAllowedDeviceJoinOrigin = exports.isOfficialWebOrigin = exports.isLoopbackOrigin = exports.registrableApex = exports.OXY_IDENTITY_CACHE_PREFIXES = exports.oxyUserByIdCacheKey = exports.evictOxyIdentityCache = exports.publishOxyUserInvalidation = exports.createOxyUserInvalidationHandler = exports.createLiveCapabilityTicketVerifier = exports.verifySecret = exports.verifyOxyRequesterAssertion = exports.signOxyRequesterAssertion = exports.readOxyRequesterAssertionKeyId = exports.oxyRequesterAssertionClaimsSchema = exports.OxyRequesterAssertionError = exports.OXY_REQUESTER_ASSERTION_TYPE = exports.OXY_REQUESTER_ASSERTION_MAX_TTL_SECONDS = exports.OXY_REQUESTER_ASSERTION_HEADER = exports.OXY_REQUESTER_ASSERTION_DEFAULT_ISSUER = exports.createOxyRequesterAssertionAuth = exports.createOxyJwksKeyResolver = exports.verifyCapabilityTicket = exports.readCapabilityAuthorization = exports.issueCapabilityTicket = exports.inputSatisfiesCapabilityLimits = exports.createCapabilityTicketMiddleware = exports.CapabilityTicketError = exports.OXY_CSP_BASELINE = void 0;
21
21
  // The backend client: OxyServices plus the service-token lane, middleware,
22
22
  // account events and the service-only namespace methods.
23
23
  var OxyServer_1 = require("./OxyServer");
@@ -150,6 +150,7 @@ Object.defineProperty(exports, "withoutNodeHttpObservation", { enumerable: true,
150
150
  * container credentials endpoint.
151
151
  */
152
152
  var workloadIdentity_1 = require("./workloadIdentity");
153
+ Object.defineProperty(exports, "attestWorkloadIdentity", { enumerable: true, get: function () { return workloadIdentity_1.attestWorkloadIdentity; } });
153
154
  Object.defineProperty(exports, "canAttestWorkloadIdentity", { enumerable: true, get: function () { return workloadIdentity_1.canAttestWorkloadIdentity; } });
154
155
  Object.defineProperty(exports, "requestWorkloadServiceToken", { enumerable: true, get: function () { return workloadIdentity_1.requestWorkloadServiceToken; } });
155
156
  var serviceTokenLifetime_1 = require("./serviceTokenLifetime");
@@ -28,7 +28,10 @@ function createLiveCapabilityTicketVerifier(options) {
28
28
  if (controller.signal.aborted)
29
29
  rejectAbort();
30
30
  });
31
- const result = await Promise.race([options.introspect(ticket, { signal: controller.signal }), interrupted]);
31
+ const result = await Promise.race([
32
+ options.introspect(ticket, { signal: controller.signal }),
33
+ interrupted,
34
+ ]);
32
35
  controller.signal.throwIfAborted();
33
36
  if (result.active !== true)
34
37
  throw new Error('Capability ticket is inactive');