@structured-id/proto 0.10.0 → 0.12.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,10 +5,17 @@ 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";
18
+ import { SessionId } from "../ids/ids.js";
12
19
  import { OpaqueLoginId } from "../ids/ids.js";
13
20
  /**
14
21
  * @generated from protobuf message sid.v1.authn.OpaqueLoginStartRequest
@@ -104,12 +111,12 @@ export interface OpaqueLoginFinishRequest {
104
111
  */
105
112
  export interface OpaqueLoginFinishResponse {
106
113
  /**
107
- * Server-assigned session identifier (UUIDv7). Used for session management
108
- * (revoke, step-up target). Not a credential.
114
+ * The session this sign-in opened, for session management (listing,
115
+ * revocation). Not a credential.
109
116
  *
110
- * @generated from protobuf field: string session_id = 1
117
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
111
118
  */
112
- sessionId: string;
119
+ sessionId?: SessionId;
113
120
  /**
114
121
  * Seconds until the delivered credential expires: the access token for a
115
122
  * native client (default 900), the session cookie for a browser.
@@ -243,24 +250,24 @@ export interface OpaqueZkppRegistrationFinishRequest {
243
250
  */
244
251
  export interface OpaqueZkppRegistrationFinishResponse {
245
252
  /**
246
- * UUID of the OPAQUE-ZKPP credential stored on server.
253
+ * The password credential the registration stored.
247
254
  *
248
- * @generated from protobuf field: string credential_id = 2
255
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 3
249
256
  */
250
- credentialId: string;
257
+ credentialId?: CredentialId;
251
258
  }
252
259
  /**
253
260
  * @generated from protobuf message sid.v1.authn.PasswordChangeChallengeRequest
254
261
  */
255
262
  export interface PasswordChangeChallengeRequest {
256
263
  /**
257
- * Which OPAQUE credential to change. Client obtains this from
258
- * ListCredentials filtered by type=OPAQUE. Profile resolved from Bearer
259
- * 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.
260
267
  *
261
- * @generated from protobuf field: string credential_id = 1
268
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 4
262
269
  */
263
- credentialId: string;
270
+ credentialId?: CredentialId;
264
271
  /**
265
272
  * OPAQUE CredentialRequest (KE1) of a sign-in with the current password,
266
273
  * made by the client as for OpaqueLoginStart (RFC 9807 §6), in the
@@ -317,9 +324,9 @@ export interface PasswordChangeExecuteRequest {
317
324
  /**
318
325
  * Target OPAQUE credential (same as in ChallengeRequest).
319
326
  *
320
- * @generated from protobuf field: string credential_id = 1
327
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 11
321
328
  */
322
- credentialId: string;
329
+ credentialId?: CredentialId;
323
330
  /**
324
331
  * OPAQUE CredentialFinalization (KE3) of the current-password sign-in begun
325
332
  * in the challenge (RFC 9807 §6), under the change context. Required when
@@ -354,9 +361,9 @@ export interface PasswordChangeFinishRequest {
354
361
  /**
355
362
  * Target OPAQUE credential (same as in Challenge/Execute).
356
363
  *
357
- * @generated from protobuf field: string credential_id = 1
364
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 6
358
365
  */
359
- credentialId: string;
366
+ credentialId?: CredentialId;
360
367
  /**
361
368
  * Final OPAQUE RegistrationRecord computed by client from RegistrationResponse.
362
369
  * Contains the encrypted password envelope that the server stores.
@@ -429,11 +436,12 @@ export interface WebAuthnRegistrationFinishRequest {
429
436
  */
430
437
  export interface WebAuthnRegistrationFinishResponse {
431
438
  /**
432
- * 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.
433
441
  *
434
- * @generated from protobuf field: string credential_id = 1
442
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 2
435
443
  */
436
- credentialId: string;
444
+ credentialId?: CredentialId;
437
445
  }
438
446
  /**
439
447
  * @generated from protobuf message sid.v1.authn.WebAuthnAuthenticationStartRequest
@@ -467,14 +475,6 @@ export interface WebAuthnAuthenticationStartResponse {
467
475
  * @generated from protobuf field: bytes options = 2
468
476
  */
469
477
  options: Uint8Array;
470
- /**
471
- * Opaque state key for challenge lookup in Finish. Client echoes back.
472
- * Required for conditional UI (no principal to re-resolve).
473
- * Optional for principal-first (server can re-resolve, but state_key is faster).
474
- *
475
- * @generated from protobuf field: string state_key = 3
476
- */
477
- stateKey: string;
478
478
  }
479
479
  /**
480
480
  * @generated from protobuf message sid.v1.authn.WebAuthnAuthenticationFinishRequest
@@ -494,18 +494,11 @@ export interface WebAuthnAuthenticationFinishRequest {
494
494
  * @generated from protobuf field: bytes credential = 2
495
495
  */
496
496
  credential: Uint8Array;
497
- /**
498
- * Echoed from WebAuthnAuthenticationStartResponse.state_key.
499
- * Required for conditional UI. Optional for principal-first (backward compat).
500
- *
501
- * @generated from protobuf field: optional string state_key = 3
502
- */
503
- stateKey?: string;
504
497
  }
