@structured-id/proto 0.9.0 → 0.11.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.
@@ -5,101 +5,18 @@ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
5
5
  import type { IBinaryReader } from "@protobuf-ts/runtime";
6
6
  import type { PartialMessage } from "@protobuf-ts/runtime";
7
7
  import { MessageType } from "@protobuf-ts/runtime";
8
+ import { ResetSessionId } from "../ids/ids.js";
9
+ import { StepUpChallengeId } from "../ids/ids.js";
10
+ import { OtpSessionId } from "../ids/ids.js";
11
+ import { ImportedPasswordUpgradeId } from "../ids/ids.js";
12
+ import { MagicLinkId } from "../ids/ids.js";
8
13
  import { Timestamp } from "../../../google/protobuf/timestamp.js";
14
+ import { CredentialId } from "../ids/ids.js";
9
15
  import { PasswordRegistrationProof } from "./password_history.js";
10
16
  import { PasswordOperationId } from "../ids/ids.js";
11
17
  import { PasswordHistoryContext } from "./password_history.js";
12
- /**
13
- * @generated from protobuf message sid.v1.authn.OpaqueRegistrationStartRequest
14
- */
15
- export interface OpaqueRegistrationStartRequest {
16
- /**
17
- * User-provided login identifier: email address, phone in E.164 format (+380...),
18
- * or username. Server resolves principal type from the value and looks up or creates
19
- * the profile.
20
- *
21
- * @generated from protobuf field: string principal = 1
22
- */
23
- principal: string;
24
- /**
25
- * OPAQUE RegistrationRequest (blinded password). Client-generated by
26
- * OpaqueClient.registrationStart(password). Contains no recoverable password
27
- * material — safe to transmit. RFC 9807 §5.2.
28
- *
29
- * @generated from protobuf field: bytes registration_request = 2
30
- */
31
- registrationRequest: Uint8Array;
32
- /**
33
- * Instance claim token (`sidclaim_...`) the operator read from the service log.
34
- * Required while the installation has no administrator: it is then the only
35
- * registration accepted, and the new profile becomes the first administrator
36
- * (the token is consumed with the registration). Ignored once the installation
37
- * is claimed. Bearer secret: never logged or echoed.
38
- *
39
- * @generated from protobuf field: optional string claim_token = 3
40
- */
41
- claimToken?: string;
42
- }
43
- /**
44
- * @generated from protobuf message sid.v1.authn.OpaqueRegistrationStartResponse
45
- */
46
- export interface OpaqueRegistrationStartResponse {
47
- /**
48
- * OPAQUE RegistrationResponse: server's OPRF evaluation of the blinded password.
49
- * Client needs this to compute the final registration record. RFC 9807 §5.2.
50
- * Server-generated, single-use.
51
- *
52
- * @generated from protobuf field: bytes registration_response = 1
53
- */
54
- registrationResponse: Uint8Array;
55
- /**
56
- * Serialized server-side OPAQUE setup state. Client echoes this back in Finish
57
- * to allow stateless server (no server-side session between Start and Finish).
58
- * Contains server's long-term public key + OPRF seed. Opaque to client.
59
- *
60
- * @generated from protobuf field: string server_setup = 2
61
- */
62
- serverSetup: string;
63
- }
64
- /**
65
- * @generated from protobuf message sid.v1.authn.OpaqueRegistrationFinishRequest
66
- */
67
- export interface OpaqueRegistrationFinishRequest {
68
- /**
69
- * Same principal as in Start. Server re-resolves to verify consistency.
70
- *
71
- * @generated from protobuf field: string principal = 1
72
- */
73
- principal: string;
74
- /**
75
- * OPAQUE RegistrationRecord: client's encrypted credential envelope.
76
- * Contains the password file that server stores for future login verification.
77
- * Client-generated by OpaqueClient.registrationFinish(password, response, state).
78
- * Safe to transmit — encrypted under server's public key. RFC 9807 §5.2.
79
- *
80
- * @generated from protobuf field: bytes registration_record = 2
81
- */
82
- registrationRecord: Uint8Array;
83
- /**
84
- * Echoed from OpaqueRegistrationStartResponse.server_setup.
85
- * Server deserializes to recover OPRF context for storing the credential.
86
- *
87
- * @generated from protobuf field: string server_setup = 3
88
- */
89
- serverSetup: string;
90
- }
91
- /**
92
- * @generated from protobuf message sid.v1.authn.OpaqueRegistrationFinishResponse
93
- */
94
- export interface OpaqueRegistrationFinishResponse {
95
- /**
96
- * UUID of the OPAQUE credential stored on server. Used for password change
97
- * (PasswordChangeChallenge.credential_id) and credential management.
98
- *
99
- * @generated from protobuf field: string credential_id = 2
100
- */
101
- credentialId: string;
102
- }
18
+ import { SessionId } from "../ids/ids.js";
19
+ import { OpaqueLoginId } from "../ids/ids.js";
103
20
  /**
104
21
  * @generated from protobuf message sid.v1.authn.OpaqueLoginStartRequest
105
22
  */
