@cortexkit/claustrum-client 0.16.0 → 0.17.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/README.md +7 -0
- package/dist/wire.d.ts +4 -0
- package/dist/wire.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,6 +168,13 @@ for (;;) {
|
|
|
168
168
|
|
|
169
169
|
## Enrollment
|
|
170
170
|
|
|
171
|
+
`enrollPropose` accepts an optional `displayName`, for example
|
|
172
|
+
`{ name: 'consumer', requestSecretHash, displayName: 'Claude sign-in for Pi' }`.
|
|
173
|
+
The person sees and approves the proposed label, or replaces it during approval.
|
|
174
|
+
This option needs a vault build with enrollment display-name support; an older
|
|
175
|
+
vault refuses the `display_name` field as `invalid_params`. Omit `displayName`
|
|
176
|
+
for compatibility with older vaults.
|
|
177
|
+
|
|
171
178
|
Use `newEnrollmentSecret()` to prepare an enrollment proposal. It generates 32
|
|
172
179
|
random bytes as exactly 64 lowercase hex characters, plus `requestSecretHash`:
|
|
173
180
|
the lowercase hex SHA-256 of the **32 decoded bytes**, not of the UTF-8 hex text.
|
package/dist/wire.d.ts
CHANGED
|
@@ -179,10 +179,14 @@ export declare class ClaustrumClient {
|
|
|
179
179
|
* BEFORE calling this, and a crash costs nothing.
|
|
180
180
|
*
|
|
181
181
|
* A different secret on the same name is a different caller and is refused.
|
|
182
|
+
* Optional `displayName` proposes a person-facing label for operator approval. It
|
|
183
|
+
* needs a vault build with enrollment display-name support; an older vault refuses
|
|
184
|
+
* the `display_name` field as `invalid_params`. Omit it for older vaults.
|
|
182
185
|
*/
|
|
183
186
|
enrollPropose(input: {
|
|
184
187
|
name: string;
|
|
185
188
|
requestSecretHash: string;
|
|
189
|
+
displayName?: string;
|
|
186
190
|
}): Promise<{
|
|
187
191
|
requestId: string;
|
|
188
192
|
}>;
|
package/dist/wire.js
CHANGED
|
@@ -296,11 +296,15 @@ export class ClaustrumClient {
|
|
|
296
296
|
* BEFORE calling this, and a crash costs nothing.
|
|
297
297
|
*
|
|
298
298
|
* A different secret on the same name is a different caller and is refused.
|
|
299
|
+
* Optional `displayName` proposes a person-facing label for operator approval. It
|
|
300
|
+
* needs a vault build with enrollment display-name support; an older vault refuses
|
|
301
|
+
* the `display_name` field as `invalid_params`. Omit it for older vaults.
|
|
299
302
|
*/
|
|
300
303
|
async enrollPropose(input) {
|
|
301
304
|
const response = await this.#call('auth.enroll_propose', {
|
|
302
305
|
proposed_name: input.name,
|
|
303
306
|
request_secret_hash: input.requestSecretHash,
|
|
307
|
+
...(input.displayName !== undefined ? { display_name: input.displayName } : {}),
|
|
304
308
|
});
|
|
305
309
|
const result = decodeEnrollmentResult(response, this.#logger);
|
|
306
310
|
const requestId = result.request_id;
|