@structured-id/proto 0.15.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/generated/sid/v1/admin/admin.d.ts +48 -17
  3. package/dist/generated/sid/v1/admin/admin.js +55 -62
  4. package/dist/generated/sid/v1/admin/admin.js.map +1 -1
  5. package/dist/generated/sid/v1/admin/branding.d.ts +54 -26
  6. package/dist/generated/sid/v1/admin/branding.js +87 -98
  7. package/dist/generated/sid/v1/admin/branding.js.map +1 -1
  8. package/dist/generated/sid/v1/admin/enrollment.d.ts +63 -44
  9. package/dist/generated/sid/v1/admin/enrollment.js +109 -107
  10. package/dist/generated/sid/v1/admin/enrollment.js.map +1 -1
  11. package/dist/generated/sid/v1/admin/flow.d.ts +90 -42
  12. package/dist/generated/sid/v1/admin/flow.js +143 -155
  13. package/dist/generated/sid/v1/admin/flow.js.map +1 -1
  14. package/dist/generated/sid/v1/admin/security.d.ts +11 -4
  15. package/dist/generated/sid/v1/admin/security.js +14 -14
  16. package/dist/generated/sid/v1/admin/security.js.map +1 -1
  17. package/dist/generated/sid/v1/admin/sessions.d.ts +18 -8
  18. package/dist/generated/sid/v1/admin/sessions.js +27 -29
  19. package/dist/generated/sid/v1/admin/sessions.js.map +1 -1
  20. package/dist/generated/sid/v1/attestation/attestation.client.d.ts +51 -17
  21. package/dist/generated/sid/v1/attestation/attestation.client.js +50 -12
  22. package/dist/generated/sid/v1/attestation/attestation.client.js.map +1 -1
  23. package/dist/generated/sid/v1/attestation/attestation.d.ts +257 -51
  24. package/dist/generated/sid/v1/attestation/attestation.js +321 -135
  25. package/dist/generated/sid/v1/attestation/attestation.js.map +1 -1
  26. package/dist/generated/sid/v1/authn/auth.d.ts +13 -7
  27. package/dist/generated/sid/v1/authn/auth.js +20 -20
  28. package/dist/generated/sid/v1/authn/auth.js.map +1 -1
  29. package/dist/generated/sid/v1/common/types.d.ts +29 -0
  30. package/dist/generated/sid/v1/common/types.js +47 -0
  31. package/dist/generated/sid/v1/common/types.js.map +1 -1
  32. package/dist/generated/sid/v1/federation/upstream.d.ts +34 -16
  33. package/dist/generated/sid/v1/federation/upstream.js +53 -59
  34. package/dist/generated/sid/v1/federation/upstream.js.map +1 -1
  35. package/dist/generated/sid/v1/ids/ids.d.ts +12 -0
  36. package/dist/generated/sid/v1/ids/ids.js +6 -0
  37. package/dist/generated/sid/v1/ids/ids.js.map +1 -1
  38. package/dist/ip.d.ts +31 -0
  39. package/dist/ip.js +84 -0
  40. package/dist/ip.js.map +1 -0
  41. package/package.json +6 -2
@@ -8,7 +8,12 @@ import { WireType } from "@protobuf-ts/runtime";
8
8
  import { UnknownFieldHandler } from "@protobuf-ts/runtime";
9
9
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
10
10
  import { MessageType } from "@protobuf-ts/runtime";
11
+ import { DeviceEnrollmentId } from "../ids/ids.js";
12
+ import { DeviceType } from "../identity/identity.js";
11
13
  import { Timestamp } from "../../../google/protobuf/timestamp.js";
14
+ import { ProfileId } from "../ids/ids.js";
15
+ import { DeviceId } from "../ids/ids.js";
16
+ import { DeviceAttestationId } from "../ids/ids.js";
12
17
  /**
13
18
  * Attestation format reported by the device.
14
19
  *
@@ -58,7 +63,8 @@ export var AttestationFormat;
58
63
  AttestationFormat[AttestationFormat["FIDO_U2F"] = 6] = "FIDO_U2F";
59
64
  })(AttestationFormat || (AttestationFormat = {}));
60
65
  /**
61
- * Type of hardware key storage on the device.
66
+ * Type of hardware key storage the device reports. Self-asserted: it raises
67
+ * no assurance unless verified attestation establishes it.
62
68
  *
63
69
  * @generated from protobuf enum sid.v1.attestation.KeyStorageType
64
70
  */
@@ -141,35 +147,57 @@ export var AttestationStatus;
141
147
  */
142
148
  AttestationStatus[AttestationStatus["REVOKED"] = 5] = "REVOKED";
143
149
  })(AttestationStatus || (AttestationStatus = {}));
150
+ /**
151
+ * What a device-key enrollment ceremony does. A proof made for one purpose
152
+ * is refused for the other.
153
+ *
154
+ * @generated from protobuf enum sid.v1.attestation.DeviceEnrollmentPurpose
155
+ */
156
+ export var DeviceEnrollmentPurpose;
157
+ (function (DeviceEnrollmentPurpose) {
158
+ /**
159
+ * @generated from protobuf enum value: DEVICE_ENROLLMENT_PURPOSE_UNSPECIFIED = 0;
160
+ */
161
+ DeviceEnrollmentPurpose[DeviceEnrollmentPurpose["UNSPECIFIED"] = 0] = "UNSPECIFIED";
162
+ /**
163
+ * Bind the first key of a new device, or of a device that has metadata
164
+ * and no live key.
165
+ *
166
+ * @generated from protobuf enum value: DEVICE_ENROLLMENT_PURPOSE_ENROLL = 1;
167
+ */
168
+ DeviceEnrollmentPurpose[DeviceEnrollmentPurpose["ENROLL"] = 1] = "ENROLL";
169
+ /**
170
+ * Replace the live key of an enrolled device with a new one.
171
+ *
172
+ * @generated from protobuf enum value: DEVICE_ENROLLMENT_PURPOSE_ROTATE = 2;
173
+ */
174
+ DeviceEnrollmentPurpose[DeviceEnrollmentPurpose["ROTATE"] = 2] = "ROTATE";
175
+ })(DeviceEnrollmentPurpose || (DeviceEnrollmentPurpose = {}));
144
176
  // @generated message type with reflection information, may provide speed optimized methods
