@tempoxyz/id 0.0.0-pr-479.sha-3ea98d2 → 0.0.0-pr-481.sha-e1aaa69
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/README.md +0 -2
- package/dist/Actions.d.ts +13 -13
- package/dist/Actions.js +9 -9
- package/dist/Actions.js.map +1 -1
- package/dist/Authorization.d.ts +1 -1
- package/dist/Authorization.d.ts.map +1 -1
- package/dist/Id.d.ts +10 -10
- package/dist/Id.d.ts.map +1 -1
- package/dist/Id.js +3 -3
- package/dist/Id.js.map +1 -1
- package/dist/Key.d.ts +8 -8
- package/dist/Key.d.ts.map +1 -1
- package/dist/Key.js +5 -5
- package/dist/Key.js.map +1 -1
- package/dist/Pending.d.ts +2 -2
- package/dist/Pending.d.ts.map +1 -1
- package/dist/Permissions.d.ts +7 -7
- package/dist/Permissions.d.ts.map +1 -1
- package/dist/Plugin.d.ts +1 -1
- package/dist/Plugin.d.ts.map +1 -1
- package/dist/Session.d.ts +1 -1
- package/dist/Session.js +1 -1
- package/dist/actions/account.d.ts +14 -14
- package/dist/actions/account.d.ts.map +1 -1
- package/dist/actions/account.js +6 -6
- package/dist/actions/account.js.map +1 -1
- package/dist/actions/backend/email.d.ts +4 -4
- package/dist/actions/backend/email.js +4 -4
- package/dist/actions/backend/email.js.map +1 -1
- package/dist/actions/device.d.ts +3 -3
- package/dist/actions/device.js +2 -2
- package/dist/actions/device.js.map +1 -1
- package/dist/actions/dialog.d.ts +5 -5
- package/dist/actions/dialog.d.ts.map +1 -1
- package/dist/actions/dialog.js +3 -3
- package/dist/actions/email.d.ts +12 -12
- package/dist/actions/email.d.ts.map +1 -1
- package/dist/actions/email.js +10 -10
- package/dist/actions/email.js.map +1 -1
- package/dist/actions/passkey.d.ts +18 -18
- package/dist/actions/passkey.d.ts.map +1 -1
- package/dist/actions/passkey.js +13 -13
- package/dist/actions/passkey.js.map +1 -1
- package/dist/actions/redirect.d.ts +10 -10
- package/dist/actions/redirect.d.ts.map +1 -1
- package/dist/actions/redirect.js +5 -5
- package/dist/actions/redirect.js.map +1 -1
- package/dist/internal/accessKey.d.ts +6 -6
- package/dist/internal/accessKey.d.ts.map +1 -1
- package/dist/internal/accessKey.js +4 -4
- package/dist/internal/api.d.ts +7 -7
- package/dist/internal/api.d.ts.map +1 -1
- package/dist/internal/api.js +5 -5
- package/dist/internal/api.js.map +1 -1
- package/dist/internal/backendSessions.d.ts +1 -1
- package/dist/internal/backendSessions.js +2 -2
- package/dist/internal/backendSessions.js.map +1 -1
- package/dist/internal/core.d.ts +4 -4
- package/dist/internal/core.d.ts.map +1 -1
- package/dist/internal/core.js +5 -5
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/headless.d.ts +15 -15
- package/dist/internal/headless.d.ts.map +1 -1
- package/dist/internal/headless.js +7 -7
- package/dist/internal/headless.js.map +1 -1
- package/dist/internal/request.d.ts +8 -8
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/request.js +4 -4
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/session.d.ts +1 -1
- package/dist/internal/session.js +2 -2
- package/dist/internal/session.js.map +1 -1
- package/dist/internal/signIn.d.ts +4 -4
- package/dist/internal/signIn.d.ts.map +1 -1
- package/dist/internal/signIn.js +2 -2
- package/dist/internal/signIn.js.map +1 -1
- package/dist/internal/signer.d.ts +1 -1
- package/dist/internal/signer.js +2 -2
- package/dist/internal/signer.js.map +1 -1
- package/dist/internal/verifier.d.ts +2 -2
- package/dist/internal/verifier.d.ts.map +1 -1
- package/dist/internal/viem/accessKey.d.ts +5 -5
- package/dist/internal/viem/accessKey.d.ts.map +1 -1
- package/dist/internal/viem/accessKey.js +7 -7
- package/dist/internal/viem/accessKey.js.map +1 -1
- package/dist/plugins/backend.d.ts +1 -1
- package/dist/plugins/device.d.ts +3 -3
- package/dist/plugins/device.js +1 -1
- package/dist/plugins/dialog.d.ts +1 -1
- package/dist/plugins/email.d.ts +4 -4
- package/dist/plugins/email.js +1 -1
- package/dist/plugins/passkey.d.ts +3 -3
- package/dist/plugins/passkey.js +1 -1
- package/dist/plugins/passkey.js.map +1 -1
- package/dist/plugins/redirect.d.ts +1 -1
- package/dist/plugins/viem.d.ts +1 -1
- package/dist/plugins/viem.js +1 -1
- package/dist/plugins/viem.js.map +1 -1
- package/dist/wagmi.d.ts +3 -3
- package/dist/wagmi.js +6 -6
- package/dist/wagmi.js.map +1 -1
- package/package.json +2 -2
- package/src/Actions.ts +16 -16
- package/src/Authorization.ts +1 -1
- package/src/Id.ts +10 -10
- package/src/Key.ts +9 -9
- package/src/Pending.ts +2 -2
- package/src/Permissions.ts +7 -7
- package/src/Plugin.ts +1 -1
- package/src/Session.ts +1 -1
- package/src/actions/account.ts +15 -15
- package/src/actions/backend/email.ts +6 -6
- package/src/actions/device.ts +4 -4
- package/src/actions/dialog.ts +5 -5
- package/src/actions/email.ts +16 -16
- package/src/actions/passkey.ts +24 -24
- package/src/actions/redirect.ts +14 -14
- package/src/internal/accessKey.ts +6 -6
- package/src/internal/api.ts +9 -9
- package/src/internal/backendSessions.ts +4 -4
- package/src/internal/core.ts +7 -7
- package/src/internal/headless.ts +18 -18
- package/src/internal/request.ts +11 -11
- package/src/internal/session.ts +3 -3
- package/src/internal/signIn.ts +4 -4
- package/src/internal/signer.ts +2 -2
- package/src/internal/verifier.ts +2 -2
- package/src/internal/viem/accessKey.ts +8 -8
- package/src/plugins/backend.ts +1 -1
- package/src/plugins/device.ts +3 -3
- package/src/plugins/dialog.ts +1 -1
- package/src/plugins/email.ts +4 -4
- package/src/plugins/passkey.ts +4 -4
- package/src/plugins/redirect.ts +1 -1
- package/src/plugins/viem.ts +2 -2
- package/src/wagmi.ts +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Signs the user in with a passkey from the app's own sign-in form, and authorizes the app's key.
|
|
2
|
+
* Signs the user in with a passkey from the app's own sign-in form, and authorizes the app's access key.
|
|
3
3
|
* The handle of {@link prepare} requests the sign-in's options before the user acts, so its sign-in
|
|
4
4
|
* starts the ceremony without a request. {@link register} adds a passkey for the signed-in user
|
|
5
5
|
* from the app's page.
|
|
@@ -28,7 +28,7 @@ export declare function available(auth: Config): Promise<boolean>;
|
|
|
28
28
|
/**
|
|
29
29
|
* Prepares a passkey sign-in before the user acts, such as when the sign-in form shows, and
|
|
30
30
|
* returns its handle. The handle checks {@link available}, and where it returns `true`, requests
|
|
31
|
-
* the sign-in's options and the key that it authorizes, so the handle's `signIn` starts the
|
|
31
|
+
* the sign-in's options and the access key that it authorizes, so the handle's `signIn` starts the
|
|
32
32
|
* ceremony without a request. Create a new handle when the request options change.
|
|
33
33
|
*
|
|
34
34
|
* The handle owns its options. A sign-in uses them once, and requests new ones after 4 minutes.
|
|
@@ -51,13 +51,13 @@ export declare function prepare<const permissions extends Permissions | undefine
|
|
|
51
51
|
export declare namespace prepare {
|
|
52
52
|
type Options<permissions extends Permissions | undefined = Permissions | undefined> = {
|
|
53
53
|
/**
|
|
54
|
-
* The key to authorize. Defaults to a new key. Its `access` names the Tempo Account, which
|
|
54
|
+
* The access key to authorize. Defaults to a new access key. Its `access` names the Tempo Account, which
|
|
55
55
|
* defaults to the app's selected account, or the user's oldest.
|
|
56
56
|
*/
|
|
57
57
|
accessKey?: Account.Account | undefined;
|
|
58
58
|
/**
|
|
59
59
|
* A message whose EIP-191 hash the key authorization binds as its `witness`. Needs the
|
|
60
|
-
* `tempo-id:sign` scope and
|
|
60
|
+
* `tempo-id:sign` scope and an access key.
|
|
61
61
|
*/
|
|
62
62
|
challenge?: ([permissions] extends [undefined] ? never : string) | undefined;
|
|
63
63
|
/**
|
|
@@ -67,7 +67,7 @@ export declare namespace prepare {
|
|
|
67
67
|
credentialId?: readonly string[] | string | undefined;
|
|
68
68
|
/** The browser's mediation, such as `conditional` for autofill. Defaults to its own. */
|
|
69
69
|
mediation?: 'conditional' | 'optional' | 'required' | 'silent' | undefined;
|
|
70
|
-
/** What the key may do, which a request for
|
|
70
|
+
/** What the access key may do, which a request for an access key must name. Within the headless ceiling, unless the app holds `tempo-id:sign`. */
|
|
71
71
|
permissions?: permissions;
|
|
72
72
|
/**
|
|
73
73
|
* Whether the browser offers every passkey of the relying party, for a sign-in that starts
|
|
@@ -96,9 +96,9 @@ export declare namespace prepare {
|
|
|
96
96
|
* the authenticator creates the passkey, then the new passkey signs a proof challenge, so call it
|
|
97
97
|
* from a click.
|
|
98
98
|
*
|
|
99
|
-
* With `key`, the key of a sign-in on a cloud wallet's configurable account, the passkey joins that
|
|
100
|
-
* account as a second owner on the key's chain, through an update that the cloud wallet signs. The
|
|
101
|
-
* key keeps working. On a chain whose accounts are not configurable, `key` sets nothing, and the
|
|
99
|
+
* With `key`, the access key of a sign-in on a cloud wallet's configurable account, the passkey joins that
|
|
100
|
+
* account as a second owner on the access key's chain, through an update that the cloud wallet signs. The
|
|
101
|
+
* access key keeps working. On a chain whose accounts are not configurable, `key` sets nothing, and the
|
|
102
102
|
* passkey owns an account of its own. `account` and `chain` name the account and chain instead.
|
|
103
103
|
*
|
|
104
104
|
* Requires a sign-in within the last 10 minutes, or throws `reauthentication_required`. A user who
|
|
@@ -137,9 +137,9 @@ export declare namespace register {
|
|
|
137
137
|
/** Runs the proof ceremony in place of `navigator.credentials.get`. */
|
|
138
138
|
getFn?: Authentication.sign.Options['getFn'] | undefined;
|
|
139
139
|
/**
|
|
140
|
-
* The key of a sign-in on the cloud wallet's account, such as `authorization.key`. Tempo ID
|
|
141
|
-
* reads its chain: on a chain whose accounts are configurable, the key sets the default
|
|
142
|
-
* `account` and `chain`. Registration does not use the key otherwise.
|
|
140
|
+
* The access key of a sign-in on the cloud wallet's account, such as `authorization.key`. Tempo ID
|
|
141
|
+
* reads its chain: on a chain whose accounts are configurable, the access key sets the default
|
|
142
|
+
* `account` and `chain`. Registration does not use the access key otherwise.
|
|
143
143
|
*/
|
|
144
144
|
key?: Pick<Key.Key, 'account' | 'chainId'> | undefined;
|
|
145
145
|
/**
|
|
@@ -160,7 +160,7 @@ export declare namespace register {
|
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Signs the user in with a passkey, and authorizes a first-party app with the same assertion. The
|
|
163
|
-
* key must fit the headless ceiling. A user without a Tempo Account receives one.
|
|
163
|
+
* access key must fit the headless ceiling. A user without a Tempo Account receives one.
|
|
164
164
|
*
|
|
165
165
|
* Returns an email step for a wallet.tempo passkey whose account has no email. Pass its `link` to
|
|
166
166
|
* `Actions.email.signIn`.
|
|
@@ -170,9 +170,9 @@ export declare namespace register {
|
|
|
170
170
|
* has `signedIn: true`. An account that another passkey owns throws `webauthn_required`, so
|
|
171
171
|
* authorize through `Actions.redirect.start`.
|
|
172
172
|
*
|
|
173
|
-
* A wallet.tempo passkey's account that waits for its upgrade signs the key as the passkey's own
|
|
174
|
-
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the key then upgrades
|
|
175
|
-
* the account with one more prompt, after Tempo ID registers the key.
|
|
173
|
+
* A wallet.tempo passkey's account that waits for its upgrade signs the access key as the passkey's own
|
|
174
|
+
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the access key then upgrades
|
|
175
|
+
* the account with one more prompt, after Tempo ID registers the access key.
|
|
176
176
|
*
|
|
177
177
|
* It requests the sign-in's options when called. {@link prepare} requests them before the user
|
|
178
178
|
* acts instead.
|
|
@@ -199,11 +199,11 @@ export declare namespace signIn {
|
|
|
199
199
|
/** The kind of step. */
|
|
200
200
|
type: 'email';
|
|
201
201
|
};
|
|
202
|
-
/** The authorization, without its key for a sign-in without `permissions`, and whether its account can upgrade, or the email step. */
|
|
202
|
+
/** The authorization, without its access key for a sign-in without `permissions`, and whether its account can upgrade, or the email step. */
|
|
203
203
|
type ReturnType<chainId extends number = number, key extends boolean = false> = ((key extends false ? Omit<Authorization<chainId>, 'accessKey' | 'key'> : Authorization<chainId>) & {
|
|
204
204
|
/**
|
|
205
|
-
* Whether the key's account is a wallet.tempo passkey's that waits for its upgrade on the
|
|
206
|
-
* key's chain. `Actions.account.upgrade` with the key upgrades it, and keeps the key.
|
|
205
|
+
* Whether the access key's account is a wallet.tempo passkey's that waits for its upgrade on the
|
|
206
|
+
* access key's chain. `Actions.account.upgrade` with the access key upgrades it, and keeps the access key.
|
|
207
207
|
*/
|
|
208
208
|
upgradeAvailable: boolean;
|
|
209
209
|
}) | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passkey.d.ts","sourceRoot":"","sources":["../../src/actions/passkey.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,cAAc,EAEd,YAAY,EAEb,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAA0C,MAAM,UAAU,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,KAAK,GAAG,MAAM,WAAW,CAAA;AAIrC,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpE;;;;;;;;;;;GAWG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAe9D;AAQD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,OAAO,CACrB,KAAK,CAAC,WAAW,SAAS,WAAW,GAAG,SAAS,GAAG,SAAS,EAE7D,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,OAAO,CAAC,OAAO,CAAC,WAAW,CAAM,GACzC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAsC9D;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,KAAK,OAAO,CACV,WAAW,SAAS,WAAW,GAAG,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O,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAQtE;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,KAAK,OAAO,CACV,WAAW,SAAS,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,IACnE,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;QACjC;;;WAGG;QACH,KAAK,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CAAA;KACzD,CAAA;IAED,qFAAqF;IACrF,KAAK,SAAS,GAAG;QACf,oFAAoF;QACpF,IAAI,EAAE,MAAM,CAAA;QACZ,wBAAwB;QACxB,IAAI,EAAE,OAAO,CAAA;KACd,CAAA;IAED,6IAA6I;IAC7I,KAAK,UAAU,CACb,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,GAAG,SAAS,OAAO,GAAG,KAAK,IAEzB,CAAC,CAAC,GAAG,SAAS,KAAK,GACf,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,GACjD,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG;QAC5B;;;WAGG;QACH,gBAAgB,EAAE,OAAO,CAAA;KAC1B,CAAC,GACF;QACE,4DAA4D;QAC5D,IAAI,EAAE,SAAS,CAAA;KAChB,CAAA;CACN"}
|
package/dist/actions/passkey.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Signs the user in with a passkey from the app's own sign-in form, and authorizes the app's key.
|
|
2
|
+
* Signs the user in with a passkey from the app's own sign-in form, and authorizes the app's access key.
|
|
3
3
|
* The handle of {@link prepare} requests the sign-in's options before the user acts, so its sign-in
|
|
4
4
|
* starts the ceremony without a request. {@link register} adds a passkey for the signed-in user
|
|
5
5
|
* from the app's page.
|
|
@@ -40,7 +40,7 @@ const preparedLifetime = 4 * 60 * 1000;
|
|
|
40
40
|
/**
|
|
41
41
|
* Prepares a passkey sign-in before the user acts, such as when the sign-in form shows, and
|
|
42
42
|
* returns its handle. The handle checks {@link available}, and where it returns `true`, requests
|
|
43
|
-
* the sign-in's options and the key that it authorizes, so the handle's `signIn` starts the
|
|
43
|
+
* the sign-in's options and the access key that it authorizes, so the handle's `signIn` starts the
|
|
44
44
|
* ceremony without a request. Create a new handle when the request options change.
|
|
45
45
|
*
|
|
46
46
|
* The handle owns its options. A sign-in uses them once, and requests new ones after 4 minutes.
|
|
@@ -96,9 +96,9 @@ export function prepare(auth, options = {}) {
|
|
|
96
96
|
* the authenticator creates the passkey, then the new passkey signs a proof challenge, so call it
|
|
97
97
|
* from a click.
|
|
98
98
|
*
|
|
99
|
-
* With `key`, the key of a sign-in on a cloud wallet's configurable account, the passkey joins that
|
|
100
|
-
* account as a second owner on the key's chain, through an update that the cloud wallet signs. The
|
|
101
|
-
* key keeps working. On a chain whose accounts are not configurable, `key` sets nothing, and the
|
|
99
|
+
* With `key`, the access key of a sign-in on a cloud wallet's configurable account, the passkey joins that
|
|
100
|
+
* account as a second owner on the access key's chain, through an update that the cloud wallet signs. The
|
|
101
|
+
* access key keeps working. On a chain whose accounts are not configurable, `key` sets nothing, and the
|
|
102
102
|
* passkey owns an account of its own. `account` and `chain` name the account and chain instead.
|
|
103
103
|
*
|
|
104
104
|
* Requires a sign-in within the last 10 minutes, or throws `reauthentication_required`. A user who
|
|
@@ -115,7 +115,7 @@ export function prepare(auth, options = {}) {
|
|
|
115
115
|
*/
|
|
116
116
|
export async function register(auth, options = {}) {
|
|
117
117
|
const { createFn, getFn, key } = options;
|
|
118
|
-
// Tempo ID reads a chain ID in `chain` as it reads a name. It decides whether the key's chain
|
|
118
|
+
// Tempo ID reads a chain ID in `chain` as it reads a name. It decides whether the access key's chain
|
|
119
119
|
// takes an owner, so the page reads no chain list.
|
|
120
120
|
const chain = options.chain ?? options.chainId;
|
|
121
121
|
// A sign-in's registration options save the options request while their challenge lasts.
|
|
@@ -205,7 +205,7 @@ export async function register(auth, options = {}) {
|
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
207
|
* Signs the user in with a passkey, and authorizes a first-party app with the same assertion. The
|
|
208
|
-
* key must fit the headless ceiling. A user without a Tempo Account receives one.
|
|
208
|
+
* access key must fit the headless ceiling. A user without a Tempo Account receives one.
|
|
209
209
|
*
|
|
210
210
|
* Returns an email step for a wallet.tempo passkey whose account has no email. Pass its `link` to
|
|
211
211
|
* `Actions.email.signIn`.
|
|
@@ -215,9 +215,9 @@ export async function register(auth, options = {}) {
|
|
|
215
215
|
* has `signedIn: true`. An account that another passkey owns throws `webauthn_required`, so
|
|
216
216
|
* authorize through `Actions.redirect.start`.
|
|
217
217
|
*
|
|
218
|
-
* A wallet.tempo passkey's account that waits for its upgrade signs the key as the passkey's own
|
|
219
|
-
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the key then upgrades
|
|
220
|
-
* the account with one more prompt, after Tempo ID registers the key.
|
|
218
|
+
* A wallet.tempo passkey's account that waits for its upgrade signs the access key as the passkey's own
|
|
219
|
+
* account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the access key then upgrades
|
|
220
|
+
* the account with one more prompt, after Tempo ID registers the access key.
|
|
221
221
|
*
|
|
222
222
|
* It requests the sign-in's options when called. {@link prepare} requests them before the user
|
|
223
223
|
* acts instead.
|
|
@@ -264,15 +264,15 @@ function refused(error) {
|
|
|
264
264
|
error.status < 500);
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
|
-
* Requests the options of a passkey sign-in, and the key that they authorize.
|
|
267
|
+
* Requests the options of a passkey sign-in, and the access key that they authorize.
|
|
268
268
|
* @throws {ChallengeWithoutKeyError} For a challenge without `permissions`, before any request.
|
|
269
269
|
*/
|
|
270
270
|
async function requestOptions(auth, options) {
|
|
271
271
|
const { credentialId, mediation, select } = options;
|
|
272
|
-
// A challenge rides in the key, so a sign-in without one refuses it before it signs in.
|
|
272
|
+
// A challenge rides in the access key, so a sign-in without one refuses it before it signs in.
|
|
273
273
|
if (!options.permissions && options.challenge !== undefined)
|
|
274
274
|
throw new ChallengeWithoutKeyError();
|
|
275
|
-
// The options carry the authorization request, so the challenge is its key's digest.
|
|
275
|
+
// The options carry the authorization request, so the challenge is its access key's digest.
|
|
276
276
|
const { authorize, key } = await Headless.prepare(auth, options);
|
|
277
277
|
// The challenge's lifetime starts at Tempo ID before the response arrives, so the options' does too.
|
|
278
278
|
const requestedAt = Date.now();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passkey.js","sourceRoot":"","sources":["../../src/actions/passkey.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,cAAc,EACd,UAAU,EACV,YAAY,GAEb,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAe,wBAAwB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI9E,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAGlE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,CAC1C,IAAI,GAAG,CACL,cAAc,IAAI,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,EACjE,IAAI,CAAC,GAAG,CACT,CACF,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IACxB,iGAAiG;IACjG,sCAAsC;IACtC,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3B,uFAAuF;IACvF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,CACzB,QAAQ,CACT,CAAC,KAAK,CAAC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AI,CAAC,IAAI,EAAE,EAAE,CAAA;IACjE,OAAO,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE;QACnC,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,IAAI;QACJ,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,OAAO,EAAE,QAAQ,CAAC,OAAO;KAC1B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -16,7 +16,7 @@ import type { Keyed, Permissions } from '../Permissions.js';
|
|
|
16
16
|
* it sends the code exchange at once, from the tab's copy of the verifier, before IndexedDB returns
|
|
17
17
|
* the rest of the redirect's state. A callback that denies the
|
|
18
18
|
* redirect, such as `error=access_denied`, throws a `RequestError` with that `code` and status 0.
|
|
19
|
-
* The result carries
|
|
19
|
+
* The result carries an access key when `start` received `permissions`.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```ts
|
|
@@ -28,11 +28,11 @@ import type { Keyed, Permissions } from '../Permissions.js';
|
|
|
28
28
|
export declare function complete(auth: Config, options?: complete.Options): Promise<complete.ReturnType>;
|
|
29
29
|
export declare namespace complete {
|
|
30
30
|
type Options = {
|
|
31
|
-
/** The key that the app passed to {@link start}, if any. */
|
|
31
|
+
/** The access key that the app passed to {@link start}, if any. */
|
|
32
32
|
accessKey?: Account.Account | undefined;
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* The authorization, with its key when `start` received `permissions`. `undefined` when the page
|
|
35
|
+
* The authorization, with its access key when `start` received `permissions`. `undefined` when the page
|
|
36
36
|
* is not a redirect's callback.
|
|
37
37
|
*/
|
|
38
38
|
type ReturnType = handleCallback.WithoutKey | Authorization | undefined;
|
|
@@ -57,7 +57,7 @@ export declare function createUrl<const permissions extends Permissions | undefi
|
|
|
57
57
|
export declare namespace createUrl {
|
|
58
58
|
type Options<permissions extends Permissions | undefined = Permissions | undefined> = {
|
|
59
59
|
/**
|
|
60
|
-
* The key to authorize. Defaults to a new key, whose material `pending` keeps. Its `access`
|
|
60
|
+
* The access key to authorize. Defaults to a new access key, whose material `pending` keeps. Its `access`
|
|
61
61
|
* names the Tempo Account, which defaults to the one the user selects, or the user's oldest.
|
|
62
62
|
*/
|
|
63
63
|
accessKey?: Account.Account | undefined;
|
|
@@ -101,16 +101,16 @@ export declare namespace createUrl {
|
|
|
101
101
|
export declare function handleCallback<const pending extends Pending.Pending | Pending.WithoutKey = Pending.Pending>(auth: Config, options: handleCallback.Options<pending>): Promise<handleCallback.ReturnType<pending>>;
|
|
102
102
|
export declare namespace handleCallback {
|
|
103
103
|
type Options<pending extends Pending.Pending | Pending.WithoutKey = Pending.Pending> = {
|
|
104
|
-
/** The key that the app passed to `createUrl`, if any. */
|
|
104
|
+
/** The access key that the app passed to `createUrl`, if any. */
|
|
105
105
|
accessKey?: Account.Account | undefined;
|
|
106
106
|
/** What `createUrl` returned to keep. */
|
|
107
107
|
pending: pending;
|
|
108
108
|
/** The callback URL that Tempo ID redirected to. */
|
|
109
109
|
url: string | URL;
|
|
110
110
|
};
|
|
111
|
-
/** The authorization, without its key for a `Pending.WithoutKey`. */
|
|
111
|
+
/** The authorization, without its access key for a `Pending.WithoutKey`. */
|
|
112
112
|
type ReturnType<pending extends Pending.Pending | Pending.WithoutKey = Pending.Pending> = [pending] extends [Pending.WithoutKey] ? WithoutKey : [pending] extends [Pending.Pending] ? Authorization : Authorization | WithoutKey;
|
|
113
|
-
/** A sign-in without
|
|
113
|
+
/** A sign-in without an access key: the tokens and the user. */
|
|
114
114
|
type WithoutKey = Omit<Authorization, 'accessKey' | 'key'>;
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
@@ -135,7 +135,7 @@ export declare namespace prefetch {
|
|
|
135
135
|
/**
|
|
136
136
|
* Sends the browser to Tempo ID's pages to sign in, and keeps the redirect's state in `store`.
|
|
137
137
|
* With the default store, it also keeps the `state`, the redirect URI, and the PKCE verifier in
|
|
138
|
-
* the tab's `sessionStorage`, without the key's material. {@link complete} finishes it when the
|
|
138
|
+
* the tab's `sessionStorage`, without the access key's material. {@link complete} finishes it when the
|
|
139
139
|
* browser returns.
|
|
140
140
|
*
|
|
141
141
|
* @example
|
|
@@ -146,11 +146,11 @@ export declare namespace prefetch {
|
|
|
146
146
|
export declare function start(auth: Config, options?: start.Options): Promise<void>;
|
|
147
147
|
export declare namespace start {
|
|
148
148
|
type Options = {
|
|
149
|
-
/** The key to authorize, which {@link complete} needs too. Defaults to a new key. */
|
|
149
|
+
/** The access key to authorize, which {@link complete} needs too. Defaults to a new access key. */
|
|
150
150
|
accessKey?: Account.Account | undefined;
|
|
151
151
|
/**
|
|
152
152
|
* A message whose EIP-191 hash the key authorization binds as its `witness`. Needs the
|
|
153
|
-
* `tempo-id:sign` scope and
|
|
153
|
+
* `tempo-id:sign` scope and an access key.
|
|
154
154
|
*/
|
|
155
155
|
challenge?: string | undefined;
|
|
156
156
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.d.ts","sourceRoot":"","sources":["../../src/actions/redirect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAM7C,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,QAAQ,CAAC,OAAY,GAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CA2E9B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,KAAK,OAAO,GAAG;QACb,
|
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ange at once, from the tab's copy of the verifier, before IndexedDB returns
|
|
11
11
|
* the rest of the redirect's state. A callback that denies the
|
|
12
12
|
* redirect, such as `error=access_denied`, throws a `RequestError` with that `code` and status 0.
|
|
13
|
-
* The result carries
|
|
13
|
+
* The result carries an access key when `start` received `permissions`.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
@@ -187,13 +187,13 @@ function signedIn(error) {
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
|
-
* Returns the authorization of a redeemed code, with the key of `pending`, or the tokens and the
|
|
191
|
-
* user for a `Pending.WithoutKey`. Throws a `RequestError` when a redirect with
|
|
190
|
+
* Returns the authorization of a redeemed code, with the access key of `pending`, or the tokens and the
|
|
191
|
+
* user for a `Pending.WithoutKey`. Throws a `RequestError` when a redirect with an access key receives no
|
|
192
192
|
* key authorization.
|
|
193
193
|
*/
|
|
194
194
|
function finish(options) {
|
|
195
195
|
const { body } = options;
|
|
196
|
-
// The exchange's fields stay out of the key's material.
|
|
196
|
+
// The exchange's fields stay out of the access key's material.
|
|
197
197
|
const { key, chainId: _chainId, clientId: _clientId, redirectUri: _redirectUri, state: _state, verifier: _verifier, ...material } = options.pending;
|
|
198
198
|
// `pending.key` decides both the type and the runtime value of the result.
|
|
199
199
|
if (key === false) {
|
|
@@ -249,7 +249,7 @@ export async function prefetch(auth) {
|
|
|
249
249
|
/**
|
|
250
250
|
* Sends the browser to Tempo ID's pages to sign in, and keeps the redirect's state in `store`.
|
|
251
251
|
* With the default store, it also keeps the `state`, the redirect URI, and the PKCE verifier in
|
|
252
|
-
* the tab's `sessionStorage`, without the key's material. {@link complete} finishes it when the
|
|
252
|
+
* the tab's `sessionStorage`, without the access key's material. {@link complete} finishes it when the
|
|
253
253
|
* browser returns.
|
|
254
254
|
*
|
|
255
255
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../src/actions/redirect.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YAAE,SAAQ;QAC9B,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,GAAG,GAAG,UAAU,CAAA;QACrB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAOD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,IAAY,EACZ,OAAO,GAAkB,EAAE;IAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACvD,MAAM,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC9D,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5B,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAC7B,CAAC;AAwBD;;;GAGG;AACH,MAAM,SAAS,GAAG,IAAI,OAAO,EAG1B,CAAA;AAEH,mDAAmD;AACnD,MAAM,QAAQ,GAAG,mBAAmB,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Account } from 'viem/tempo';
|
|
2
2
|
import type * as Key from '../Key.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns the app's key, or creates one: a non-extractable `CryptoKey` in a browser, or else a
|
|
5
|
-
* secp256k1 key.
|
|
4
|
+
* Returns the app's access key, or creates one: a non-extractable `CryptoKey` in a browser, or else a
|
|
5
|
+
* secp256k1 access key.
|
|
6
6
|
*/
|
|
7
7
|
export declare function resolve(accessKey: Account.Account | undefined): Promise<resolve.ReturnType>;
|
|
8
8
|
/**
|
|
9
|
-
* Rebuilds
|
|
10
|
-
* empty material of the app's own key.
|
|
9
|
+
* Rebuilds an access key that {@link resolve} generated from its material. Returns `undefined` for the
|
|
10
|
+
* empty material of the app's own access key.
|
|
11
11
|
*/
|
|
12
12
|
export declare function restore(material: Key.Material): resolve.ReturnType | undefined;
|
|
13
13
|
export declare namespace resolve {
|
|
14
14
|
type ReturnType = {
|
|
15
|
-
/** A Viem account that signs with the key. */
|
|
15
|
+
/** A Viem account that signs with the access key. */
|
|
16
16
|
accessKey: Account.Account;
|
|
17
|
-
/** What the authorization keeps to rebuild the key. Empty for the app's own key. */
|
|
17
|
+
/** What the authorization keeps to rebuild the access key. Empty for the app's own access key. */
|
|
18
18
|
material: Key.Material;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessKey.d.ts","sourceRoot":"","sources":["../../src/internal/accessKey.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAa,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,KAAK,GAAG,MAAM,WAAW,CAAA;AAErC;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,SAAS,EAAE,OAAO,CAAC,OAAO,GAAG,SAAS,GACrC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAgB7B;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,GAAG,CAAC,QAAQ,GACrB,OAAO,CAAC,UAAU,GAAG,SAAS,CAMhC;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,KAAK,UAAU,GAAG;QAChB,
|
|
1
|
+
{"version":3,"file":"accessKey.d.ts","sourceRoot":"","sources":["../../src/internal/accessKey.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAa,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,KAAK,GAAG,MAAM,WAAW,CAAA;AAErC;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,SAAS,EAAE,OAAO,CAAC,OAAO,GAAG,SAAS,GACrC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAgB7B;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,GAAG,CAAC,QAAQ,GACrB,OAAO,CAAC,UAAU,GAAG,SAAS,CAMhC;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,KAAK,UAAU,GAAG;QAChB,qDAAqD;QACrD,SAAS,EAAE,OAAO,CAAC,OAAO,CAAA;QAC1B,kGAAkG;QAClG,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAA;KACvB,CAAA;CACF"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { WebCryptoP256 } from 'ox';
|
|
6
6
|
import { Account, Secp256k1 } from 'viem/tempo';
|
|
7
7
|
/**
|
|
8
|
-
* Returns the app's key, or creates one: a non-extractable `CryptoKey` in a browser, or else a
|
|
9
|
-
* secp256k1 key.
|
|
8
|
+
* Returns the app's access key, or creates one: a non-extractable `CryptoKey` in a browser, or else a
|
|
9
|
+
* secp256k1 access key.
|
|
10
10
|
*/
|
|
11
11
|
export async function resolve(accessKey) {
|
|
12
12
|
if (accessKey)
|
|
@@ -25,8 +25,8 @@ export async function resolve(accessKey) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Rebuilds
|
|
29
|
-
* empty material of the app's own key.
|
|
28
|
+
* Rebuilds an access key that {@link resolve} generated from its material. Returns `undefined` for the
|
|
29
|
+
* empty material of the app's own access key.
|
|
30
30
|
*/
|
|
31
31
|
export function restore(material) {
|
|
32
32
|
if (material.keyPair)
|
package/dist/internal/api.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import * as TempoAccount from '../TempoAccount.js';
|
|
|
8
8
|
import type { Tokens } from '../Tokens.js';
|
|
9
9
|
import type { User } from '../User.js';
|
|
10
10
|
/**
|
|
11
|
-
* Builds an authorization from Tempo ID's response and the sign-in's key: generated material, or
|
|
11
|
+
* Builds an authorization from Tempo ID's response and the sign-in's access key: generated material, or
|
|
12
12
|
* the app's `accessKey`. Throws `server_error` for a response without the key authorization.
|
|
13
13
|
*/
|
|
14
14
|
export declare function authorization<chainId extends number = number>(body: Headless, options: {
|
|
@@ -17,13 +17,13 @@ export declare function authorization<chainId extends number = number>(body: Hea
|
|
|
17
17
|
}): Authorization<chainId>;
|
|
18
18
|
/** What the headless API returns for an authorization. */
|
|
19
19
|
export type Headless = {
|
|
20
|
-
/** The Tempo Account the key acts for, present for a request with
|
|
20
|
+
/** The Tempo Account the access key acts for, present for a request with an access key. */
|
|
21
21
|
account?: Key.Key['account'] | undefined;
|
|
22
22
|
/** The signed key authorization, in RPC format, present for a request with a key. */
|
|
23
23
|
key_authorization?: KeyAuthorization.Rpc | undefined;
|
|
24
24
|
/** The issued tokens, raw from the token endpoint or already read into `Tokens`. */
|
|
25
25
|
tokens: TokenResponse | Tokens;
|
|
26
|
-
/** Present when the key's account waits for its upgrade, so the key signed as its own. */
|
|
26
|
+
/** Present when the access key's account waits for its upgrade, so the access key signed as its own. */
|
|
27
27
|
upgrade_available?: true | undefined;
|
|
28
28
|
};
|
|
29
29
|
/** Reads a JSON response, and throws a {@link RequestError} for a refusal. */
|
|
@@ -99,7 +99,7 @@ export declare function par(auth: Id.Config, parameters: URLSearchParams): Promi
|
|
|
99
99
|
export declare function token(auth: Id.Config, body: Record<string, string>): Promise<TokenResponse>;
|
|
100
100
|
/**
|
|
101
101
|
* Builds the Viem account of a Tempo Account from Tempo ID's response, with its keys, the type of
|
|
102
|
-
* the owner that signs its keys, and its realm. On a chain with configurable accounts, a passkey of
|
|
102
|
+
* the owner that signs its access keys, and its realm. On a chain with configurable accounts, a passkey of
|
|
103
103
|
* the user's signs as an owner, through `getFn`. Elsewhere, the account holds its address alone.
|
|
104
104
|
* Throws `server_error` for a configuration that does not derive the account's address.
|
|
105
105
|
*/
|
|
@@ -139,7 +139,7 @@ export type TempoAccountResponse = {
|
|
|
139
139
|
export type TokenResponse = {
|
|
140
140
|
/** The access token for the app's API requests. */
|
|
141
141
|
access_token: string;
|
|
142
|
-
/** The Tempo Account the key acts for, present with `key_authorization`. */
|
|
142
|
+
/** The Tempo Account the access key acts for, present with `key_authorization`. */
|
|
143
143
|
account?: Key.Key['account'] | undefined;
|
|
144
144
|
/** The access token's lifetime, in seconds. */
|
|
145
145
|
expires_in: number;
|
|
@@ -165,9 +165,9 @@ export declare namespace signedIn {
|
|
|
165
165
|
message?: string | undefined;
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
/** Reads an authorization without
|
|
168
|
+
/** Reads an authorization without an access key: the tokens and the user. */
|
|
169
169
|
export declare function withoutKey(body: Headless): WithoutKey;
|
|
170
|
-
/** An authorization without
|
|
170
|
+
/** An authorization without an access key: the tokens and the user. */
|
|
171
171
|
export type WithoutKey = Omit<Authorization, 'accessKey' | 'key'>;
|
|
172
172
|
/** One owner of a Tempo Account, as the API returns it. */
|
|
173
173
|
type Owner = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/internal/api.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAChC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC3D,IAAI,EAA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,EAAE,MAAM,GAAG,IAAI,CAKzC;AAED,4CAA4C;AAC5C,wBAAgB,MAAM,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAOtD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,QAAQ,CAAC,OAAY,GAC7B,KAAK,CAuBP;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,KAAK,OAAO,GAAG;QACb,sGAAsG;QACtG,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAC7B,CAAA;CACF;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAIrD;AAED,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,KAAK,CAAC,CAAA;AAEjE,2DAA2D;AAC3D,KAAK,KAAK,GAAG;IACX,mEAAmE;IACnE,UAAU,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,GAAG,SAAS,CAAA;IACjE,oCAAoC;IACpC,KAAK,EAAE,KAAK,MAAM,EAAE,CAAA;IACpB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
|
package/dist/internal/api.js
CHANGED
|
@@ -9,12 +9,12 @@ import * as Dpop from '../Dpop.js';
|
|
|
9
9
|
import * as Key from '../Key.js';
|
|
10
10
|
import * as TempoAccount from '../TempoAccount.js';
|
|
11
11
|
/**
|
|
12
|
-
* Builds an authorization from Tempo ID's response and the sign-in's key: generated material, or
|
|
12
|
+
* Builds an authorization from Tempo ID's response and the sign-in's access key: generated material, or
|
|
13
13
|
* the app's `accessKey`. Throws `server_error` for a response without the key authorization.
|
|
14
14
|
*/
|
|
15
15
|
export function authorization(body, options) {
|
|
16
16
|
const { accessKey, material } = options;
|
|
17
|
-
// A response to a request with
|
|
17
|
+
// A response to a request with an access key always carries one, so its absence is a fault.
|
|
18
18
|
if (!body.account || !body.key_authorization)
|
|
19
19
|
throw new RequestError({
|
|
20
20
|
code: 'server_error',
|
|
@@ -173,12 +173,12 @@ export async function token(auth, body) {
|
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* Builds the Viem account of a Tempo Account from Tempo ID's response, with its keys, the type of
|
|
176
|
-
* the owner that signs its keys, and its realm. On a chain with configurable accounts, a passkey of
|
|
176
|
+
* the owner that signs its access keys, and its realm. On a chain with configurable accounts, a passkey of
|
|
177
177
|
* the user's signs as an owner, through `getFn`. Elsewhere, the account holds its address alone.
|
|
178
178
|
* Throws `server_error` for a configuration that does not derive the account's address.
|
|
179
179
|
*/
|
|
180
180
|
export function tempoAccount(account, options = {}) {
|
|
181
|
-
// A configuration sorts its owners by address. A cloud wallet signs the account's keys whenever it
|
|
181
|
+
// A configuration sorts its owners by address. A cloud wallet signs the account's access keys whenever it
|
|
182
182
|
// is an owner, so it names the account's owner before a passkey does.
|
|
183
183
|
const owner = account.config.owners.find((entry) => entry.type !== 'webAuthn') ??
|
|
184
184
|
account.config.owners[0];
|
|
@@ -267,7 +267,7 @@ export function signedIn(error, options = {}) {
|
|
|
267
267
|
uri: error.uri,
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
|
-
/** Reads an authorization without
|
|
270
|
+
/** Reads an authorization without an access key: the tokens and the user. */
|
|
271
271
|
export function withoutKey(body) {
|
|
272
272
|
const tokens_ = 'accessToken' in body.tokens ? body.tokens : tokens(body.tokens);
|
|
273
273
|
return { ...tokens_, user: user(tokens_) };
|