@oxy.so/core 7.8.0 → 7.9.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/i18n/locales/ar-SA.js +0 -2
- package/dist/cjs/i18n/locales/bn-BD.js +0 -2
- package/dist/cjs/i18n/locales/ca-ES.js +0 -2
- package/dist/cjs/i18n/locales/de-DE.js +0 -2
- package/dist/cjs/i18n/locales/en-US.js +0 -2
- package/dist/cjs/i18n/locales/es-ES.js +0 -2
- package/dist/cjs/i18n/locales/fr-FR.js +0 -2
- package/dist/cjs/i18n/locales/hi-IN.js +0 -2
- package/dist/cjs/i18n/locales/id-ID.js +0 -2
- package/dist/cjs/i18n/locales/it-IT.js +0 -2
- package/dist/cjs/i18n/locales/ja-JP.js +0 -2
- package/dist/cjs/i18n/locales/ko-KR.js +0 -2
- package/dist/cjs/i18n/locales/pt-PT.js +0 -2
- package/dist/cjs/i18n/locales/ru-RU.js +0 -2
- package/dist/cjs/i18n/locales/tr-TR.js +0 -2
- package/dist/cjs/i18n/locales/zh-CN.js +0 -2
- package/dist/cjs/session/deviceComparisonCode.js +21 -0
- package/dist/cjs/session/index.js +3 -1
- package/dist/esm/i18n/locales/ar-SA.js +0 -2
- package/dist/esm/i18n/locales/bn-BD.js +0 -2
- package/dist/esm/i18n/locales/ca-ES.js +0 -2
- package/dist/esm/i18n/locales/de-DE.js +0 -2
- package/dist/esm/i18n/locales/en-US.js +0 -2
- package/dist/esm/i18n/locales/es-ES.js +0 -2
- package/dist/esm/i18n/locales/fr-FR.js +0 -2
- package/dist/esm/i18n/locales/hi-IN.js +0 -2
- package/dist/esm/i18n/locales/id-ID.js +0 -2
- package/dist/esm/i18n/locales/it-IT.js +0 -2
- package/dist/esm/i18n/locales/ja-JP.js +0 -2
- package/dist/esm/i18n/locales/ko-KR.js +0 -2
- package/dist/esm/i18n/locales/pt-PT.js +0 -2
- package/dist/esm/i18n/locales/ru-RU.js +0 -2
- package/dist/esm/i18n/locales/tr-TR.js +0 -2
- package/dist/esm/i18n/locales/zh-CN.js +0 -2
- package/dist/esm/session/deviceComparisonCode.js +18 -0
- package/dist/esm/session/index.js +1 -0
- package/dist/types/i18n/locales/ar-SA.d.ts +0 -2
- package/dist/types/i18n/locales/bn-BD.d.ts +0 -2
- package/dist/types/i18n/locales/ca-ES.d.ts +0 -2
- package/dist/types/i18n/locales/de-DE.d.ts +0 -2
- package/dist/types/i18n/locales/en-US.d.ts +0 -2
- package/dist/types/i18n/locales/es-ES.d.ts +0 -2
- package/dist/types/i18n/locales/fr-FR.d.ts +0 -2
- package/dist/types/i18n/locales/hi-IN.d.ts +0 -2
- package/dist/types/i18n/locales/id-ID.d.ts +0 -2
- package/dist/types/i18n/locales/it-IT.d.ts +0 -2
- package/dist/types/i18n/locales/ja-JP.d.ts +0 -2
- package/dist/types/i18n/locales/ko-KR.d.ts +0 -2
- package/dist/types/i18n/locales/pt-PT.d.ts +0 -2
- package/dist/types/i18n/locales/ru-RU.d.ts +0 -2
- package/dist/types/i18n/locales/tr-TR.d.ts +0 -2
- package/dist/types/i18n/locales/zh-CN.d.ts +0 -2
- package/dist/types/session/deviceComparisonCode.d.ts +1 -0
- package/dist/types/session/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/i18n/locales/ar-SA.ts +0 -2
- package/src/i18n/locales/bn-BD.ts +0 -2
- package/src/i18n/locales/ca-ES.ts +0 -2
- package/src/i18n/locales/de-DE.ts +0 -2
- package/src/i18n/locales/en-US.ts +0 -2
- package/src/i18n/locales/es-ES.ts +0 -2
- package/src/i18n/locales/fr-FR.ts +0 -2
- package/src/i18n/locales/hi-IN.ts +0 -2
- package/src/i18n/locales/id-ID.ts +0 -2
- package/src/i18n/locales/it-IT.ts +0 -2
- package/src/i18n/locales/ja-JP.ts +0 -2
- package/src/i18n/locales/ko-KR.ts +0 -2
- package/src/i18n/locales/pt-PT.ts +0 -2
- package/src/i18n/locales/ru-RU.ts +0 -2
- package/src/i18n/locales/tr-TR.ts +0 -2
- package/src/i18n/locales/zh-CN.ts +0 -2
- package/src/session/deviceComparisonCode.ts +19 -0
- package/src/session/index.ts +1 -0
|
@@ -21,8 +21,6 @@ const dict = {
|
|
|
21
21
|
renew: 'Afficher un nouveau code',
|
|
22
22
|
},
|
|
23
23
|
device: {
|
|
24
|
-
title: 'Connectez-vous avec votre téléphone',
|
|
25
|
-
caption: "Scannez avec l'appareil photo de votre téléphone",
|
|
26
24
|
codeHint: 'Vérifiez que votre téléphone affiche ce code',
|
|
27
25
|
},
|
|
28
26
|
errors: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deviceComparisonCode = deviceComparisonCode;
|
|
4
|
+
/**
|
|
5
|
+
* The code a person compares between a device with no keyboard (a TV, a photo
|
|
6
|
+
* frame) and the phone approving its sign-in: `CE7F-B31F`.
|
|
7
|
+
*
|
|
8
|
+
* The device's QR carries the request's full `authorizeCode` (16 random bytes,
|
|
9
|
+
* hex), and that alone is what approves. Its first eight characters are
|
|
10
|
+
* enough to tell "the request on this screen" from any other: the server draws
|
|
11
|
+
* the code at random, so a look-alike request would take about four billion
|
|
12
|
+
* rate-limited attempts, while thirty-two characters were too many for anyone
|
|
13
|
+
* to compare. Both sides (`OxyDeviceSignIn` on the device and the approval
|
|
14
|
+
* page on the phone) derive it here, so they always print the same thing.
|
|
15
|
+
*/
|
|
16
|
+
const COMPARISON_LENGTH = 8;
|
|
17
|
+
const GROUP_LENGTH = 4;
|
|
18
|
+
function deviceComparisonCode(authorizeCode) {
|
|
19
|
+
const head = authorizeCode.slice(0, COMPARISON_LENGTH).toUpperCase();
|
|
20
|
+
return `${head.slice(0, GROUP_LENGTH)}-${head.slice(GROUP_LENGTH)}`;
|
|
21
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the API with a token it already has never needs it.
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.runColdBoot = exports.runSessionColdBoot = exports.TOKEN_REFRESH_LEAD_MS = exports.startTokenRefreshScheduler = exports.installAuthRefreshHandler = exports.createAuthRefreshHandler = exports.refreshDeviceSecretArm = exports.refreshPersistedSession = exports.establishIdentitySession = exports.resolveIdentityPin = exports.IDENTITY_PIN_STORAGE_KEY = exports.identityPinMatches = exports.createMemoryIdentityPinStore = exports.createNativeIdentityPinStore = exports.createWebIdentityPinStore = exports.readLocalDeviceCredential = exports.publishProvenDeviceCredential = exports.normalizeSharedDeviceSessionRead = exports.decideSharedDevicePublish = exports.decideSharedDeviceJoin = exports.createSharedMirroringAuthStateStore = exports.AUTH_STATE_STORAGE_KEY = exports.createMemoryAuthStateStore = exports.createNativeAuthStateStore = exports.createWebAuthStateStore = exports.createAccountDialogController = exports.AccountDialogController = exports.resolveAccountDelegationAccess = exports.canSwitchIntoAccount = exports.isSwitchTargetAccount = exports.showsPrincipalHeaders = exports.buildSwitcherRows = exports.resolveDeviceContext = exports.resolveActiveContext = exports.projectDevicePrincipals = exports.directoryHandle = exports.directoryDisplayName = exports.canActivateContext = exports.accountIdsOf = exports.activeUserOf = exports.activeSessionIdOf = exports.deviceStateToClientSessions = exports.createSessionClient = exports.createSessionClientHost = exports.SessionClient = exports.DeviceManager = void 0;
|
|
11
|
+
exports.runColdBoot = exports.runSessionColdBoot = exports.TOKEN_REFRESH_LEAD_MS = exports.startTokenRefreshScheduler = exports.installAuthRefreshHandler = exports.createAuthRefreshHandler = exports.refreshDeviceSecretArm = exports.refreshPersistedSession = exports.establishIdentitySession = exports.resolveIdentityPin = exports.IDENTITY_PIN_STORAGE_KEY = exports.identityPinMatches = exports.createMemoryIdentityPinStore = exports.createNativeIdentityPinStore = exports.createWebIdentityPinStore = exports.readLocalDeviceCredential = exports.publishProvenDeviceCredential = exports.normalizeSharedDeviceSessionRead = exports.decideSharedDevicePublish = exports.decideSharedDeviceJoin = exports.createSharedMirroringAuthStateStore = exports.AUTH_STATE_STORAGE_KEY = exports.createMemoryAuthStateStore = exports.createNativeAuthStateStore = exports.createWebAuthStateStore = exports.createAccountDialogController = exports.AccountDialogController = exports.resolveAccountDelegationAccess = exports.canSwitchIntoAccount = exports.isSwitchTargetAccount = exports.deviceComparisonCode = exports.showsPrincipalHeaders = exports.buildSwitcherRows = exports.resolveDeviceContext = exports.resolveActiveContext = exports.projectDevicePrincipals = exports.directoryHandle = exports.directoryDisplayName = exports.canActivateContext = exports.accountIdsOf = exports.activeUserOf = exports.activeSessionIdOf = exports.deviceStateToClientSessions = exports.createSessionClient = exports.createSessionClientHost = exports.SessionClient = exports.DeviceManager = void 0;
|
|
12
12
|
// Session code reaches the identity key (identity-bound sessions), so the
|
|
13
13
|
// crypto shim goes first — see `../crypto/polyfill`.
|
|
14
14
|
require("../crypto/polyfill");
|
|
@@ -59,6 +59,8 @@ Object.defineProperty(exports, "resolveDeviceContext", { enumerable: true, get:
|
|
|
59
59
|
var deviceSwitcherRows_1 = require("./deviceSwitcherRows");
|
|
60
60
|
Object.defineProperty(exports, "buildSwitcherRows", { enumerable: true, get: function () { return deviceSwitcherRows_1.buildSwitcherRows; } });
|
|
61
61
|
Object.defineProperty(exports, "showsPrincipalHeaders", { enumerable: true, get: function () { return deviceSwitcherRows_1.showsPrincipalHeaders; } });
|
|
62
|
+
var deviceComparisonCode_1 = require("./deviceComparisonCode");
|
|
63
|
+
Object.defineProperty(exports, "deviceComparisonCode", { enumerable: true, get: function () { return deviceComparisonCode_1.deviceComparisonCode; } });
|
|
62
64
|
// The switch-target predicates over the account GRAPH — a list of accounts to
|
|
63
65
|
// manage, not the device's list of identities to become (that is the directory
|
|
64
66
|
// above). `isSwitchTargetAccount` is the structural half ("is this kind
|
|
@@ -19,8 +19,6 @@ const dict = {
|
|
|
19
19
|
renew: 'Afficher un nouveau code',
|
|
20
20
|
},
|
|
21
21
|
device: {
|
|
22
|
-
title: 'Connectez-vous avec votre téléphone',
|
|
23
|
-
caption: "Scannez avec l'appareil photo de votre téléphone",
|
|
24
22
|
codeHint: 'Vérifiez que votre téléphone affiche ce code',
|
|
25
23
|
},
|
|
26
24
|
errors: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code a person compares between a device with no keyboard (a TV, a photo
|
|
3
|
+
* frame) and the phone approving its sign-in: `CE7F-B31F`.
|
|
4
|
+
*
|
|
5
|
+
* The device's QR carries the request's full `authorizeCode` (16 random bytes,
|
|
6
|
+
* hex), and that alone is what approves. Its first eight characters are
|
|
7
|
+
* enough to tell "the request on this screen" from any other: the server draws
|
|
8
|
+
* the code at random, so a look-alike request would take about four billion
|
|
9
|
+
* rate-limited attempts, while thirty-two characters were too many for anyone
|
|
10
|
+
* to compare. Both sides (`OxyDeviceSignIn` on the device and the approval
|
|
11
|
+
* page on the phone) derive it here, so they always print the same thing.
|
|
12
|
+
*/
|
|
13
|
+
const COMPARISON_LENGTH = 8;
|
|
14
|
+
const GROUP_LENGTH = 4;
|
|
15
|
+
export function deviceComparisonCode(authorizeCode) {
|
|
16
|
+
const head = authorizeCode.slice(0, COMPARISON_LENGTH).toUpperCase();
|
|
17
|
+
return `${head.slice(0, GROUP_LENGTH)}-${head.slice(GROUP_LENGTH)}`;
|
|
18
|
+
}
|
|
@@ -40,6 +40,7 @@ export { canActivateContext, directoryDisplayName, directoryHandle, projectDevic
|
|
|
40
40
|
// auth.oxy.so chooser so the two cannot drift, the same reason the flat
|
|
41
41
|
// projection lived here before it.
|
|
42
42
|
export { buildSwitcherRows, showsPrincipalHeaders } from './deviceSwitcherRows.js';
|
|
43
|
+
export { deviceComparisonCode } from './deviceComparisonCode.js';
|
|
43
44
|
// The switch-target predicates over the account GRAPH — a list of accounts to
|
|
44
45
|
// manage, not the device's list of identities to become (that is the directory
|
|
45
46
|
// above). `isSwitchTargetAccount` is the structural half ("is this kind
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deviceComparisonCode(authorizeCode: string): string;
|
|
@@ -18,6 +18,7 @@ export { deviceStateToClientSessions, activeSessionIdOf, activeUserOf, accountId
|
|
|
18
18
|
export { canActivateContext, directoryDisplayName, directoryHandle, projectDevicePrincipals, resolveActiveContext, resolveDeviceContext, } from './deviceDirectory';
|
|
19
19
|
export type { DeviceContext, DeviceContextActor, DeviceContextSubject, DevicePrincipalGroup, } from './deviceDirectory';
|
|
20
20
|
export { buildSwitcherRows, showsPrincipalHeaders } from './deviceSwitcherRows';
|
|
21
|
+
export { deviceComparisonCode } from './deviceComparisonCode';
|
|
21
22
|
export type { ResolveAvatarUrl, SwitcherContextRow, SwitcherPrincipalRow, } from './deviceSwitcherRows';
|
|
22
23
|
export { isSwitchTargetAccount, canSwitchIntoAccount, } from './accountSwitchTargets';
|
|
23
24
|
export { resolveAccountDelegationAccess } from './accountDelegationAccess';
|
package/package.json
CHANGED
|
@@ -19,8 +19,6 @@ const dict = {
|
|
|
19
19
|
renew: 'Afficher un nouveau code',
|
|
20
20
|
},
|
|
21
21
|
device: {
|
|
22
|
-
title: 'Connectez-vous avec votre téléphone',
|
|
23
|
-
caption: "Scannez avec l'appareil photo de votre téléphone",
|
|
24
22
|
codeHint: 'Vérifiez que votre téléphone affiche ce code',
|
|
25
23
|
},
|
|
26
24
|
errors: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code a person compares between a device with no keyboard (a TV, a photo
|
|
3
|
+
* frame) and the phone approving its sign-in: `CE7F-B31F`.
|
|
4
|
+
*
|
|
5
|
+
* The device's QR carries the request's full `authorizeCode` (16 random bytes,
|
|
6
|
+
* hex), and that alone is what approves. Its first eight characters are
|
|
7
|
+
* enough to tell "the request on this screen" from any other: the server draws
|
|
8
|
+
* the code at random, so a look-alike request would take about four billion
|
|
9
|
+
* rate-limited attempts, while thirty-two characters were too many for anyone
|
|
10
|
+
* to compare. Both sides (`OxyDeviceSignIn` on the device and the approval
|
|
11
|
+
* page on the phone) derive it here, so they always print the same thing.
|
|
12
|
+
*/
|
|
13
|
+
const COMPARISON_LENGTH = 8;
|
|
14
|
+
const GROUP_LENGTH = 4;
|
|
15
|
+
|
|
16
|
+
export function deviceComparisonCode(authorizeCode: string): string {
|
|
17
|
+
const head = authorizeCode.slice(0, COMPARISON_LENGTH).toUpperCase();
|
|
18
|
+
return `${head.slice(0, GROUP_LENGTH)}-${head.slice(GROUP_LENGTH)}`;
|
|
19
|
+
}
|
package/src/session/index.ts
CHANGED
|
@@ -75,6 +75,7 @@ export type {
|
|
|
75
75
|
// auth.oxy.so chooser so the two cannot drift, the same reason the flat
|
|
76
76
|
// projection lived here before it.
|
|
77
77
|
export { buildSwitcherRows, showsPrincipalHeaders } from './deviceSwitcherRows';
|
|
78
|
+
export { deviceComparisonCode } from './deviceComparisonCode';
|
|
78
79
|
export type {
|
|
79
80
|
ResolveAvatarUrl,
|
|
80
81
|
SwitcherContextRow,
|