145
177
  class DeviceAttestation$Type extends MessageType {
146
178
  constructor() {
147
179
  super("sid.v1.attestation.DeviceAttestation", [
148
- { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
149
- { no: 2, name: "device_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
150
- { no: 3, name: "profile_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
180
+ { no: 1, name: "id", kind: "message", T: () => DeviceAttestationId },
181
+ { no: 2, name: "device_id", kind: "message", T: () => DeviceId },
182
+ { no: 3, name: "profile_id", kind: "message", T: () => ProfileId },
151
183
  { no: 4, name: "format", kind: "enum", T: () => ["sid.v1.attestation.AttestationFormat", AttestationFormat, "ATTESTATION_FORMAT_"] },
152
184
  { no: 5, name: "key_storage", kind: "enum", T: () => ["sid.v1.attestation.KeyStorageType", KeyStorageType, "KEY_STORAGE_TYPE_"] },
153
185
  { no: 6, name: "status", kind: "enum", T: () => ["sid.v1.attestation.AttestationStatus", AttestationStatus, "ATTESTATION_STATUS_"] },
154
- { no: 7, name: "device_public_key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
186
+ { no: 7, name: "public_jwk", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
155
187
  { no: 8, name: "attestation_object", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ },
156
188
  { no: 9, name: "attestation_certificate", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ },
157
189
  { no: 10, name: "aaguid", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
158
- { no: 11, name: "credential_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
159
- { no: 12, name: "created_at", kind: "message", T: () => Timestamp },
160
- { no: 13, name: "updated_at", kind: "message", T: () => Timestamp },
161
- { no: 14, name: "revoked_at", kind: "message", T: () => Timestamp }
190
+ { no: 11, name: "created_at", kind: "message", T: () => Timestamp },
191
+ { no: 12, name: "updated_at", kind: "message", T: () => Timestamp },
192
+ { no: 13, name: "revoked_at", kind: "message", T: () => Timestamp }
162
193
  ]);
163
194
  }
164
195
  create(value) {
165
196
  const message = globalThis.Object.create((this.messagePrototype));
166
- message.id = "";
167
- message.deviceId = "";
168
- message.profileId = "";
169
197
  message.format = 0;
170
198
  message.keyStorage = 0;
171
199
  message.status = 0;
172
- message.devicePublicKey = new Uint8Array(0);
200
+ message.publicJwk = "";
173
201
  if (value !== undefined)
174
202
  reflectionMergePartial(this, message, value);
175
203
  return message;
@@ -179,14 +207,14 @@ class DeviceAttestation$Type extends MessageType {
179
207
  while (reader.pos < end) {
180
208
  let [fieldNo, wireType] = reader.tag();
181
209
  switch (fieldNo) {
182
- case /* string id */ 1:
183
- message.id = reader.string();
210
+ case /* sid.v1.ids.DeviceAttestationId id */ 1:
211
+ message.id = DeviceAttestationId.internalBinaryRead(reader, reader.uint32(), options, message.id);
184
212
  break;
185
- case /* string device_id */ 2:
186
- message.deviceId = reader.string();
213
+ case /* sid.v1.ids.DeviceId device_id */ 2:
214
+ message.deviceId = DeviceId.internalBinaryRead(reader, reader.uint32(), options, message.deviceId);
187
215
  break;
188
- case /* string profile_id */ 3:
189
- message.profileId = reader.string();
216
+ case /* sid.v1.ids.ProfileId profile_id */ 3:
217
+ message.profileId = ProfileId.internalBinaryRead(reader, reader.uint32(), options, message.profileId);
190
218
  break;
191
219
  case /* sid.v1.attestation.AttestationFormat format */ 4:
192
220
  message.format = reader.int32();
@@ -197,8 +225,8 @@ class DeviceAttestation$Type extends MessageType {
197
225
  case /* sid.v1.attestation.AttestationStatus status */ 6:
198
226
  message.status = reader.int32();
199
227
  break;
200
- case /* bytes device_public_key */ 7:
201
- message.devicePublicKey = reader.bytes();
228
+ case /* string public_jwk */ 7:
229
+ message.publicJwk = reader.string();
202
230
  break;
203
231
  case /* optional bytes attestation_object */ 8:
204
232
  message.attestationObject = reader.bytes();
@@ -209,16 +237,13 @@ class DeviceAttestation$Type extends MessageType {
209
237
  case /* optional string aaguid */ 10:
210
238
  message.aaguid = reader.string();
211
239
  break;
212
- case /* optional string credential_id */ 11:
213
- message.credentialId = reader.string();
214
- break;
215
- case /* google.protobuf.Timestamp created_at */ 12:
240
+ case /* google.protobuf.Timestamp created_at */ 11:
216
241
  message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
217
242
  break;
218
- case /* google.protobuf.Timestamp updated_at */ 13:
243
+ case /* google.protobuf.Timestamp updated_at */ 12:
219
244
  message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
220
245
  break;
221
- case /* optional google.protobuf.Timestamp revoked_at */ 14:
246
+ case /* optional google.protobuf.Timestamp revoked_at */ 13:
222
247
  message.revokedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.revokedAt);
223
248
  break;
224
249
  default:
@@ -233,15 +258,15 @@ class DeviceAttestation$Type extends MessageType {
233
258
  return message;
234
259
  }
235
260
  internalBinaryWrite(message, writer, options) {
236
- /* string id = 1; */
237
- if (message.id !== "")
238
- writer.tag(1, WireType.LengthDelimited).string(message.id);
239
- /* string device_id = 2; */
240
- if (message.deviceId !== "")
241
- writer.tag(2, WireType.LengthDelimited).string(message.deviceId);
242
- /* string profile_id = 3; */
243
- if (message.profileId !== "")
244
- writer.tag(3, WireType.LengthDelimited).string(message.profileId);
261
+ /* sid.v1.ids.DeviceAttestationId id = 1; */
262
+ if (message.id)
263
+ DeviceAttestationId.internalBinaryWrite(message.id, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
264
+ /* sid.v1.ids.DeviceId device_id = 2; */
265
+ if (message.deviceId)
266
+ DeviceId.internalBinaryWrite(message.deviceId, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
267
+ /* sid.v1.ids.ProfileId profile_id = 3; */
268
+ if (message.profileId)
269
+ ProfileId.internalBinaryWrite(message.profileId, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
245
270
  /* sid.v1.attestation.AttestationFormat format = 4; */
246
271
  if (message.format !== 0)
247
272
  writer.tag(4, WireType.Varint).int32(message.format);
@@ -251,9 +276,9 @@ class DeviceAttestation$Type extends MessageType {
251
276
  /* sid.v1.attestation.AttestationStatus status = 6; */
252
277
  if (message.status !== 0)
253
278
  writer.tag(6, WireType.Varint).int32(message.status);
254
- /* bytes device_public_key = 7; */
255
- if (message.devicePublicKey.length)
256
- writer.tag(7, WireType.LengthDelimited).bytes(message.devicePublicKey);
279
+ /* string public_jwk = 7; */
280
+ if (message.publicJwk !== "")
281
+ writer.tag(7, WireType.LengthDelimited).string(message.publicJwk);
257
282
  /* optional bytes attestation_object = 8; */
258
283
  if (message.attestationObject !== undefined)
259
284
  writer.tag(8, WireType.LengthDelimited).bytes(message.attestationObject);
@@ -263,18 +288,15 @@ class DeviceAttestation$Type extends MessageType {
263
288
  /* optional string aaguid = 10; */
264
289
  if (message.aaguid !== undefined)
265
290
  writer.tag(10, WireType.LengthDelimited).string(message.aaguid);
266
- /* optional string credential_id = 11; */
267
- if (message.credentialId !== undefined)
268
- writer.tag(11, WireType.LengthDelimited).string(message.credentialId);
269
- /* google.protobuf.Timestamp created_at = 12; */
291
+ /* google.protobuf.Timestamp created_at = 11; */
270
292
  if (message.createdAt)
271
- Timestamp.internalBinaryWrite(message.createdAt, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
272
- /* google.protobuf.Timestamp updated_at = 13; */
293
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(11, WireType.LengthDelimited).fork(), options).join();
294
+ /* google.protobuf.Timestamp updated_at = 12; */
273
295
  if (message.updatedAt)
274
- Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(13, WireType.LengthDelimited).fork(), options).join();
275
- /* optional google.protobuf.Timestamp revoked_at = 14; */
296
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
297
+ /* optional google.protobuf.Timestamp revoked_at = 13; */
276
298
  if (message.revokedAt)
277
- Timestamp.internalBinaryWrite(message.revokedAt, writer.tag(14, WireType.LengthDelimited).fork(), options).join();
299
+ Timestamp.internalBinaryWrite(message.revokedAt, writer.tag(13, WireType.LengthDelimited).fork(), options).join();
278
300
  let u = options.writeUnknownFields;
279
301
  if (u !== false)
280
302
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -286,25 +308,167 @@ class DeviceAttestation$Type extends MessageType {
286
308
  */
287
309
  export const DeviceAttestation = new DeviceAttestation$Type();
288
310
  // @generated message type with reflection information, may provide speed optimized methods
289
- class RegisterDeviceKeyRequest$Type extends MessageType {
311
+ class StartDeviceEnrollmentRequest$Type extends MessageType {
312
+ constructor() {
313
+ super("sid.v1.attestation.StartDeviceEnrollmentRequest", [
314
+ { no: 1, name: "purpose", kind: "enum", T: () => ["sid.v1.attestation.DeviceEnrollmentPurpose", DeviceEnrollmentPurpose, "DEVICE_ENROLLMENT_PURPOSE_"] },
315
+ { no: 2, name: "device_id", kind: "message", T: () => DeviceId },
316
+ { no: 3, name: "device_type", kind: "enum", T: () => ["sid.v1.identity.DeviceType", DeviceType, "DEVICE_TYPE_"] },
317
+ { no: 4, name: "os_info", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
318
+ { no: 5, name: "display_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
319
+ ]);
320
+ }
321
+ create(value) {
322
+ const message = globalThis.Object.create((this.messagePrototype));
323
+ message.purpose = 0;
324
+ message.deviceType = 0;
325
+ if (value !== undefined)
326
+ reflectionMergePartial(this, message, value);
327
+ return message;
328
+ }
329
+ internalBinaryRead(reader, length, options, target) {
330
+ let message = target ?? this.create(), end = reader.pos + length;
331
+ while (reader.pos < end) {
332
+ let [fieldNo, wireType] = reader.tag();
333
+ switch (fieldNo) {
334
+ case /* sid.v1.attestation.DeviceEnrollmentPurpose purpose */ 1:
335
+ message.purpose = reader.int32();
336
+ break;
337
+ case /* optional sid.v1.ids.DeviceId device_id */ 2:
338
+ message.deviceId = DeviceId.internalBinaryRead(reader, reader.uint32(), options, message.deviceId);
339
+ break;
340
+ case /* sid.v1.identity.DeviceType device_type */ 3:
341
+ message.deviceType = reader.int32();
342
+ break;
343
+ case /* optional string os_info */ 4:
344
+ message.osInfo = reader.string();
345
+ break;
346
+ case /* optional string display_name */ 5:
347
+ message.displayName = reader.string();
348
+ break;
349
+ default:
350
+ let u = options.readUnknownField;
351
+ if (u === "throw")
352
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
353
+ let d = reader.skip(wireType);
354
+ if (u !== false)
355
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
356
+ }
357
+ }
358
+ return message;
359
+ }
360
+ internalBinaryWrite(message, writer, options) {
361
+ /* sid.v1.attestation.DeviceEnrollmentPurpose purpose = 1; */
362
+ if (message.purpose !== 0)
363
+ writer.tag(1, WireType.Varint).int32(message.purpose);
364
+ /* optional sid.v1.ids.DeviceId device_id = 2; */
365
+ if (message.deviceId)
366
+ DeviceId.internalBinaryWrite(message.deviceId, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
367
+ /* sid.v1.identity.DeviceType device_type = 3; */
368
+ if (message.deviceType !== 0)
369
+ writer.tag(3, WireType.Varint).int32(message.deviceType);
370
+ /* optional string os_info = 4; */
371
+ if (message.osInfo !== undefined)
372
+ writer.tag(4, WireType.LengthDelimited).string(message.osInfo);
373
+ /* optional string display_name = 5; */
374
+ if (message.displayName !== undefined)
375
+ writer.tag(5, WireType.LengthDelimited).string(message.displayName);
376
+ let u = options.writeUnknownFields;
377
+ if (u !== false)
378
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
379
+ return writer;
380
+ }
381
+ }
382
+ /**
383
+ * @generated MessageType for protobuf message sid.v1.attestation.StartDeviceEnrollmentRequest
384
+ */
385
+ export const StartDeviceEnrollmentRequest = new StartDeviceEnrollmentRequest$Type();
386
+ // @generated message type with reflection information, may provide speed optimized methods
387
+ class DeviceEnrollmentChallenge$Type extends MessageType {
388
+ constructor() {
389
+ super("sid.v1.attestation.DeviceEnrollmentChallenge", [
390
+ { no: 1, name: "enrollment_id", kind: "message", T: () => DeviceEnrollmentId },
391
+ { no: 2, name: "device_id", kind: "message", T: () => DeviceId },
392
+ { no: 3, name: "challenge", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
393
+ { no: 4, name: "expires_at", kind: "message", T: () => Timestamp }
394
+ ]);
395
+ }
396
+ create(value) {
397
+ const message = globalThis.Object.create((this.messagePrototype));
398
+ message.challenge = new Uint8Array(0);
399
+ if (value !== undefined)
400
+ reflectionMergePartial(this, message, value);
401
+ return message;
402
+ }
403
+ internalBinaryRead(reader, length, options, target) {
404
+ let message = target ?? this.create(), end = reader.pos + length;
405
+ while (reader.pos < end) {
406
+ let [fieldNo, wireType] = reader.tag();
407
+ switch (fieldNo) {
408
+ case /* sid.v1.ids.DeviceEnrollmentId enrollment_id */ 1:
409
+ message.enrollmentId = DeviceEnrollmentId.internalBinaryRead(reader, reader.uint32(), options, message.enrollmentId);
410
+ break;
411
+ case /* sid.v1.ids.DeviceId device_id */ 2:
412
+ message.deviceId = DeviceId.internalBinaryRead(reader, reader.uint32(), options, message.deviceId);
413
+ break;
414
+ case /* bytes challenge */ 3:
415
+ message.challenge = reader.bytes();
416
+ break;
417
+ case /* google.protobuf.Timestamp expires_at */ 4:
418
+ message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
419
+ break;
420
+ default:
421
+ let u = options.readUnknownField;
422
+ if (u === "throw")
423
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
424
+ let d = reader.skip(wireType);
425
+ if (u !== false)
426
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
427
+ }
428
+ }
429
+ return message;
430
+ }
431
+ internalBinaryWrite(message, writer, options) {
432
+ /* sid.v1.ids.DeviceEnrollmentId enrollment_id = 1; */
433
+ if (message.enrollmentId)
434
+ DeviceEnrollmentId.internalBinaryWrite(message.enrollmentId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
435
+ /* sid.v1.ids.DeviceId device_id = 2; */
436
+ if (message.deviceId)
437
+ DeviceId.internalBinaryWrite(message.deviceId, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
438
+ /* bytes challenge = 3; */
439
+ if (message.challenge.length)
440
+ writer.tag(3, WireType.LengthDelimited).bytes(message.challenge);
441
+ /* google.protobuf.Timestamp expires_at = 4; */
442
+ if (message.expiresAt)
443
+ Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
444
+ let u = options.writeUnknownFields;
445
+ if (u !== false)
446
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
447
+ return writer;
448
+ }
449
+ }
450
+ /**
451
+ * @generated MessageType for protobuf message sid.v1.attestation.DeviceEnrollmentChallenge
452
+ */
453
+ export const DeviceEnrollmentChallenge = new DeviceEnrollmentChallenge$Type();
454
+ // @generated message type with reflection information, may provide speed optimized methods
455
+ class FinishDeviceEnrollmentRequest$Type extends MessageType {
290
456
  constructor() {
291
- super("sid.v1.attestation.RegisterDeviceKeyRequest", [
292
- { no: 1, name: "device_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
293
- { no: 2, name: "format", kind: "enum", T: () => ["sid.v1.attestation.AttestationFormat", AttestationFormat, "ATTESTATION_FORMAT_"] },
294
- { no: 3, name: "key_storage", kind: "enum", T: () => ["sid.v1.attestation.KeyStorageType", KeyStorageType, "KEY_STORAGE_TYPE_"] },
295
- { no: 4, name: "device_public_key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
457
+ super("sid.v1.attestation.FinishDeviceEnrollmentRequest", [
458
+ { no: 1, name: "enrollment_id", kind: "message", T: () => DeviceEnrollmentId },
459
+ { no: 2, name: "proof", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
460
+ { no: 3, name: "format", kind: "enum", T: () => ["sid.v1.attestation.AttestationFormat", AttestationFormat, "ATTESTATION_FORMAT_"] },
461
+ { no: 4, name: "key_storage", kind: "enum", T: () => ["sid.v1.attestation.KeyStorageType", KeyStorageType, "KEY_STORAGE_TYPE_"] },
296
462
  { no: 5, name: "attestation_object", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ },
297
463
  { no: 6, name: "attestation_certificate", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ },
298
- { no: 7, name: "aaguid", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
299
- { no: 8, name: "credential_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
464
+ { no: 7, name: "aaguid", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
300
465
  ]);
301
466
  }
302
467
  create(value) {
303
468
  const message = globalThis.Object.create((this.messagePrototype));
304
- message.deviceId = "";
469
+ message.proof = "";
305
470
  message.format = 0;
306
471
  message.keyStorage = 0;
307
- message.devicePublicKey = new Uint8Array(0);
308
472
  if (value !== undefined)
309
473
  reflectionMergePartial(this, message, value);
310
474
  return message;
@@ -314,18 +478,18 @@ class RegisterDeviceKeyRequest$Type extends MessageType {
314
478
  while (reader.pos < end) {
315
479
  let [fieldNo, wireType] = reader.tag();
316
480
  switch (fieldNo) {
317
- case /* string device_id */ 1:
318
- message.deviceId = reader.string();
481
+ case /* sid.v1.ids.DeviceEnrollmentId enrollment_id */ 1:
482
+ message.enrollmentId = DeviceEnrollmentId.internalBinaryRead(reader, reader.uint32(), options, message.enrollmentId);
319
483
  break;
320
- case /* sid.v1.attestation.AttestationFormat format */ 2:
484
+ case /* string proof */ 2:
485
+ message.proof = reader.string();
486
+ break;
487
+ case /* sid.v1.attestation.AttestationFormat format */ 3:
321
488
  message.format = reader.int32();
322
489
  break;
323
- case /* sid.v1.attestation.KeyStorageType key_storage */ 3:
490
+ case /* sid.v1.attestation.KeyStorageType key_storage */ 4:
324
491
  message.keyStorage = reader.int32();
325
492
  break;
326
- case /* bytes device_public_key */ 4:
327
- message.devicePublicKey = reader.bytes();
328
- break;
329
493
  case /* optional bytes attestation_object */ 5:
330
494
  message.attestationObject = reader.bytes();
331
495
  break;
@@ -335,9 +499,6 @@ class RegisterDeviceKeyRequest$Type extends MessageType {
335
499
  case /* optional string aaguid */ 7:
336
500
  message.aaguid = reader.string();
337
501
  break;
338
- case /* optional string credential_id */ 8:
339
- message.credentialId = reader.string();
340
- break;
341
502
  default:
342
503
  let u = options.readUnknownField;
343
504
  if (u === "throw")
@@ -350,18 +511,18 @@ class RegisterDeviceKeyRequest$Type extends MessageType {
350
511
  return message;
351
512
  }
352
513
  internalBinaryWrite(message, writer, options) {
353
- /* string device_id = 1; */
354
- if (message.deviceId !== "")
355
- writer.tag(1, WireType.LengthDelimited).string(message.deviceId);
356
- /* sid.v1.attestation.AttestationFormat format = 2; */
514
+ /* sid.v1.ids.DeviceEnrollmentId enrollment_id = 1; */
515
+ if (message.enrollmentId)
516
+ DeviceEnrollmentId.internalBinaryWrite(message.enrollmentId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
517
+ /* string proof = 2; */
518
+ if (message.proof !== "")
519
+ writer.tag(2, WireType.LengthDelimited).string(message.proof);
520
+ /* sid.v1.attestation.AttestationFormat format = 3; */
357
521
  if (message.format !== 0)
358
- writer.tag(2, WireType.Varint).int32(message.format);
359
- /* sid.v1.attestation.KeyStorageType key_storage = 3; */
522
+ writer.tag(3, WireType.Varint).int32(message.format);
523
+ /* sid.v1.attestation.KeyStorageType key_storage = 4; */
360
524
  if (message.keyStorage !== 0)
361
- writer.tag(3, WireType.Varint).int32(message.keyStorage);
362
- /* bytes device_public_key = 4; */
363
- if (message.devicePublicKey.length)
364
- writer.tag(4, WireType.LengthDelimited).bytes(message.devicePublicKey);
525
+ writer.tag(4, WireType.Varint).int32(message.keyStorage);
365
526
  /* optional bytes attestation_object = 5; */
366
527
  if (message.attestationObject !== undefined)
367
528
  writer.tag(5, WireType.LengthDelimited).bytes(message.attestationObject);
@@ -371,9 +532,6 @@ class RegisterDeviceKeyRequest$Type extends MessageType {
371
532
  /* optional string aaguid = 7; */
372
533
  if (message.aaguid !== undefined)
373
534
  writer.tag(7, WireType.LengthDelimited).string(message.aaguid);
374
- /* optional string credential_id = 8; */
375
- if (message.credentialId !== undefined)
376
- writer.tag(8, WireType.LengthDelimited).string(message.credentialId);
377
535
  let u = options.writeUnknownFields;
378
536
  if (u !== false)
379
537
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -381,19 +539,18 @@ class RegisterDeviceKeyRequest$Type extends MessageType {
381
539
  }
382
540
  }
383
541
  /**
384
- * @generated MessageType for protobuf message sid.v1.attestation.RegisterDeviceKeyRequest
542
+ * @generated MessageType for protobuf message sid.v1.attestation.FinishDeviceEnrollmentRequest
385
543
  */
386
- export const RegisterDeviceKeyRequest = new RegisterDeviceKeyRequest$Type();
544
+ export const FinishDeviceEnrollmentRequest = new FinishDeviceEnrollmentRequest$Type();
387
545
  // @generated message type with reflection information, may provide speed optimized methods
388
546
  class GetDeviceAttestationRequest$Type extends MessageType {
389
547
  constructor() {
390
548
  super("sid.v1.attestation.GetDeviceAttestationRequest", [
391
- { no: 1, name: "device_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
549
+ { no: 1, name: "device_id", kind: "message", T: () => DeviceId }
392
550
  ]);
393
551
  }
394
552
  create(value) {
395
553
  const message = globalThis.Object.create((this.messagePrototype));
396
- message.deviceId = "";
397
554
  if (value !== undefined)
398
555
  reflectionMergePartial(this, message, value);
399
556
  return message;
@@ -403,8 +560,8 @@ class GetDeviceAttestationRequest$Type extends MessageType {
403
560
  while (reader.pos < end) {
404
561
  let [fieldNo, wireType] = reader.tag();
405
562
  switch (fieldNo) {
406
- case /* string device_id */ 1:
407
- message.deviceId = reader.string();
563
+ case /* sid.v1.ids.DeviceId device_id */ 1:
564
+ message.deviceId = DeviceId.internalBinaryRead(reader, reader.uint32(), options, message.deviceId);
408
565
  break;
409
566
  default:
410
567
  let u = options.readUnknownField;
@@ -418,9 +575,9 @@ class GetDeviceAttestationRequest$Type extends MessageType {
418
575
  return message;
419
576
  }
420
577
  internalBinaryWrite(message, writer, options) {
421
- /* string device_id = 1; */
422
- if (message.deviceId !== "")
423
- writer.tag(1, WireType.LengthDelimited).string(message.deviceId);
578
+ /* sid.v1.ids.DeviceId device_id = 1; */
579
+ if (message.deviceId)
580
+ DeviceId.internalBinaryWrite(message.deviceId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
424
581
  let u = options.writeUnknownFields;
425
582
  if (u !== false)
426
583
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -435,16 +592,22 @@ export const GetDeviceAttestationRequest = new GetDeviceAttestationRequest$Type(
435
592
  class RotateDeviceKeyRequest$Type extends MessageType {
436
593
  constructor() {
437
594
  super("sid.v1.attestation.RotateDeviceKeyRequest", [
438
- { no: 1, name: "device_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
439
- { no: 2, name: "new_device_public_key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
440
- { no: 3, name: "new_attestation_object", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ },
441
- { no: 4, name: "new_attestation_certificate", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }
595
+ { no: 1, name: "enrollment_id", kind: "message", T: () => DeviceEnrollmentId },
596
+ { no: 2, name: "new_key_proof", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
597
+ { no: 3, name: "current_key_proof", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
598
+ { no: 4, name: "format", kind: "enum", T: () => ["sid.v1.attestation.AttestationFormat", AttestationFormat, "ATTESTATION_FORMAT_"] },
599
+ { no: 5, name: "key_storage", kind: "enum", T: () => ["sid.v1.attestation.KeyStorageType", KeyStorageType, "KEY_STORAGE_TYPE_"] },
600
+ { no: 6, name: "attestation_object", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ },
601
+ { no: 7, name: "attestation_certificate", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ },
602
+ { no: 8, name: "aaguid", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
442
603
  ]);
443
604
  }
444
605
  create(value) {
445
606
  const message = globalThis.Object.create((this.messagePrototype));
446
- message.deviceId = "";
447
- message.newDevicePublicKey = new Uint8Array(0);
607
+ message.newKeyProof = "";
608
+ message.currentKeyProof = "";
609
+ message.format = 0;
610
+ message.keyStorage = 0;
448
611
  if (value !== undefined)
449
612
  reflectionMergePartial(this, message, value);
450
613
  return message;
@@ -454,17 +617,29 @@ class RotateDeviceKeyRequest$Type extends MessageType {
454
617
  while (reader.pos < end) {
455
618
  let [fieldNo, wireType] = reader.tag();
456
619
  switch (fieldNo) {
457
- case /* string device_id */ 1:
458
- message.deviceId = reader.string();
620
+ case /* sid.v1.ids.DeviceEnrollmentId enrollment_id */ 1:
621
+ message.enrollmentId = DeviceEnrollmentId.internalBinaryRead(reader, reader.uint32(), options, message.enrollmentId);
459
622
  break;
460
- case /* bytes new_device_public_key */ 2:
461
- message.newDevicePublicKey = reader.bytes();
623
+ case /* string new_key_proof */ 2:
624
+ message.newKeyProof = reader.string();
462
625
  break;
463
- case /* optional bytes new_attestation_object */ 3:
464
- message.newAttestationObject = reader.bytes();
626
+ case /* string current_key_proof */ 3:
627
+ message.currentKeyProof = reader.string();
465
628
  break;
466
- case /* optional bytes new_attestation_certificate */ 4:
467
- message.newAttestationCertificate = reader.bytes();
629
+ case /* sid.v1.attestation.AttestationFormat format */ 4:
630
+ message.format = reader.int32();
631
+ break;
632
+ case /* sid.v1.attestation.KeyStorageType key_storage */ 5:
633
+ message.keyStorage = reader.int32();
634
+ break;
635
+ case /* optional bytes attestation_object */ 6:
636
+ message.attestationObject = reader.bytes();
637
+ break;
638
+ case /* optional bytes attestation_certificate */ 7:
639
+ message.attestationCertificate = reader.bytes();
640
+ break;
641
+ case /* optional string aaguid */ 8:
642
+ message.aaguid = reader.string();
468
643
  break;
469
644
  default:
470
645
  let u = options.readUnknownField;
@@ -478,18 +653,30 @@ class RotateDeviceKeyRequest$Type extends MessageType {
478
653
  return message;
479
654
  }
480
655
  internalBinaryWrite(message, writer, options) {
481
- /* string device_id = 1; */
482
- if (message.deviceId !== "")
483
- writer.tag(1, WireType.LengthDelimited).string(message.deviceId);
484
- /* bytes new_device_public_key = 2; */
485
- if (message.newDevicePublicKey.length)
486
- writer.tag(2, WireType.LengthDelimited).bytes(message.newDevicePublicKey);
487
- /* optional bytes new_attestation_object = 3; */
488
- if (message.newAttestationObject !== undefined)
489
- writer.tag(3, WireType.LengthDelimited).bytes(message.newAttestationObject);
490
- /* optional bytes new_attestation_certificate = 4; */
491
- if (message.newAttestationCertificate !== undefined)
492
- writer.tag(4, WireType.LengthDelimited).bytes(message.newAttestationCertificate);
656
+ /* sid.v1.ids.DeviceEnrollmentId enrollment_id = 1; */
657
+ if (message.enrollmentId)
658
+ DeviceEnrollmentId.internalBinaryWrite(message.enrollmentId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
659
+ /* string new_key_proof = 2; */
660
+ if (message.newKeyProof !== "")
661
+ writer.tag(2, WireType.LengthDelimited).string(message.newKeyProof);
662
+ /* string current_key_proof = 3; */
663
+ if (message.currentKeyProof !== "")
664
+ writer.tag(3, WireType.LengthDelimited).string(message.currentKeyProof);
665
+ /* sid.v1.attestation.AttestationFormat format = 4; */
666
+ if (message.format !== 0)
667
+ writer.tag(4, WireType.Varint).int32(message.format);
668
+ /* sid.v1.attestation.KeyStorageType key_storage = 5; */
669
+ if (message.keyStorage !== 0)
670
+ writer.tag(5, WireType.Varint).int32(message.keyStorage);
671
+ /* optional bytes attestation_object = 6; */
672
+ if (message.attestationObject !== undefined)
673
+ writer.tag(6, WireType.LengthDelimited).bytes(message.attestationObject);
674
+ /* optional bytes attestation_certificate = 7; */
675
+ if (message.attestationCertificate !== undefined)
676
+ writer.tag(7, WireType.LengthDelimited).bytes(message.attestationCertificate);
677
+ /* optional string aaguid = 8; */
678
+ if (message.aaguid !== undefined)
679
+ writer.tag(8, WireType.LengthDelimited).string(message.aaguid);
493
680
  let u = options.writeUnknownFields;
494
681
  if (u !== false)
495
682
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -504,12 +691,11 @@ export const RotateDeviceKeyRequest = new RotateDeviceKeyRequest$Type();
504
691
  class RevokeDeviceKeyRequest$Type extends MessageType {
505
692
  constructor() {
506
693
  super("sid.v1.attestation.RevokeDeviceKeyRequest", [
507
- { no: 1, name: "device_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
694
+ { no: 1, name: "device_id", kind: "message", T: () => DeviceId }
508
695
  ]);
509
696
  }
510
697
  create(value) {
511
698
  const message = globalThis.Object.create((this.messagePrototype));
512
- message.deviceId = "";
513
699
  if (value !== undefined)
514
700
  reflectionMergePartial(this, message, value);
515
701
  return message;
@@ -519,8 +705,8 @@ class RevokeDeviceKeyRequest$Type extends MessageType {
519
705
  while (reader.pos < end) {
520
706
  let [fieldNo, wireType] = reader.tag();
521
707
  switch (fieldNo) {
522
- case /* string device_id */ 1:
523
- message.deviceId = reader.string();
708
+ case /* sid.v1.ids.DeviceId device_id */ 1:
709
+ message.deviceId = DeviceId.internalBinaryRead(reader, reader.uint32(), options, message.deviceId);
524
710
  break;
525
711
  default:
526
712
  let u = options.readUnknownField;
@@ -534,9 +720,9 @@ class RevokeDeviceKeyRequest$Type extends MessageType {
534
720
  return message;
535
721
  }
536
722
  internalBinaryWrite(message, writer, options) {
537
- /* string device_id = 1; */
538
- if (message.deviceId !== "")
539
- writer.tag(1, WireType.LengthDelimited).string(message.deviceId);
723
+ /* sid.v1.ids.DeviceId device_id = 1; */
724
+ if (message.deviceId)
725
+ DeviceId.internalBinaryWrite(message.deviceId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
540
726
  let u = options.writeUnknownFields;
541
727
  if (u !== false)
542
728
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -551,12 +737,11 @@ export const RevokeDeviceKeyRequest = new RevokeDeviceKeyRequest$Type();
551
737
  class ListDeviceAttestationsRequest$Type extends MessageType {
552
738
  constructor() {
553
739
  super("sid.v1.attestation.ListDeviceAttestationsRequest", [
554
- { no: 1, name: "profile_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
740
+ { no: 1, name: "profile_id", kind: "message", T: () => ProfileId }
555
741
  ]);
556
742
  }
557
743
  create(value) {
558
744
  const message = globalThis.Object.create((this.messagePrototype));
559
- message.profileId = "";
560
745
  if (value !== undefined)
561
746
  reflectionMergePartial(this, message, value);
562
747
  return message;
@@ -566,8 +751,8 @@ class ListDeviceAttestationsRequest$Type extends MessageType {
566
751
  while (reader.pos < end) {
567
752
  let [fieldNo, wireType] = reader.tag();
568
753
  switch (fieldNo) {
569
- case /* string profile_id */ 1:
570
- message.profileId = reader.string();
754
+ case /* sid.v1.ids.ProfileId profile_id */ 1:
755
+ message.profileId = ProfileId.internalBinaryRead(reader, reader.uint32(), options, message.profileId);
571
756
  break;
572
757
  default:
573
758
  let u = options.readUnknownField;
@@ -581,9 +766,9 @@ class ListDeviceAttestationsRequest$Type extends MessageType {
581
766
  return message;
582
767
  }
583
768
  internalBinaryWrite(message, writer, options) {
584
- /* string profile_id = 1; */
585
- if (message.profileId !== "")
586
- writer.tag(1, WireType.LengthDelimited).string(message.profileId);
769
+ /* sid.v1.ids.ProfileId profile_id = 1; */
770
+ if (message.profileId)
771
+ ProfileId.internalBinaryWrite(message.profileId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
587
772
  let u = options.writeUnknownFields;
588
773
  if (u !== false)
589
774
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -645,10 +830,11 @@ export const ListDeviceAttestationsResponse = new ListDeviceAttestationsResponse
645
830
  * @generated ServiceType for protobuf service sid.v1.attestation.AttestationService
646
831
  */
647
832
  export const AttestationService = new ServiceType("sid.v1.attestation.AttestationService", [
648
- { name: "RegisterDeviceKey", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/attestation/devices/{device_id}/keys", body: "*" }, "sid.v1.common.retry": { keyed: true } }, I: RegisterDeviceKeyRequest, O: DeviceAttestation },
649
- { name: "GetDeviceAttestation", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/attestation/devices/{device_id}" } }, I: GetDeviceAttestationRequest, O: DeviceAttestation },
650
- { name: "RotateDeviceKey", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/attestation/devices/{device_id}/rotate", body: "*" }, "sid.v1.common.retry": { keyed: true } }, I: RotateDeviceKeyRequest, O: DeviceAttestation },
651
- { name: "RevokeDeviceKey", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/attestation/devices/{device_id}/revoke", body: "*" }, "sid.v1.common.retry": { keyed: true } }, I: RevokeDeviceKeyRequest, O: Empty },
652
- { name: "ListDeviceAttestations", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/attestation/profiles/{profile_id}/devices" } }, I: ListDeviceAttestationsRequest, O: ListDeviceAttestationsResponse }
833
+ { name: "StartDeviceEnrollment", options: { "google.api.http": { post: "/v1/attestation/enrollments", body: "*" } }, I: StartDeviceEnrollmentRequest, O: DeviceEnrollmentChallenge },
834
+ { name: "FinishDeviceEnrollment", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/attestation/enrollments/{enrollment_id.value}/finish", body: "*" }, "sid.v1.common.retry": { keyed: true } }, I: FinishDeviceEnrollmentRequest, O: DeviceAttestation },
835
+ { name: "GetDeviceAttestation", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/attestation/devices/{device_id.value}" } }, I: GetDeviceAttestationRequest, O: DeviceAttestation },
836
+ { name: "RotateDeviceKey", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/attestation/enrollments/{enrollment_id.value}/rotate", body: "*" }, "sid.v1.common.retry": { keyed: true } }, I: RotateDeviceKeyRequest, O: DeviceAttestation },
837
+ { name: "RevokeDeviceKey", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/attestation/devices/{device_id.value}/revoke", body: "*" }, "sid.v1.common.retry": { keyed: true } }, I: RevokeDeviceKeyRequest, O: Empty },
838
+ { name: "ListDeviceAttestations", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/attestation/profiles/{profile_id.value}/devices" } }, I: ListDeviceAttestationsRequest, O: ListDeviceAttestationsResponse }
653
839
  ]);
654
840
  //# sourceMappingURL=attestation.js.map