@ccmsg/protocol 1.1.0 → 1.2.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/package.json +1 -1
- package/src/common/auth.ts +17 -0
- package/src/common/hello.ts +4 -2
package/package.json
CHANGED
package/src/common/auth.ts
CHANGED
|
@@ -131,6 +131,16 @@ export const AuthRegisterArgs = Type.Object({
|
|
|
131
131
|
/** What the person calls the device they are registering, for their own use
|
|
132
132
|
* when they later read back a list of several. Nothing is decided by it. */
|
|
133
133
|
device_label: Type.Optional(Type.String({ maxLength: 128 })),
|
|
134
|
+
/** The challenge this registration answers, with the instance that can spend
|
|
135
|
+
* it — the same pairing an assertion carries, and for the same reason: the
|
|
136
|
+
* value also sits inside `client_data_json`, but who may consume it does not,
|
|
137
|
+
* and behind a load balancer the instance that issued it, the one that made
|
|
138
|
+
* the registration URL and the one receiving this may all be different.
|
|
139
|
+
*
|
|
140
|
+
* Omitting it leaves the receiver with a value and no issuer, so it can only
|
|
141
|
+
* be honoured where the receiver itself holds the challenge; anywhere else
|
|
142
|
+
* the registration is refused rather than guessed at. */
|
|
143
|
+
challenge: Type.Optional(AuthChallenge),
|
|
134
144
|
credential: RegistrationCredential,
|
|
135
145
|
});
|
|
136
146
|
export type AuthRegisterArgs = Static<typeof AuthRegisterArgs>;
|
|
@@ -292,6 +302,13 @@ export const CredentialRecord = Type.Object(
|
|
|
292
302
|
public_key: Base64Url,
|
|
293
303
|
/** The `user.id` this credential was created against. */
|
|
294
304
|
user_handle: Base64Url,
|
|
305
|
+
/** The relying party this credential was created under, as the claims of
|
|
306
|
+
* the registration that made it stated. Written by the registration and not
|
|
307
|
+
* derived later: a passkey only answers for the domain it was made under,
|
|
308
|
+
* so an assertion's `rpIdHash` is checked against this and not against
|
|
309
|
+
* whatever the endpoint being reached happens to be. Absent only on a
|
|
310
|
+
* record written before the field existed. */
|
|
311
|
+
rp_id: Type.Optional(Type.String({ minLength: 1 })),
|
|
295
312
|
/** The authenticator's counter, when it keeps one. Synced passkeys report
|
|
296
313
|
* zero forever, so only a pair of non-zero readings says anything, and a
|
|
297
314
|
* reading below the last one is a refusal. */
|
package/src/common/hello.ts
CHANGED
|
@@ -92,8 +92,10 @@ export const InstanceInfo = Type.Object(
|
|
|
92
92
|
id: Type.Optional(InstanceId),
|
|
93
93
|
/** Where it is dialed. An attribute of the instance like the host below:
|
|
94
94
|
* it is what a peer connects to and authenticates against, and it may
|
|
95
|
-
* change under a fixed `id` when the instance moves.
|
|
96
|
-
|
|
95
|
+
* change under a fixed `id` when the instance moves. Absent for the same
|
|
96
|
+
* reason it is absent from the reply's own `endpoint`: an instance in no
|
|
97
|
+
* mesh has no URL to be dialed at, including on its own line. */
|
|
98
|
+
endpoint: Type.Optional(Endpoint),
|
|
97
99
|
/** The host it runs on. An attribute of the instance, not its identity —
|
|
98
100
|
* one host may run several instances. */
|
|
99
101
|
host: Type.String({ minLength: 1 }),
|