@@ -134,13 +51,13 @@ export interface OpaqueLoginStartResponse {
134
51
  */
135
52
  credentialResponse: Uint8Array;
136
53
  /**
137
- * Serialized ServerLogin state. Client echoes this in Finish for stateless
138
- * server design. Contains the server's AKE state machine (ephemeral keys,
139
- * expected finalization). 5-minute TTL.
54
+ * This login, for its Finish to name. Only a reference: the server keeps
55
+ * the login's AKE state (ephemeral keys, expected finalization) itself for
56
+ * 5 minutes, and a Finish takes it once.
140
57
  *
141
- * @generated from protobuf field: string server_login_state = 2
58
+ * @generated from protobuf field: sid.v1.ids.OpaqueLoginId login_id = 3
142
59
  */
143
- serverLoginState: string;
60
+ loginId?: OpaqueLoginId;
144
61
  }
145
62
  /**
146
63
  * @generated from protobuf message sid.v1.authn.OpaqueLoginFinishRequest
@@ -162,11 +79,11 @@ export interface OpaqueLoginFinishRequest {
162
79
  */
163
80
  credentialFinalization: Uint8Array;
164
81
  /**
165
- * Echoed from OpaqueLoginStartResponse.server_login_state.
82
+ * The login being finished: OpaqueLoginStartResponse.login_id, as received.
166
83
  *
167
- * @generated from protobuf field: string server_login_state = 3
84
+ * @generated from protobuf field: sid.v1.ids.OpaqueLoginId login_id = 4
168
85
  */
169
- serverLoginState: string;
86
+ loginId?: OpaqueLoginId;
170
87
  }
171
88
  /**
172
89
  * The session a sign-in ceremony completed. Its credential is never in the
@@ -179,16 +96,27 @@ export interface OpaqueLoginFinishRequest {
179
96
  * configured otherwise does not start), so the cookie is first-party and a
180
97
  * page on another site completes no browser sign-in at all.
181
98
  *
99
+ * A native client that wants a renewable session sends a SID native proof of
100
+ * its application key in `sid-native-proof` request metadata, with `sid_cer`
101
+ * over the 16 bytes of this request's `login_id` (native_session.proto). When the
102
+ * sign-in completes the session, the response then also carries its first
103
+ * generation of refresh credentials in `sid-native-credentials-bin`
104
+ * metadata, bound to that key. A pending context (second factor or first
105
+ * enrollment still owed) carries none: the completing method delivers them,
106
+ * its proof's `sid_cer` taken over the pending context presented in
107
+ * `authorization`. A proof that does not verify fails the call; no session
108
+ * is created without the binding it asked for.
109
+ *
182
110
  * @generated from protobuf message sid.v1.authn.OpaqueLoginFinishResponse
183
111
  */