505
498
  /**
506
499
  * The session a passkey sign-in completed; its credential is delivered as for
507
500
  * OpaqueLoginFinishResponse. A native renewable session is asked for as
508
- * there, with `sid_cer` over the `state_key` of the
501
+ * there, with `sid_cer` over the `challenge` of the
509
502
  * WebAuthnAuthenticationStartResponse the assertion answers: the server
510
503
  * takes it from the assertion's own challenge, not from this request.
511
504
  *
@@ -513,11 +506,11 @@ export interface WebAuthnAuthenticationFinishRequest {
513
506
  */
514
507
  export interface WebAuthnAuthenticationFinishResponse {
515
508
  /**
516
- * Server-assigned session ID (same semantics as OpaqueLoginFinishResponse).
509
+ * Same semantics as OpaqueLoginFinishResponse.session_id.
517
510
  *
518
- * @generated from protobuf field: string session_id = 1
511
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
519
512
  */
520
- sessionId: string;
513
+ sessionId?: SessionId;
521
514
  /**
522
515
  * Seconds until the delivered credential expires.
523
516
  *
@@ -1129,11 +1122,11 @@ export interface OAuth2RevokeResponse {
1129
1122
  */
1130
1123
  export interface ValidateSessionRequest {
1131
1124
  /**
1132
- * 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.
1133
1126
  *
1134
- * @generated from protobuf field: string session_id = 1
1127
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 2
1135
1128
  */
1136
- sessionId: string;
1129
+ sessionId?: SessionId;
1137
1130
  }
1138
1131
  /**
1139
1132
  * @generated from protobuf message sid.v1.authn.ValidateSessionResponse
@@ -1339,11 +1332,11 @@ export interface RequestMagicLinkRequest {
1339
1332
  */
1340
1333
  export interface RequestMagicLinkResponse {
1341
1334
  /**
1342
- * 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.
1343
1336
  *
1344
- * @generated from protobuf field: string session_id = 1
1337
+ * @generated from protobuf field: sid.v1.ids.MagicLinkId magic_link_id = 3
1345
1338
  */
1346
- sessionId: string;
1339
+ magicLinkId?: MagicLinkId;
1347
1340
  /**
1348
1341
  * Magic link validity in seconds (default 600 = 10 min).
1349
1342
  *
@@ -1356,11 +1349,11 @@ export interface RequestMagicLinkResponse {
1356
1349
  */
1357
1350
  export interface VerifyMagicLinkRequest {
1358
1351
  /**
1359
- * Session ID from the magic link URL query parameter.
1352
+ * The magic link, from its URL (the page decodes the URL's text form).
1360
1353
  *
1361
- * @generated from protobuf field: string session_id = 1
1354
+ * @generated from protobuf field: sid.v1.ids.MagicLinkId magic_link_id = 3
1362
1355
  */
1363
- sessionId: string;
1356
+ magicLinkId?: MagicLinkId;
1364
1357
  /**
1365
1358
  * Cryptographic token from the magic link URL. Single-use, server-validated.
1366
1359
  *
@@ -1376,11 +1369,11 @@ export interface VerifyMagicLinkRequest {
1376
1369
  */
1377
1370
  export interface VerifyMagicLinkResponse {
1378
1371
  /**
1379
- * New session ID (different from magic link session — this is the auth session).
1372
+ * The session the link opened (not the magic link itself).
1380
1373
  *
1381
- * @generated from protobuf field: string session_id = 1
1374
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 4
1382
1375
  */
1383
- sessionId: string;
1376
+ sessionId?: SessionId;
1384
1377
  /**
1385
1378
  * Seconds until the delivered credential expires.
1386
1379
  *
@@ -1450,12 +1443,12 @@ export interface LegacyMigrateStartRequest {
1450
1443
  */
1451
1444
  export interface LegacyMigrateStartResponse {
1452
1445
  /**
1453
- * Opaque server-side migration state token. 5-minute TTL.
1454
- * 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.
1455
1448
  *
1456
- * @generated from protobuf field: string migration_token = 1
1449
+ * @generated from protobuf field: sid.v1.ids.ImportedPasswordUpgradeId upgrade_id = 3
1457
1450
  */
1458
- migrationToken: string;
1451
+ upgradeId?: ImportedPasswordUpgradeId;
1459
1452
  /**
1460
1453
  * OPAQUE RegistrationResponse for client to compute registration record.
1461
1454
  *
@@ -1468,11 +1461,11 @@ export interface LegacyMigrateStartResponse {
1468
1461
  */
1469
1462
  export interface LegacyMigrateFinishRequest {
1470
1463
  /**
1471
- * Echoed from LegacyMigrateStartResponse.migration_token.
1464
+ * From LegacyMigrateStartResponse.upgrade_id.
1472
1465
  *
1473
- * @generated from protobuf field: string migration_token = 1
1466
+ * @generated from protobuf field: sid.v1.ids.ImportedPasswordUpgradeId upgrade_id = 3
1474
1467
  */
1475
- migrationToken: string;
1468
+ upgradeId?: ImportedPasswordUpgradeId;
1476
1469
  /**
1477
1470
  * OPAQUE RegistrationRecord computed by client. Server stores as new credential,
1478
1471
  * deletes legacy hash. Migration complete.
@@ -1489,11 +1482,11 @@ export interface LegacyMigrateFinishRequest {
1489
1482
  */
1490
1483
  export interface LegacyMigrateFinishResponse {
1491
1484
  /**
1492
- * Session ID (same semantics as OpaqueLoginFinishResponse).
1485
+ * Same semantics as OpaqueLoginFinishResponse.session_id.
1493
1486
  *
1494
- * @generated from protobuf field: string session_id = 1
1487
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
1495
1488
  */
1496
- sessionId: string;
1489
+ sessionId?: SessionId;
1497
1490
  /**
1498
1491
  * Seconds until the delivered credential expires.
1499
1492
  *
@@ -1571,11 +1564,12 @@ export interface GetZkppPolicyResponse {
1571
1564
  */
1572
1565
  export interface SubmitDeferredZkProofRequest {
1573
1566
  /**
1574
- * 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.
1575
1569
  *
1576
- * @generated from protobuf field: string credential_id = 1
1570
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 5
1577
1571
  */
1578
- credentialId: string;
1572
+ credentialId?: CredentialId;
1579
1573
  /**
1580
1574
  * Halo2 password-policy proof over the credential's OPAQUE blinded element.
1581
1575
  *
@@ -1680,11 +1674,11 @@ export interface FinishTotpEnrollmentRequest {
1680
1674
  */
1681
1675
  export interface FinishTotpEnrollmentResponse {
1682
1676
  /**
1683
- * UUID of the newly created TOTP credential.
1677
+ * The TOTP credential the enrollment stored.
1684
1678
  *
1685
- * @generated from protobuf field: string credential_id = 1
1679
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 3
1686
1680
  */
1687
- credentialId: string;
1681
+ credentialId?: CredentialId;
1688
1682
  /**
1689
1683
  * 12 single-use recovery codes. Generated only if this is the user's
1690
1684
  * first MFA factor (no existing TOTP, WebAuthn, or recovery codes).
@@ -1726,12 +1720,12 @@ export interface MfaVerifyResponse {
1726
1720
  */
1727
1721
  verified: boolean;
1728
1722
  /**
1729
- * New session ID after MFA elevation (session refreshed with amr updated).
1730
- * 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.
1731
1725
  *
1732
- * @generated from protobuf field: optional string session_id = 2
1726
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 7
1733
1727
  */
1734
- sessionId?: string;
1728
+ sessionId?: SessionId;
1735
1729
  /**
1736
1730
  * Seconds until the delivered credential expires; set when one was
1737
1731
  * delivered.
@@ -1818,9 +1812,11 @@ export interface RequestOtpRequest {
1818
1812
  */
1819
1813
  export interface RequestOtpResponse {
1820
1814
  /**
1821
- * @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
1822
1818
  */
1823
- otpSessionId: string;
1819
+ otpSessionId?: OtpSessionId;
1824
1820
  /**
1825
1821
  * @generated from protobuf field: string masked_target = 2
1826
1822
  */
@@ -1843,9 +1839,11 @@ export interface VerifyOtpRequest {
1843
1839
  */
1844
1840
  code: string;
1845
1841
  /**
1846
- * @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
1847
1845
  */
1848
- sessionId?: string;
1846
+ otpSessionId?: OtpSessionId;
1849
1847
  }
1850
1848
  /**
1851
1849
  * @generated from protobuf message sid.v1.authn.VerifyOtpResponse
@@ -1864,9 +1862,9 @@ export interface VerifyOtpResponse {
1864
1862
  * Mailbox possession grants provisional scopes only: it cannot add or
1865
1863
  * change a credential of an existing account.
1866
1864
  *
1867
- * @generated from protobuf field: optional string session_id = 3
1865
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 6
1868
1866
  */
1869
- sessionId?: string;
1867
+ sessionId?: SessionId;
1870
1868
  /**
1871
1869
  * Seconds until the delivered credential expires; set when verified.
1872
1870
  *
@@ -1879,9 +1877,11 @@ export interface VerifyOtpResponse {
1879
1877
  */
1880
1878
  export interface ResendOtpRequest {
1881
1879
  /**
1882
- * @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
1883
1883
  */
1884
- sessionId?: string;
1884
+ otpSessionId?: OtpSessionId;
1885
1885
  }
1886
1886
  /**
1887
1887
  * @generated from protobuf message sid.v1.authn.ResendOtpResponse
@@ -2263,14 +2263,11 @@ export interface SubmitDynamicPromptResponse {
2263
2263
  }
2264
2264
  /**
2265
2265
  * Phase 1: Request challenge (WebAuthn). Skipped for TOTP/recovery.
2266
+ * The session stepped up is the bearer token's own, never named here.
2266
2267
  *
2267
2268
  * @generated from protobuf message sid.v1.authn.RequestStepUpRequest
2268
2269
  */
2269
2270
  export interface RequestStepUpRequest {
2270
- /**
2271
- * @generated from protobuf field: string session_id = 1
2272
- */
2273
- sessionId: string;
2274
2271
  /**
2275
2272
  * @generated from protobuf field: sid.v1.authn.StepUpMethod method = 2
2276
2273
  */
@@ -2287,9 +2284,12 @@ export interface StepUpChallenge {
2287
2284
  */
2288
2285
  method: StepUpMethod;
2289
2286
  /**
2290
- * @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
2291
2291
  */
2292
- challengeId: string;
2292
+ challengeId?: StepUpChallengeId;
2293
2293
  /**
2294
2294
  * @generated from protobuf oneof: challenge
2295
2295
  */
@@ -2319,22 +2319,21 @@ export interface StepUpChallenge {
2319
2319
  }
2320
2320
  /**
2321
2321
  * Phase 2: Submit proof → elevate session.
2322
+ * The session stepped up is the bearer token's own, never named here.
2322
2323
  *
2323
2324
  * @generated from protobuf message sid.v1.authn.CompleteStepUpRequest
2324
2325
  */
2325
2326
  export interface CompleteStepUpRequest {
2326
- /**
2327
- * @generated from protobuf field: string session_id = 1
2328
- */
2329
- sessionId: string;
2330
2327
  /**
2331
2328
  * @generated from protobuf field: sid.v1.authn.StepUpMethod method = 2
2332
2329
  */
2333
2330
  method: StepUpMethod;
2334
2331
  /**
2335
- * @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
2336
2335
  */
2337
- challengeId: string;
2336
+ challengeId?: StepUpChallengeId;
2338
2337
  /**
2339
2338
  * @generated from protobuf oneof: proof
2340
2339
  */
@@ -2386,9 +2385,11 @@ export interface CompleteStepUpResponse {
2386
2385
  */
2387
2386
  export interface DeleteMfaCredentialRequest {
2388
2387
  /**
2389
- * @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
2390
2391
  */
2391
- credentialId: string;
2392
+ credentialId?: CredentialId;
2392
2393
  }
2393
2394
  /**
2394
2395
  * @generated from protobuf message sid.v1.authn.DeleteMfaCredentialResponse
@@ -2460,22 +2461,25 @@ export interface RequestPasswordResetResponse {
2460
2461
  */
2461
2462
  export interface VerifyPasswordResetRequest {
2462
2463
  /**
2463
- * @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
2464
2467
  */
2465
- sessionId: string;
2468
+ resetSessionId?: ResetSessionId;
2466
2469
  /**
2470
+ * Secret token from the emailed link. Single-use, server-validated.
2471
+ *
2467
2472
  * @generated from protobuf field: string token = 2
2468
2473
  */
2469
2474
  token: string;
2470
2475
  }
2471
2476
  /**
2477
+ * The verified reset. Its later steps name it by the operation in `history`,
2478
+ * which carries the reset's authority.
2479
+ *
2472
2480
  * @generated from protobuf message sid.v1.authn.VerifyPasswordResetResponse
2473
2481
  */
2474
2482
  export interface VerifyPasswordResetResponse {
2475
- /**
2476
- * @generated from protobuf field: string reset_session_id = 1
2477
- */
2478
- resetSessionId: string;
2479
2483
  /**
2480
2484
  * @generated from protobuf field: int32 expires_in = 2
2481
2485
  */
@@ -2525,11 +2529,8 @@ export interface ExecutePasswordResetResponse {
2525
2529
  */
2526
2530
  export interface CompletePasswordResetRequest {
2527
2531
  /**
2528
- * @generated from protobuf field: string reset_session_id = 1
2529
- */
2530
- resetSessionId: string;
2531
- /**
2532
- * The reset operation (from VerifyPasswordResetResponse.history).
2532
+ * The reset operation (from VerifyPasswordResetResponse.history). Carries
2533
+ * the verified reset session's authority, as in ExecutePasswordReset.
2533
2534
  *
2534
2535
  * @generated from protobuf field: sid.v1.ids.PasswordOperationId operation_id = 7
2535
2536
  */
@@ -2562,9 +2563,9 @@ export interface CompletePasswordResetResponse {
2562
2563
  /**
2563
2564
  * The session the reset signed in; absent when it signed in none.
2564
2565
  *
2565
- * @generated from protobuf field: optional string session_id = 1
2566
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 4
2566
2567
  */
2567
- sessionId?: string;
2568
+ sessionId?: SessionId;
2568
2569
  /**
2569
2570
  * Seconds until the delivered credential expires; absent with session_id.
2570
2571
  *