@oxy.so/services 15.1.4 → 15.1.6

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 (60) hide show
  1. package/bloom/Package.bloom +15 -0
  2. package/bloom/Resources/Localizable/ar-SA.json +108 -0
  3. package/bloom/Resources/Localizable/bn-BD.json +108 -0
  4. package/bloom/Resources/Localizable/ca-ES.json +111 -0
  5. package/bloom/Resources/Localizable/de-DE.json +108 -0
  6. package/bloom/Resources/Localizable/en-US.json +124 -0
  7. package/bloom/Resources/Localizable/es-ES.json +124 -0
  8. package/bloom/Resources/Localizable/fr-FR.json +108 -0
  9. package/bloom/Resources/Localizable/hi-IN.json +108 -0
  10. package/bloom/Resources/Localizable/id-ID.json +108 -0
  11. package/bloom/Resources/Localizable/it-IT.json +108 -0
  12. package/bloom/Resources/Localizable/ja-JP.json +108 -0
  13. package/bloom/Resources/Localizable/ko-KR.json +108 -0
  14. package/bloom/Resources/Localizable/pt-PT.json +108 -0
  15. package/bloom/Resources/Localizable/ru-RU.json +108 -0
  16. package/bloom/Resources/Localizable/tr-TR.json +108 -0
  17. package/bloom/Resources/Localizable/zh-CN.json +108 -0
  18. package/bloom/Sources/OxyAccountUI/SignInFlow.bloom +322 -0
  19. package/bloom/Sources/OxyAccountUI/SignInRules.bloom +135 -0
  20. package/bloom/Sources/OxyAccountUI/SignInService.bloom +141 -0
  21. package/bloom/Sources/OxyAccountUI/SignUpFlow.bloom +322 -0
  22. package/bloom/Sources/OxyAccountUI/SignUpRules.bloom +189 -0
  23. package/bloom/Sources/OxyAccountUIChecks/Checks.bloom +254 -0
  24. package/bloom/Sources/OxyAccountUIChecks/FakeAuth.bloom +123 -0
  25. package/bloom/Sources/OxyAccountUIChecks/SignUpChecks.bloom +193 -0
  26. package/lib/commonjs/ui/boot/runProviderColdBoot.js +43 -329
  27. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  28. package/lib/commonjs/ui/context/OxyContext.js +7 -1
  29. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  30. package/lib/commonjs/ui/oauth/applicationSessionLane.js +12 -25
  31. package/lib/commonjs/ui/oauth/applicationSessionLane.js.map +1 -1
  32. package/lib/commonjs/ui/session/tokenTransport.js +7 -69
  33. package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
  34. package/lib/module/ui/boot/runProviderColdBoot.js +43 -329
  35. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  36. package/lib/module/ui/context/OxyContext.js +8 -2
  37. package/lib/module/ui/context/OxyContext.js.map +1 -1
  38. package/lib/module/ui/oauth/applicationSessionLane.js +4 -23
  39. package/lib/module/ui/oauth/applicationSessionLane.js.map +1 -1
  40. package/lib/module/ui/session/tokenTransport.js +3 -68
  41. package/lib/module/ui/session/tokenTransport.js.map +1 -1
  42. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +8 -31
  43. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  44. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/ui/oauth/applicationSessionLane.d.ts +1 -5
  46. package/lib/typescript/commonjs/ui/oauth/applicationSessionLane.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +1 -33
  48. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
  49. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +8 -31
  50. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  51. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  52. package/lib/typescript/module/ui/oauth/applicationSessionLane.d.ts +1 -5
  53. package/lib/typescript/module/ui/oauth/applicationSessionLane.d.ts.map +1 -1
  54. package/lib/typescript/module/ui/session/tokenTransport.d.ts +1 -33
  55. package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
  56. package/package.json +10 -5
  57. package/src/ui/boot/runProviderColdBoot.ts +40 -364
  58. package/src/ui/context/OxyContext.tsx +8 -1
  59. package/src/ui/oauth/applicationSessionLane.ts +7 -35
  60. package/src/ui/session/tokenTransport.ts +3 -75