184
112
  export interface OpaqueLoginFinishResponse {
185
113
  /**
186
- * Server-assigned session identifier (UUIDv7). Used for session management
187
- * (revoke, step-up target). Not a credential.
114
+ * The session this sign-in opened, for session management (listing,
115
+ * revocation). Not a credential.
188
116
  *
189
- * @generated from protobuf field: string session_id = 1
117
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
190
118
  */
191
- sessionId: string;
119
+ sessionId?: SessionId;
192
120
  /**
193
121
  * Seconds until the delivered credential expires: the access token for a
194
122
  * native client (default 900), the session cookie for a browser.
@@ -234,7 +162,10 @@ export interface OpaqueLoginFinishResponse {
234
162
  */
235
163
  export interface OpaqueZkppRegistrationStartRequest {
236
164
  /**
237
- * User-provided login identifier (same semantics as OpaqueRegistrationStartRequest.principal).
165
+ * User-provided login identifier of the new account: email address, phone in
166
+ * E.164 format (+380...) or username. The server resolves its type from the
167
+ * value; an identifier already held is answered like a free one, and its
168
+ * registration never commits.
238
169
  *
239
170
  * @generated from protobuf field: string principal = 1
240
171
  */
@@ -248,7 +179,13 @@ export interface OpaqueZkppRegistrationStartRequest {
248
179
  */
249
180
  registrationRequest: Uint8Array;
250
181
  /**
251
- * Instance claim token; same semantics as OpaqueRegistrationStartRequest.claim_token.
182
+ * Instance claim token (`sidclaim_...`), which every replica of an installation
183
+ * without an administrator holds and writes to its log at start. While that
184
+ * claim is open it is the only registration admitted, whatever the
185
+ * enrollment mode (REGISTRATION_RESTRICTED, requirement `instance_claim`,
186
+ * otherwise); the new profile becomes the first administrator and the token
187
+ * is consumed when the account commits. Ignored once the installation is
188
+ * claimed. Bearer secret: never logged or echoed.
252
189
  *
253
190
  * @generated from protobuf field: optional string claim_token = 6
254
191
  */
@@ -270,7 +207,8 @@ export interface OpaqueZkppRegistrationStartRequest {
270
207
  */
271
208
  export interface OpaqueZkppRegistrationStartResponse {
272
209
  /**
273
- * OPAQUE RegistrationResponse (RFC 9807 §5.1), as in the basic flow.
210
+ * OPAQUE RegistrationResponse (RFC 9807 §5.1): the server's OPRF evaluation
211
+ * of the blinded password, from which the client computes its record.
274
212
  *
275
213
  * @generated from protobuf field: bytes registration_response = 1
276
214
  */
@@ -294,7 +232,8 @@ export interface OpaqueZkppRegistrationFinishRequest {
294
232
  */
295
233
  operationId?: PasswordOperationId;
296
234
  /**
297
- * OPAQUE RegistrationRecord (RFC 9807 §5.1), as in the basic flow.
235
+ * OPAQUE RegistrationRecord (RFC 9807 §5.1): the client's envelope the server
236
+ * stores as the credential. Contains no recoverable password material.
298
237
  *
299
238
  * @generated from protobuf field: bytes registration_record = 2
300
239
  */
@@ -311,24 +250,24 @@ export interface OpaqueZkppRegistrationFinishRequest {
311
250
  */
312
251
  export interface OpaqueZkppRegistrationFinishResponse {
313
252
  /**
314
- * UUID of the OPAQUE-ZKPP credential stored on server.
253
+ * The password credential the registration stored.
315
254
  *
316
- * @generated from protobuf field: string credential_id = 2
255
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 3
317
256
  */
318
- credentialId: string;
257
+ credentialId?: CredentialId;
319
258
  }
320
259
  /**
321
260
  * @generated from protobuf message sid.v1.authn.PasswordChangeChallengeRequest
322
261
  */
323
262
  export interface PasswordChangeChallengeRequest {
324
263
  /**
325
- * Which OPAQUE credential to change. Client obtains this from
326
- * ListCredentials filtered by type=OPAQUE. Profile resolved from Bearer
327
- * token (not client-provided).
264
+ * Which OPAQUE credential of the caller's Profile to change, from
265
+ * ListCredentials filtered by type=OPAQUE. The Profile is resolved from
266
+ * the bearer token, not sent.
328
267
  *
329
- * @generated from protobuf field: string credential_id = 1
268
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 4
330
269
  */
331
- credentialId: string;
270
+ credentialId?: CredentialId;
332
271
  /**
333
272
  * OPAQUE CredentialRequest (KE1) of a sign-in with the current password,
334
273
  * made by the client as for OpaqueLoginStart (RFC 9807 §6), in the
@@ -385,9 +324,9 @@ export interface PasswordChangeExecuteRequest {
385
324
  /**
386
325
  * Target OPAQUE credential (same as in ChallengeRequest).
387
326
  *
388
- * @generated from protobuf field: string credential_id = 1
327
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 11
389
328
  */
390
- credentialId: string;
329
+ credentialId?: CredentialId;
391
330
  /**
392
331
  * OPAQUE CredentialFinalization (KE3) of the current-password sign-in begun
393
332
  * in the challenge (RFC 9807 §6), under the change context. Required when
@@ -422,9 +361,9 @@ export interface PasswordChangeFinishRequest {
422
361
  /**
423
362
  * Target OPAQUE credential (same as in Challenge/Execute).
424
363
  *
425
- * @generated from protobuf field: string credential_id = 1
364
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 6
426
365
  */
427
- credentialId: string;
366
+ credentialId?: CredentialId;
428
367
  /**
429
368
  * Final OPAQUE RegistrationRecord computed by client from RegistrationResponse.
430
369
  * Contains the encrypted password envelope that the server stores.
@@ -497,11 +436,12 @@ export interface WebAuthnRegistrationFinishRequest {
497
436
  */
498
437
  export interface WebAuthnRegistrationFinishResponse {
499
438
  /**
500
- * Server-assigned credential ID (UUID). Used for management (delete, update label).
439
+ * The passkey credential the registration stored, for management (delete,
440
+ * label). Not the authenticator's WebAuthn credential ID.
501
441
  *
502
- * @generated from protobuf field: string credential_id = 1
442
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 2
503
443
  */
504
- credentialId: string;
444
+ credentialId?: CredentialId;
505
445
  }
506
446
  /**
507
447
  * @generated from protobuf message sid.v1.authn.WebAuthnAuthenticationStartRequest
@@ -535,14 +475,6 @@ export interface WebAuthnAuthenticationStartResponse {
535
475
  * @generated from protobuf field: bytes options = 2
536
476
  */
537
477
  options: Uint8Array;
538
- /**
539
- * Opaque state key for challenge lookup in Finish. Client echoes back.
540
- * Required for conditional UI (no principal to re-resolve).
541
- * Optional for principal-first (server can re-resolve, but state_key is faster).
542
- *
543
- * @generated from protobuf field: string state_key = 3
544
- */
545
- stateKey: string;
546
478
  }
547
479
  /**
548
480
  * @generated from protobuf message sid.v1.authn.WebAuthnAuthenticationFinishRequest
@@ -562,27 +494,23 @@ export interface WebAuthnAuthenticationFinishRequest {
562
494
  * @generated from protobuf field: bytes credential = 2
563
495
  */
564
496
  credential: Uint8Array;
565
- /**
566
- * Echoed from WebAuthnAuthenticationStartResponse.state_key.
567
- * Required for conditional UI. Optional for principal-first (backward compat).
568
- *
569
- * @generated from protobuf field: optional string state_key = 3
570
- */
571
- stateKey?: string;
572
497
  }
573
498
  /**
574
499
  * The session a passkey sign-in completed; its credential is delivered as for
575
- * OpaqueLoginFinishResponse.
500
+ * OpaqueLoginFinishResponse. A native renewable session is asked for as
501
+ * there, with `sid_cer` over the `challenge` of the
502
+ * WebAuthnAuthenticationStartResponse the assertion answers: the server
503
+ * takes it from the assertion's own challenge, not from this request.
576
504
  *
577
505
  * @generated from protobuf message sid.v1.authn.WebAuthnAuthenticationFinishResponse
578
506
  */
579
507
  export interface WebAuthnAuthenticationFinishResponse {
580
508
  /**
581
- * Server-assigned session ID (same semantics as OpaqueLoginFinishResponse).
509
+ * Same semantics as OpaqueLoginFinishResponse.session_id.
582
510
  *
583
- * @generated from protobuf field: string session_id = 1
511
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
584
512
  */
585
- sessionId: string;
513
+ sessionId?: SessionId;
586
514
  /**
587
515
  * Seconds until the delivered credential expires.
588
516
  *
@@ -1194,11 +1122,11 @@ export interface OAuth2RevokeResponse {
1194
1122
  */
1195
1123
  export interface ValidateSessionRequest {
1196
1124
  /**
1197
- * Session ID to validate (UUIDv7). Obtained from JWT sid claim or cookie.
1125
+ * The session to validate, from the token's `sid` claim or the cookie.
1198
1126
  *
1199
- * @generated from protobuf field: string session_id = 1
1127
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 2
1200
1128
  */
1201
- sessionId: string;
1129
+ sessionId?: SessionId;
1202
1130
  }
1203
1131
  /**
1204
1132
  * @generated from protobuf message sid.v1.authn.ValidateSessionResponse
@@ -1404,11 +1332,11 @@ export interface RequestMagicLinkRequest {
1404
1332
  */
1405
1333
  export interface RequestMagicLinkResponse {
1406
1334
  /**
1407
- * Magic link session ID. Client may display "check your email" with this reference.
1335
+ * The magic link requested. Client may display "check your email" with this reference.
1408
1336
  *
1409
- * @generated from protobuf field: string session_id = 1
1337
+ * @generated from protobuf field: sid.v1.ids.MagicLinkId magic_link_id = 3
1410
1338
  */
1411
- sessionId: string;
1339
+ magicLinkId?: MagicLinkId;
1412
1340
  /**
1413
1341
  * Magic link validity in seconds (default 600 = 10 min).
1414
1342
  *
@@ -1421,11 +1349,11 @@ export interface RequestMagicLinkResponse {
1421
1349
  */
1422
1350
  export interface VerifyMagicLinkRequest {
1423
1351
  /**
1424
- * Session ID from the magic link URL query parameter.
1352
+ * The magic link, from its URL (the page decodes the URL's text form).
1425
1353
  *
1426
- * @generated from protobuf field: string session_id = 1
1354
+ * @generated from protobuf field: sid.v1.ids.MagicLinkId magic_link_id = 3
1427
1355
  */
1428
- sessionId: string;
1356
+ magicLinkId?: MagicLinkId;
1429
1357
  /**
1430
1358
  * Cryptographic token from the magic link URL. Single-use, server-validated.
1431
1359
  *
@@ -1441,11 +1369,11 @@ export interface VerifyMagicLinkRequest {
1441
1369
  */
1442
1370
  export interface VerifyMagicLinkResponse {
1443
1371
  /**
1444
- * New session ID (different from magic link session — this is the auth session).
1372
+ * The session the link opened (not the magic link itself).
1445
1373
  *
1446
- * @generated from protobuf field: string session_id = 1
1374
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 4
1447
1375
  */
1448
- sessionId: string;
1376
+ sessionId?: SessionId;
1449
1377
  /**
1450
1378
  * Seconds until the delivered credential expires.
1451
1379
  *
@@ -1515,12 +1443,12 @@ export interface LegacyMigrateStartRequest {
1515
1443
  */
1516
1444
  export interface LegacyMigrateStartResponse {
1517
1445
  /**
1518
- * Opaque server-side migration state token. 5-minute TTL.
1519
- * Client echoes in Finish to complete the migration.
1446
+ * The upgrade this start began, kept by the server for 5 minutes. The
1447
+ * client sends it with the finish.
1520
1448
  *
1521
- * @generated from protobuf field: string migration_token = 1
1449
+ * @generated from protobuf field: sid.v1.ids.ImportedPasswordUpgradeId upgrade_id = 3
1522
1450
  */
1523
- migrationToken: string;
1451
+ upgradeId?: ImportedPasswordUpgradeId;
1524
1452
  /**
1525
1453
  * OPAQUE RegistrationResponse for client to compute registration record.
1526
1454
  *
@@ -1533,11 +1461,11 @@ export interface LegacyMigrateStartResponse {
1533
1461
  */
1534
1462
  export interface LegacyMigrateFinishRequest {
1535
1463
  /**
1536
- * Echoed from LegacyMigrateStartResponse.migration_token.
1464
+ * From LegacyMigrateStartResponse.upgrade_id.
1537
1465
  *
1538
- * @generated from protobuf field: string migration_token = 1
1466
+ * @generated from protobuf field: sid.v1.ids.ImportedPasswordUpgradeId upgrade_id = 3
1539
1467
  */
1540
- migrationToken: string;
1468
+ upgradeId?: ImportedPasswordUpgradeId;
1541
1469
  /**
1542
1470
  * OPAQUE RegistrationRecord computed by client. Server stores as new credential,
1543
1471
  * deletes legacy hash. Migration complete.
@@ -1554,11 +1482,11 @@ export interface LegacyMigrateFinishRequest {
1554
1482
  */
1555
1483
  export interface LegacyMigrateFinishResponse {
1556
1484
  /**
1557
- * Session ID (same semantics as OpaqueLoginFinishResponse).
1485
+ * Same semantics as OpaqueLoginFinishResponse.session_id.
1558
1486
  *
1559
- * @generated from protobuf field: string session_id = 1
1487
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
1560
1488
  */
1561
- sessionId: string;
1489
+ sessionId?: SessionId;
1562
1490
  /**
1563
1491
  * Seconds until the delivered credential expires.
1564
1492
  *
@@ -1636,11 +1564,12 @@ export interface GetZkppPolicyResponse {
1636
1564
  */
1637
1565
  export interface SubmitDeferredZkProofRequest {
1638
1566
  /**
1639
- * Credential ID to verify (must belong to the Bearer token's profile).
1567
+ * The password credential to verify; it must belong to the bearer token's
1568
+ * Profile.
1640
1569
  *
1641
- * @generated from protobuf field: string credential_id = 1
1570
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 5
1642
1571
  */
1643
- credentialId: string;
1572
+ credentialId?: CredentialId;
1644
1573
  /**
1645
1574
  * Halo2 password-policy proof over the credential's OPAQUE blinded element.
1646
1575
  *
@@ -1680,25 +1609,13 @@ export interface SubmitDeferredZkProofResponse {
1680
1609
  export interface StartTotpEnrollmentRequest {
1681
1610
  }
1682
1611
  /**
1612
+ * What an authenticator app is given: the shared secret and the parameters
1613
+ * the server selected. The SDK presents them (Base32 for manual entry, the
1614
+ * `otpauth://` URI and its QR code); the server sends no display form.
1615
+ *
1683
1616
  * @generated from protobuf message sid.v1.authn.TotpEnrollmentChallenge
1684
1617
  */
1685
1618
  export interface TotpEnrollmentChallenge {
1686
- /**
1687
- * TOTP shared secret, Base32-encoded (RFC 4648). Used by authenticator apps.
1688
- * 20 bytes of entropy, suitable for HMAC-SHA1 (RFC 6238 default).
1689
- * SECURITY: displayed to user only during enrollment, never again.
1690
- *
1691
- * @generated from protobuf field: string secret = 1
1692
- */
1693
- secret: string;
1694
- /**
1695
- * Full otpauth:// URI for QR code generation. Encodes secret, issuer,
1696
- * account, algorithm, digits, period. RFC 6238 + Google Authenticator spec.
1697
- * Server is format authority (client should not construct this manually).
1698
- *
1699
- * @generated from protobuf field: string qr_uri = 2
1700
- */
1701
- qrUri: string;
1702
1619
  /**
1703
1620
  * Issuer name displayed in authenticator app (e.g., "StructuredID").
1704
1621
  * Server-configured (RealmSettings.display_name).
@@ -1713,6 +1630,32 @@ export interface TotpEnrollmentChallenge {
1713
1630
  * @generated from protobuf field: string account_name = 4
1714
1631
  */
1715
1632
  accountName: string;
1633
+ /**
1634
+ * The TOTP shared secret (RFC 6238 §5.1, the HMAC key), raw: 20 random
1635
+ * bytes generated by the server. SECURITY: delivered only in this response
1636
+ * of the enrollment, never again; the client shows it once.
1637
+ *
1638
+ * @generated from protobuf field: bytes shared_secret = 5
1639
+ */
1640
+ sharedSecret: Uint8Array;
1641
+ /**
1642
+ * The HMAC the codes use (RFC 6238 §1.2).
1643
+ *
1644
+ * @generated from protobuf field: sid.v1.authn.TotpAlgorithm algorithm = 6
1645
+ */
1646
+ algorithm: TotpAlgorithm;
1647
+ /**
1648
+ * Digits per code (RFC 4226 §5.3), e.g. 6.
1649
+ *
1650
+ * @generated from protobuf field: uint32 digits = 7
1651
+ */
1652
+ digits: number;
1653
+ /**
1654
+ * Seconds each code is valid for (RFC 6238 §4.1, X), e.g. 30.
1655
+ *
1656
+ * @generated from protobuf field: uint32 period_seconds = 8
1657
+ */
1658
+ periodSeconds: number;
1716
1659
  }
1717
1660
  /**
1718
1661
  * @generated from protobuf message sid.v1.authn.FinishTotpEnrollmentRequest
@@ -1731,11 +1674,11 @@ export interface FinishTotpEnrollmentRequest {
1731
1674
  */
1732
1675
  export interface FinishTotpEnrollmentResponse {
1733
1676
  /**
1734
- * UUID of the newly created TOTP credential.
1677
+ * The TOTP credential the enrollment stored.
1735
1678
  *
1736
- * @generated from protobuf field: string credential_id = 1
1679
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 3
1737
1680
  */
1738
- credentialId: string;
1681
+ credentialId?: CredentialId;
1739
1682
  /**
1740
1683
  * 12 single-use recovery codes. Generated only if this is the user's
1741
1684
  * first MFA factor (no existing TOTP, WebAuthn, or recovery codes).
@@ -1761,6 +1704,12 @@ export interface VerifyTotpRequest {
1761
1704
  * Shared response for MFA verification (TOTP, SMS, recovery).
1762
1705
  * Used by VerifyTotp, VerifySmsMfa, and VerifyRecoveryCode RPCs.
1763
1706
  *
1707
+ * A native sign-in that asked for a renewable session completes it here: a
1708
+ * SID native proof in `sid-native-proof`, `sid_cer` over the pending context
1709
+ * presented in `authorization`, and the completed session's first
1710
+ * generation in `sid-native-credentials-bin` response metadata
1711
+ * (native_session.proto).
1712
+ *
1764
1713
  * @generated from protobuf message sid.v1.authn.MfaVerifyResponse
1765
1714
  */
1766
1715
  export interface MfaVerifyResponse {
@@ -1771,12 +1720,12 @@ export interface MfaVerifyResponse {
1771
1720
  */
1772
1721
  verified: boolean;
1773
1722
  /**
1774
- * New session ID after MFA elevation (session refreshed with amr updated).
1775
- * Set when verified=true and this was the last required MFA step.
1723
+ * The session after MFA elevation (refreshed with the updated amr). Set
1724
+ * when verified=true and this was the last required MFA step.
1776
1725
  *
1777
- * @generated from protobuf field: optional string session_id = 2
1726
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
1778
1727
  */
1779
- sessionId?: string;
1728
+ sessionId?: SessionId;
1780
1729
  /**
1781
1730
  * Seconds until the delivered credential expires; set when one was
1782
1731
  * delivered.
@@ -1863,9 +1812,11 @@ export interface RequestOtpRequest {
1863
1812
  */
1864
1813
  export interface RequestOtpResponse {
1865
1814
  /**
1866
- * @generated from protobuf field: string otp_session_id = 1
1815
+ * The code requested, for its verify and resend.
1816
+ *
1817
+ * @generated from protobuf field: sid.v1.ids.OtpSessionId otp_session_id = 5
1867
1818
  */
1868
- otpSessionId: string;
1819
+ otpSessionId?: OtpSessionId;
1869
1820
  /**
1870
1821
  * @generated from protobuf field: string masked_target = 2
1871
1822
  */
@@ -1888,9 +1839,11 @@ export interface VerifyOtpRequest {
1888
1839
  */
1889
1840
  code: string;
1890
1841
  /**
1891
- * @generated from protobuf field: optional string session_id = 2
1842
+ * The code's request, from RequestOtpResponse.otp_session_id.
1843
+ *
1844
+ * @generated from protobuf field: sid.v1.ids.OtpSessionId otp_session_id = 3
1892
1845
  */
1893
- sessionId?: string;
1846
+ otpSessionId?: OtpSessionId;
1894
1847
  }
1895
1848
  /**
1896
1849
  * @generated from protobuf message sid.v1.authn.VerifyOtpResponse
@@ -1909,9 +1862,9 @@ export interface VerifyOtpResponse {
1909
1862
  * Mailbox possession grants provisional scopes only: it cannot add or
1910
1863
  * change a credential of an existing account.
1911
1864
  *
1912
- * @generated from protobuf field: optional string session_id = 3
1865
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 6
1913
1866
  */
1914
- sessionId?: string;
1867
+ sessionId?: SessionId;
1915
1868
  /**
1916
1869
  * Seconds until the delivered credential expires; set when verified.
1917
1870
  *
@@ -1924,9 +1877,11 @@ export interface VerifyOtpResponse {
1924
1877
  */
1925
1878
  export interface ResendOtpRequest {
1926
1879
  /**
1927
- * @generated from protobuf field: optional string session_id = 1
1880
+ * The code's request, from RequestOtpResponse.otp_session_id.
1881
+ *
1882
+ * @generated from protobuf field: sid.v1.ids.OtpSessionId otp_session_id = 2
1928
1883
  */
1929
- sessionId?: string;
1884
+ otpSessionId?: OtpSessionId;
1930
1885
  }
1931
1886
  /**
1932
1887
  * @generated from protobuf message sid.v1.authn.ResendOtpResponse
@@ -2308,14 +2263,11 @@ export interface SubmitDynamicPromptResponse {
2308
2263
  }
2309
2264
  /**
2310
2265
  * Phase 1: Request challenge (WebAuthn). Skipped for TOTP/recovery.
2266
+ * The session stepped up is the bearer token's own, never named here.
2311
2267
  *
2312
2268
  * @generated from protobuf message sid.v1.authn.RequestStepUpRequest
2313
2269
  */
2314
2270
  export interface RequestStepUpRequest {
2315
- /**
2316
- * @generated from protobuf field: string session_id = 1
2317
- */
2318
- sessionId: string;
2319
2271
  /**
2320
2272
  * @generated from protobuf field: sid.v1.authn.StepUpMethod method = 2
2321
2273
  */
@@ -2332,9 +2284,12 @@ export interface StepUpChallenge {
2332
2284
  */
2333
2285
  method: StepUpMethod;
2334
2286
  /**
2335
- * @generated from protobuf field: string challenge_id = 2
2287
+ * The challenge, for CompleteStepUp of the same session; absent for a
2288
+ * 1-phase method.
2289
+ *
2290
+ * @generated from protobuf field: sid.v1.ids.StepUpChallengeId challenge_id = 6
2336
2291
  */
2337
- challengeId: string;
2292
+ challengeId?: StepUpChallengeId;
2338
2293
  /**
2339
2294
  * @generated from protobuf oneof: challenge
2340
2295
  */
@@ -2364,22 +2319,21 @@ export interface StepUpChallenge {
2364
2319
  }
2365
2320
  /**
2366
2321
  * Phase 2: Submit proof → elevate session.
2322
+ * The session stepped up is the bearer token's own, never named here.
2367
2323
  *
2368
2324
  * @generated from protobuf message sid.v1.authn.CompleteStepUpRequest
2369
2325
  */
2370
2326
  export interface CompleteStepUpRequest {
2371
- /**
2372
- * @generated from protobuf field: string session_id = 1
2373
- */
2374
- sessionId: string;
2375
2327
  /**
2376
2328
  * @generated from protobuf field: sid.v1.authn.StepUpMethod method = 2
2377
2329
  */
2378
2330
  method: StepUpMethod;
2379
2331
  /**
2380
- * @generated from protobuf field: string challenge_id = 3
2332
+ * From StepUpChallenge.challenge_id; absent for a 1-phase method.
2333
+ *
2334
+ * @generated from protobuf field: sid.v1.ids.StepUpChallengeId challenge_id = 7
2381
2335
  */
2382
- challengeId: string;
2336
+ challengeId?: StepUpChallengeId;
2383
2337
  /**
2384
2338
  * @generated from protobuf oneof: proof
2385
2339
  */
@@ -2431,9 +2385,11 @@ export interface CompleteStepUpResponse {
2431
2385
  */
2432
2386
  export interface DeleteMfaCredentialRequest {
2433
2387
  /**
2434
- * @generated from protobuf field: string credential_id = 1
2388
+ * The MFA credential of the caller's Profile to delete.
2389
+ *
2390
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 2
2435
2391
  */
2436
- credentialId: string;
2392
+ credentialId?: CredentialId;
2437
2393
  }
2438
2394
  /**
2439
2395
  * @generated from protobuf message sid.v1.authn.DeleteMfaCredentialResponse
@@ -2505,22 +2461,25 @@ export interface RequestPasswordResetResponse {
2505
2461
  */
2506
2462
  export interface VerifyPasswordResetRequest {
2507
2463
  /**
2508
- * @generated from protobuf field: string session_id = 1
2464
+ * The reset, from the emailed link (the page decodes the URL's text form).
2465
+ *
2466
+ * @generated from protobuf field: sid.v1.ids.ResetSessionId reset_session_id = 3
2509
2467
  */
2510
- sessionId: string;
2468
+ resetSessionId?: ResetSessionId;
2511
2469
  /**
2470
+ * Secret token from the emailed link. Single-use, server-validated.
2471
+ *
2512
2472
  * @generated from protobuf field: string token = 2
2513
2473
  */
2514
2474
  token: string;
2515
2475
  }
2516
2476
  /**
2477
+ * The verified reset. Its later steps name it by the operation in `history`,
2478
+ * which carries the reset's authority.
2479
+ *
2517
2480
  * @generated from protobuf message sid.v1.authn.VerifyPasswordResetResponse
2518
2481
  */
2519
2482
  export interface VerifyPasswordResetResponse {
2520
- /**
2521
- * @generated from protobuf field: string reset_session_id = 1
2522
- */
2523
- resetSessionId: string;
2524
2483
  /**
2525
2484
  * @generated from protobuf field: int32 expires_in = 2
2526
2485
  */
@@ -2570,11 +2529,8 @@ export interface ExecutePasswordResetResponse {
2570
2529
  */
2571
2530
  export interface CompletePasswordResetRequest {
2572
2531
  /**
2573
- * @generated from protobuf field: string reset_session_id = 1
2574
- */
2575
- resetSessionId: string;
2576
- /**
2577
- * The reset operation (from VerifyPasswordResetResponse.history).
2532
+ * The reset operation (from VerifyPasswordResetResponse.history). Carries
2533
+ * the verified reset session's authority, as in ExecutePasswordReset.
2578
2534
  *
2579
2535
  * @generated from protobuf field: sid.v1.ids.PasswordOperationId operation_id = 7
2580
2536
  */
@@ -2607,9 +2563,9 @@ export interface CompletePasswordResetResponse {
2607
2563
  /**
2608
2564
  * The session the reset signed in; absent when it signed in none.
2609
2565
  *
2610
- * @generated from protobuf field: optional string session_id = 1
2566
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 4
2611
2567
  */
2612
- sessionId?: string;
2568
+ sessionId?: SessionId;
2613
2569
  /**
2614
2570
  * Seconds until the delivered credential expires; absent with session_id.
2615
2571
  *
@@ -2617,6 +2573,33 @@ export interface CompletePasswordResetResponse {
2617
2573
  */
2618
2574
  expiresIn?: number;
2619
2575
  }
2576
+ /**
2577
+ * The HMAC of a TOTP (RFC 6238 §1.2).
2578
+ *
2579
+ * @generated from protobuf enum sid.v1.authn.TotpAlgorithm
2580
+ */
2581
+ export declare enum TotpAlgorithm {
2582
+ /**
2583
+ * Never sent; a client receiving it cannot enroll.
2584
+ *
2585
+ * @generated from protobuf enum value: TOTP_ALGORITHM_UNSPECIFIED = 0;
2586
+ */
2587
+ UNSPECIFIED = 0,
2588
+ /**
2589
+ * HMAC-SHA-1, what authenticator apps support universally.
2590
+ *
2591
+ * @generated from protobuf enum value: TOTP_ALGORITHM_SHA1 = 1;
2592
+ */
2593
+ SHA1 = 1,
2594
+ /**
2595
+ * @generated from protobuf enum value: TOTP_ALGORITHM_SHA256 = 2;
2596
+ */
2597
+ SHA256 = 2,
2598
+ /**
2599
+ * @generated from protobuf enum value: TOTP_ALGORITHM_SHA512 = 3;
2600
+ */
2601
+ SHA512 = 3
2602
+ }
2620
2603
  /**
2621
2604
  * Field type of a dynamic prompt field.
2622
2605
  *
@@ -2693,46 +2676,6 @@ export declare enum StepUpMethod {
2693
2676
  */
2694
2677
  RECOVERY_CODE = 3
2695
2678
  }
2696
- declare class OpaqueRegistrationStartRequest$Type extends MessageType<OpaqueRegistrationStartRequest> {
2697
- constructor();
2698
- create(value?: PartialMessage<OpaqueRegistrationStartRequest>): OpaqueRegistrationStartRequest;
2699
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpaqueRegistrationStartRequest): OpaqueRegistrationStartRequest;
2700
- internalBinaryWrite(message: OpaqueRegistrationStartRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
2701
- }
2702
- /**
2703
- * @generated MessageType for protobuf message sid.v1.authn.OpaqueRegistrationStartRequest
2704
- */
2705
- export declare const OpaqueRegistrationStartRequest: OpaqueRegistrationStartRequest$Type;
2706
- declare class OpaqueRegistrationStartResponse$Type extends MessageType<OpaqueRegistrationStartResponse> {
2707
- constructor();
2708
- create(value?: PartialMessage<OpaqueRegistrationStartResponse>): OpaqueRegistrationStartResponse;
2709
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpaqueRegistrationStartResponse): OpaqueRegistrationStartResponse;
2710
- internalBinaryWrite(message: OpaqueRegistrationStartResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
2711
- }
2712
- /**
2713
- * @generated MessageType for protobuf message sid.v1.authn.OpaqueRegistrationStartResponse
2714
- */
2715
- export declare const OpaqueRegistrationStartResponse: OpaqueRegistrationStartResponse$Type;
2716
- declare class OpaqueRegistrationFinishRequest$Type extends MessageType<OpaqueRegistrationFinishRequest> {
2717
- constructor();
2718
- create(value?: PartialMessage<OpaqueRegistrationFinishRequest>): OpaqueRegistrationFinishRequest;
2719
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpaqueRegistrationFinishRequest): OpaqueRegistrationFinishRequest;
2720
- internalBinaryWrite(message: OpaqueRegistrationFinishRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
2721
- }
2722
- /**
2723
- * @generated MessageType for protobuf message sid.v1.authn.OpaqueRegistrationFinishRequest
2724
- */
2725
- export declare const OpaqueRegistrationFinishRequest: OpaqueRegistrationFinishRequest$Type;
2726
- declare class OpaqueRegistrationFinishResponse$Type extends MessageType<OpaqueRegistrationFinishResponse> {
2727
- constructor();
2728
- create(value?: PartialMessage<OpaqueRegistrationFinishResponse>): OpaqueRegistrationFinishResponse;
2729
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpaqueRegistrationFinishResponse): OpaqueRegistrationFinishResponse;
2730
- internalBinaryWrite(message: OpaqueRegistrationFinishResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
2731
- }
2732
- /**
2733
- * @generated MessageType for protobuf message sid.v1.authn.OpaqueRegistrationFinishResponse
2734
- */
2735
- export declare const OpaqueRegistrationFinishResponse: OpaqueRegistrationFinishResponse$Type;
2736
2679
  declare class OpaqueLoginStartRequest$Type extends MessageType<OpaqueLoginStartRequest> {
2737
2680
  constructor();
2738
2681
  create(value?: PartialMessage<OpaqueLoginStartRequest>): OpaqueLoginStartRequest;