@@ -1,75 +1,3 @@
1
- import { logger, type OxyServices } from '@oxy.so/core';
2
- import type { TokenTransport } from '@oxy.so/core/session';
3
- import type { DeviceSessionState } from '@oxy.so/contracts';
4
-
5
- /**
6
- * Platform `TokenTransport` for `SessionClient` (device-first model).
7
- *
8
- * `ensureActiveToken` is the fallback the client uses when a `session_state`
9
- * push arrived WITHOUT an embedded `activeToken` and the planted bearer does not
10
- * already belong to the state's active account. It mints one through the ONE
11
- * unified single-flight the scheduler, the request-time preflight, and the 401
12
- * retry all use — `oxyServices.http.refreshAccessToken(...)` — which runs
13
- * the installed refresh handler (present the persisted zero-cookie `deviceId` +
14
- * `deviceSecret` at `POST /session/device/token`, which mints for the device's
15
- * CURRENT active account). Routing through the SAME entry point means this lane
16
- * can never double-rotate the device secret against the others: it has NO
17
- * private single-flight of its own.
18
- *
19
- * The short-circuit compares the planted bearer's ACCOUNT against
20
- * `state.activeAccountId`, not mere token presence: a bearer for the PREVIOUS
21
- * account (an account switch) must still mint the new account's token — skipping
22
- * on presence alone would leave a subscriber observing the new active account
23
- * under the old account's bearer (the account-switch 404 race).
24
- *
25
- * A failure is logged and swallowed: this method must never throw out (it runs
26
- * inside the socket state handler).
27
- *
28
- * `getPinnedAccountId` is the identity-bound escape hatch. Converging the bearer
29
- * on `state.activeAccountId` is precisely what an identity-bound client must
30
- * never do — its token is minted for the PINNED account by the cold boot /
31
- * re-mint lane. `SessionClient` already bypasses the transport entirely while
32
- * pinned; this guard is the services-side half of that contract, so no future
33
- * wiring can reintroduce the convergence from this end.
34
- */
35
- export function createTokenTransport(
36
- oxyServices: OxyServices,
37
- getPinnedAccountId?: () => string | null,
38
- ): TokenTransport {
39
- return {
40
- async ensureActiveToken(state: DeviceSessionState): Promise<void> {
41
- if ((getPinnedAccountId?.() ?? null) !== null) {
42
- return;
43
- }
44
- try {
45
- // Skip the mint ONLY when the planted bearer already identifies the
46
- // active account. `getCurrentUserId()` decodes the bearer's `userId`/`id`
47
- // (null when absent/opaque), directly comparable to the account id.
48
- const activeAccountId = state.activeAccountId;
49
- if (activeAccountId !== null && oxyServices.session.userId === activeAccountId) {
50
- return;
51
- }
52
- } catch (error) {
53
- logger.warn(
54
- 'ensureActiveToken: bearer-account check threw',
55
- { component: 'TokenTransport' },
56
- error,
57
- );
58
- }
59
-
60
- try {
61
- // The shared HttpService single-flight coalesces concurrent callers onto
62
- // one in-flight mint; no local `inFlightMint` guard is needed.
63
- const token = await oxyServices.http.refreshAccessToken('preflight');
64
- if (!token) {
65
- logger.debug('ensureActiveToken: refresh produced no session', {
66
- component: 'TokenTransport',
67
- deviceId: state.deviceId,
68
- });
69
- }
70
- } catch (error) {
71
- logger.warn('ensureActiveToken: refresh failed', { component: 'TokenTransport' }, error);
72
- }
73
- },
74
- };
75
- }
1
+ // The transport moved to `@oxy.so/core/session` (core 7.66.0) so the React-free
2
+ // web session shares it; this module keeps the package's import site.
3
+ export { createTokenTransport } from '@oxy.so/core/session';