@structured-id/proto 0.19.0 → 0.20.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.
@@ -0,0 +1,623 @@
1
+ // @generated by protobuf-ts 2.11.1 with parameter client_generic,generate_dependencies,ts_nocheck
2
+ // @generated from protobuf file "sid/v1/authn/auth_flow.proto" (package "sid.v1.authn", syntax proto3)
3
+ // tslint:disable
4
+ // @ts-nocheck
5
+ import { ServiceType } from "@protobuf-ts/runtime-rpc";
6
+ import { WireType } from "@protobuf-ts/runtime";
7
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
8
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
9
+ import { MessageType } from "@protobuf-ts/runtime";
10
+ import { ClaimType } from "../common/claims.js";
11
+ import { ClaimRequestLevel } from "../common/claims.js";
12
+ import { Timestamp } from "../../../google/protobuf/timestamp.js";
13
+ import { AuthorizationOperationId } from "../ids/ids.js";
14
+ /**
15
+ * How a claim is shared with the client.
16
+ *
17
+ * @generated from protobuf enum sid.v1.authn.ClaimSharing
18
+ */
19
+ export var ClaimSharing;
20
+ (function (ClaimSharing) {
21
+ /**
22
+ * @generated from protobuf enum value: CLAIM_SHARING_UNSPECIFIED = 0;
23
+ */
24
+ ClaimSharing[ClaimSharing["UNSPECIFIED"] = 0] = "UNSPECIFIED";
25
+ /**
26
+ * Not shared.
27
+ *
28
+ * @generated from protobuf enum value: CLAIM_SHARING_NONE = 1;
29
+ */
30
+ ClaimSharing[ClaimSharing["NONE"] = 1] = "NONE";
31
+ /**
32
+ * The current value only; a later change is not delivered.
33
+ *
34
+ * @generated from protobuf enum value: CLAIM_SHARING_STATIC = 2;
35
+ */
36
+ ClaimSharing[ClaimSharing["STATIC"] = 2] = "STATIC";
37
+ /**
38
+ * The current value and its later changes, as the client subscribed.
39
+ *
40
+ * @generated from protobuf enum value: CLAIM_SHARING_SUBSCRIBED = 3;
41
+ */
42
+ ClaimSharing[ClaimSharing["SUBSCRIBED"] = 3] = "SUBSCRIBED";
43
+ })(ClaimSharing || (ClaimSharing = {}));
44
+ /**
45
+ * The user's decision on an authorization operation.
46
+ *
47
+ * @generated from protobuf enum sid.v1.authn.ConsentDecision
48
+ */
49
+ export var ConsentDecision;
50
+ (function (ConsentDecision) {
51
+ /**
52
+ * @generated from protobuf enum value: CONSENT_DECISION_UNSPECIFIED = 0;
53
+ */
54
+ ConsentDecision[ConsentDecision["UNSPECIFIED"] = 0] = "UNSPECIFIED";
55
+ /**
56
+ * Grant the reviewed authorization with the given claim choices.
57
+ *
58
+ * @generated from protobuf enum value: CONSENT_DECISION_APPROVE = 1;
59
+ */
60
+ ConsentDecision[ConsentDecision["APPROVE"] = 1] = "APPROVE";
61
+ /**
62
+ * Refuse this authorization request; earlier grants are not affected.
63
+ *
64
+ * @generated from protobuf enum value: CONSENT_DECISION_DENY = 2;
65
+ */
66
+ ConsentDecision[ConsentDecision["DENY"] = 2] = "DENY";
67
+ })(ConsentDecision || (ConsentDecision = {}));
68
+ /**
69
+ * Where an authorization operation stands.
70
+ *
71
+ * @generated from protobuf enum sid.v1.authn.AuthorizationStep
72
+ */
73
+ export var AuthorizationStep;
74
+ (function (AuthorizationStep) {
75
+ /**
76
+ * @generated from protobuf enum value: AUTHORIZATION_STEP_UNSPECIFIED = 0;
77
+ */
78
+ AuthorizationStep[AuthorizationStep["UNSPECIFIED"] = 0] = "UNSPECIFIED";
79
+ /**
80
+ * Waiting for the user's decision.
81
+ *
82
+ * @generated from protobuf enum value: AUTHORIZATION_STEP_AWAITING_CONSENT = 1;
83
+ */
84
+ AuthorizationStep[AuthorizationStep["AWAITING_CONSENT"] = 1] = "AWAITING_CONSENT";
85
+ /**
86
+ * Approved; the issuer issues the code when the browser continues.
87
+ *
88
+ * @generated from protobuf enum value: AUTHORIZATION_STEP_APPROVED = 2;
89
+ */
90
+ AuthorizationStep[AuthorizationStep["APPROVED"] = 2] = "APPROVED";
91
+ /**
92
+ * Denied; the issuer returns `access_denied` when the browser continues.
93
+ *
94
+ * @generated from protobuf enum value: AUTHORIZATION_STEP_DENIED = 3;
95
+ */
96
+ AuthorizationStep[AuthorizationStep["DENIED"] = 3] = "DENIED";
97
+ /**
98
+ * The issuer issued the operation's one code or delivered its denial;
99
+ * nothing more is issued for it.
100
+ *
101
+ * @generated from protobuf enum value: AUTHORIZATION_STEP_COMPLETED = 4;
102
+ */
103
+ AuthorizationStep[AuthorizationStep["COMPLETED"] = 4] = "COMPLETED";
104
+ /**
105
+ * The operation expired or was superseded before completing.
106
+ *
107
+ * @generated from protobuf enum value: AUTHORIZATION_STEP_EXPIRED = 5;
108
+ */
109
+ AuthorizationStep[AuthorizationStep["EXPIRED"] = 5] = "EXPIRED";
110
+ })(AuthorizationStep || (AuthorizationStep = {}));
111
+ // @generated message type with reflection information, may provide speed optimized methods
112
+ class GetConsentRequest$Type extends MessageType {
113
+ constructor() {
114
+ super("sid.v1.authn.GetConsentRequest", [
115
+ { no: 1, name: "operation_id", kind: "message", T: () => AuthorizationOperationId }
116
+ ]);
117
+ }
118
+ create(value) {
119
+ const message = globalThis.Object.create((this.messagePrototype));
120
+ if (value !== undefined)
121
+ reflectionMergePartial(this, message, value);
122
+ return message;
123
+ }
124
+ internalBinaryRead(reader, length, options, target) {
125
+ let message = target ?? this.create(), end = reader.pos + length;
126
+ while (reader.pos < end) {
127
+ let [fieldNo, wireType] = reader.tag();
128
+ switch (fieldNo) {
129
+ case /* sid.v1.ids.AuthorizationOperationId operation_id */ 1:
130
+ message.operationId = AuthorizationOperationId.internalBinaryRead(reader, reader.uint32(), options, message.operationId);
131
+ break;
132
+ default:
133
+ let u = options.readUnknownField;
134
+ if (u === "throw")
135
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
136
+ let d = reader.skip(wireType);
137
+ if (u !== false)
138
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
139
+ }
140
+ }
141
+ return message;
142
+ }
143
+ internalBinaryWrite(message, writer, options) {
144
+ /* sid.v1.ids.AuthorizationOperationId operation_id = 1; */
145
+ if (message.operationId)
146
+ AuthorizationOperationId.internalBinaryWrite(message.operationId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
147
+ let u = options.writeUnknownFields;
148
+ if (u !== false)
149
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
150
+ return writer;
151
+ }
152
+ }
153
+ /**
154
+ * @generated MessageType for protobuf message sid.v1.authn.GetConsentRequest
155
+ */
156
+ export const GetConsentRequest = new GetConsentRequest$Type();
157
+ // @generated message type with reflection information, may provide speed optimized methods
158
+ class ConsentDetails$Type extends MessageType {
159
+ constructor() {
160
+ super("sid.v1.authn.ConsentDetails", [
161
+ { no: 1, name: "operation_id", kind: "message", T: () => AuthorizationOperationId },
162
+ { no: 2, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
163
+ { no: 3, name: "csrf_token", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
164
+ { no: 4, name: "issuer", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
165
+ { no: 5, name: "client_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
166
+ { no: 6, name: "client_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
167
+ { no: 7, name: "resource", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
168
+ { no: 8, name: "scopes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
169
+ { no: 9, name: "claims", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ConsentClaim },
170
+ { no: 10, name: "identity_display_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
171
+ { no: 11, name: "expires_at", kind: "message", T: () => Timestamp }
172
+ ]);
173
+ }
174
+ create(value) {
175
+ const message = globalThis.Object.create((this.messagePrototype));
176
+ message.revision = 0n;
177
+ message.csrfToken = new Uint8Array(0);
178
+ message.issuer = "";
179
+ message.clientId = "";
180
+ message.clientName = "";
181
+ message.resource = "";
182
+ message.scopes = [];
183
+ message.claims = [];
184
+ message.identityDisplayName = "";
185
+ if (value !== undefined)
186
+ reflectionMergePartial(this, message, value);
187
+ return message;
188
+ }
189
+ internalBinaryRead(reader, length, options, target) {
190
+ let message = target ?? this.create(), end = reader.pos + length;
191
+ while (reader.pos < end) {
192
+ let [fieldNo, wireType] = reader.tag();
193
+ switch (fieldNo) {
194
+ case /* sid.v1.ids.AuthorizationOperationId operation_id */ 1:
195
+ message.operationId = AuthorizationOperationId.internalBinaryRead(reader, reader.uint32(), options, message.operationId);
196
+ break;
197
+ case /* uint64 revision */ 2:
198
+ message.revision = reader.uint64().toBigInt();
199
+ break;
200
+ case /* bytes csrf_token */ 3:
201
+ message.csrfToken = reader.bytes();
202
+ break;
203
+ case /* string issuer */ 4:
204
+ message.issuer = reader.string();
205
+ break;
206
+ case /* string client_id */ 5:
207
+ message.clientId = reader.string();
208
+ break;
209
+ case /* string client_name */ 6:
210
+ message.clientName = reader.string();
211
+ break;
212
+ case /* string resource */ 7:
213
+ message.resource = reader.string();
214
+ break;
215
+ case /* repeated string scopes */ 8:
216
+ message.scopes.push(reader.string());
217
+ break;
218
+ case /* repeated sid.v1.authn.ConsentClaim claims */ 9:
219
+ message.claims.push(ConsentClaim.internalBinaryRead(reader, reader.uint32(), options));
220
+ break;
221
+ case /* string identity_display_name */ 10:
222
+ message.identityDisplayName = reader.string();
223
+ break;
224
+ case /* google.protobuf.Timestamp expires_at */ 11:
225
+ message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
226
+ break;
227
+ default:
228
+ let u = options.readUnknownField;
229
+ if (u === "throw")
230
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
231
+ let d = reader.skip(wireType);
232
+ if (u !== false)
233
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
234
+ }
235
+ }
236
+ return message;
237
+ }
238
+ internalBinaryWrite(message, writer, options) {
239
+ /* sid.v1.ids.AuthorizationOperationId operation_id = 1; */
240
+ if (message.operationId)
241
+ AuthorizationOperationId.internalBinaryWrite(message.operationId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
242
+ /* uint64 revision = 2; */
243
+ if (message.revision !== 0n)
244
+ writer.tag(2, WireType.Varint).uint64(message.revision);
245
+ /* bytes csrf_token = 3; */
246
+ if (message.csrfToken.length)
247
+ writer.tag(3, WireType.LengthDelimited).bytes(message.csrfToken);
248
+ /* string issuer = 4; */
249
+ if (message.issuer !== "")
250
+ writer.tag(4, WireType.LengthDelimited).string(message.issuer);
251
+ /* string client_id = 5; */
252
+ if (message.clientId !== "")
253
+ writer.tag(5, WireType.LengthDelimited).string(message.clientId);
254
+ /* string client_name = 6; */
255
+ if (message.clientName !== "")
256
+ writer.tag(6, WireType.LengthDelimited).string(message.clientName);
257
+ /* string resource = 7; */
258
+ if (message.resource !== "")
259
+ writer.tag(7, WireType.LengthDelimited).string(message.resource);
260
+ /* repeated string scopes = 8; */
261
+ for (let i = 0; i < message.scopes.length; i++)
262
+ writer.tag(8, WireType.LengthDelimited).string(message.scopes[i]);
263
+ /* repeated sid.v1.authn.ConsentClaim claims = 9; */
264
+ for (let i = 0; i < message.claims.length; i++)
265
+ ConsentClaim.internalBinaryWrite(message.claims[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join();
266
+ /* string identity_display_name = 10; */
267
+ if (message.identityDisplayName !== "")
268
+ writer.tag(10, WireType.LengthDelimited).string(message.identityDisplayName);
269
+ /* google.protobuf.Timestamp expires_at = 11; */
270
+ if (message.expiresAt)
271
+ Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(11, WireType.LengthDelimited).fork(), options).join();
272
+ let u = options.writeUnknownFields;
273
+ if (u !== false)
274
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
275
+ return writer;
276
+ }
277
+ }
278
+ /**
279
+ * @generated MessageType for protobuf message sid.v1.authn.ConsentDetails
280
+ */
281
+ export const ConsentDetails = new ConsentDetails$Type();
282
+ // @generated message type with reflection information, may provide speed optimized methods
283
+ class ConsentClaim$Type extends MessageType {
284
+ constructor() {
285
+ super("sid.v1.authn.ConsentClaim", [
286
+ { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
287
+ { no: 2, name: "level", kind: "enum", T: () => ["sid.v1.common.ClaimRequestLevel", ClaimRequestLevel, "CLAIM_REQUEST_LEVEL_"] },
288
+ { no: 3, name: "justification", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
289
+ { no: 4, name: "allowed", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["sid.v1.authn.ClaimSharing", ClaimSharing, "CLAIM_SHARING_"] },
290
+ { no: 5, name: "type", kind: "enum", T: () => ["sid.v1.common.ClaimType", ClaimType, "CLAIM_TYPE_"] },
291
+ { no: 6, name: "value", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
292
+ ]);
293
+ }
294
+ create(value) {
295
+ const message = globalThis.Object.create((this.messagePrototype));
296
+ message.name = "";
297
+ message.level = 0;
298
+ message.allowed = [];
299
+ message.type = 0;
300
+ if (value !== undefined)
301
+ reflectionMergePartial(this, message, value);
302
+ return message;
303
+ }
304
+ internalBinaryRead(reader, length, options, target) {
305
+ let message = target ?? this.create(), end = reader.pos + length;
306
+ while (reader.pos < end) {
307
+ let [fieldNo, wireType] = reader.tag();
308
+ switch (fieldNo) {
309
+ case /* string name */ 1:
310
+ message.name = reader.string();
311
+ break;
312
+ case /* sid.v1.common.ClaimRequestLevel level */ 2:
313
+ message.level = reader.int32();
314
+ break;
315
+ case /* optional string justification */ 3:
316
+ message.justification = reader.string();
317
+ break;
318
+ case /* repeated sid.v1.authn.ClaimSharing allowed */ 4:
319
+ if (wireType === WireType.LengthDelimited)
320
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
321
+ message.allowed.push(reader.int32());
322
+ else
323
+ message.allowed.push(reader.int32());
324
+ break;
325
+ case /* sid.v1.common.ClaimType type */ 5:
326
+ message.type = reader.int32();
327
+ break;
328
+ case /* optional string value */ 6:
329
+ message.value = reader.string();
330
+ break;
331
+ default:
332
+ let u = options.readUnknownField;
333
+ if (u === "throw")
334
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
335
+ let d = reader.skip(wireType);
336
+ if (u !== false)
337
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
338
+ }
339
+ }
340
+ return message;
341
+ }
342
+ internalBinaryWrite(message, writer, options) {
343
+ /* string name = 1; */
344
+ if (message.name !== "")
345
+ writer.tag(1, WireType.LengthDelimited).string(message.name);
346
+ /* sid.v1.common.ClaimRequestLevel level = 2; */
347
+ if (message.level !== 0)
348
+ writer.tag(2, WireType.Varint).int32(message.level);
349
+ /* optional string justification = 3; */
350
+ if (message.justification !== undefined)
351
+ writer.tag(3, WireType.LengthDelimited).string(message.justification);
352
+ /* repeated sid.v1.authn.ClaimSharing allowed = 4; */
353
+ if (message.allowed.length) {
354
+ writer.tag(4, WireType.LengthDelimited).fork();
355
+ for (let i = 0; i < message.allowed.length; i++)
356
+ writer.int32(message.allowed[i]);
357
+ writer.join();
358
+ }
359
+ /* sid.v1.common.ClaimType type = 5; */
360
+ if (message.type !== 0)
361
+ writer.tag(5, WireType.Varint).int32(message.type);
362
+ /* optional string value = 6; */
363
+ if (message.value !== undefined)
364
+ writer.tag(6, WireType.LengthDelimited).string(message.value);
365
+ let u = options.writeUnknownFields;
366
+ if (u !== false)
367
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
368
+ return writer;
369
+ }
370
+ }
371
+ /**
372
+ * @generated MessageType for protobuf message sid.v1.authn.ConsentClaim
373
+ */
374
+ export const ConsentClaim = new ConsentClaim$Type();
375
+ // @generated message type with reflection information, may provide speed optimized methods
376
+ class SubmitConsentRequest$Type extends MessageType {
377
+ constructor() {
378
+ super("sid.v1.authn.SubmitConsentRequest", [
379
+ { no: 1, name: "operation_id", kind: "message", T: () => AuthorizationOperationId },
380
+ { no: 2, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
381
+ { no: 3, name: "csrf_token", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
382
+ { no: 4, name: "decision", kind: "enum", T: () => ["sid.v1.authn.ConsentDecision", ConsentDecision, "CONSENT_DECISION_"] },
383
+ { no: 5, name: "choices", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ClaimChoice }
384
+ ]);
385
+ }
386
+ create(value) {
387
+ const message = globalThis.Object.create((this.messagePrototype));
388
+ message.revision = 0n;
389
+ message.csrfToken = new Uint8Array(0);
390
+ message.decision = 0;
391
+ message.choices = [];
392
+ if (value !== undefined)
393
+ reflectionMergePartial(this, message, value);
394
+ return message;
395
+ }
396
+ internalBinaryRead(reader, length, options, target) {
397
+ let message = target ?? this.create(), end = reader.pos + length;
398
+ while (reader.pos < end) {
399
+ let [fieldNo, wireType] = reader.tag();
400
+ switch (fieldNo) {
401
+ case /* sid.v1.ids.AuthorizationOperationId operation_id */ 1:
402
+ message.operationId = AuthorizationOperationId.internalBinaryRead(reader, reader.uint32(), options, message.operationId);
403
+ break;
404
+ case /* uint64 revision */ 2:
405
+ message.revision = reader.uint64().toBigInt();
406
+ break;
407
+ case /* bytes csrf_token */ 3:
408
+ message.csrfToken = reader.bytes();
409
+ break;
410
+ case /* sid.v1.authn.ConsentDecision decision */ 4:
411
+ message.decision = reader.int32();
412
+ break;
413
+ case /* repeated sid.v1.authn.ClaimChoice choices */ 5:
414
+ message.choices.push(ClaimChoice.internalBinaryRead(reader, reader.uint32(), options));
415
+ break;
416
+ default:
417
+ let u = options.readUnknownField;
418
+ if (u === "throw")
419
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
420
+ let d = reader.skip(wireType);
421
+ if (u !== false)
422
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
423
+ }
424
+ }
425
+ return message;
426
+ }
427
+ internalBinaryWrite(message, writer, options) {
428
+ /* sid.v1.ids.AuthorizationOperationId operation_id = 1; */
429
+ if (message.operationId)
430
+ AuthorizationOperationId.internalBinaryWrite(message.operationId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
431
+ /* uint64 revision = 2; */
432
+ if (message.revision !== 0n)
433
+ writer.tag(2, WireType.Varint).uint64(message.revision);
434
+ /* bytes csrf_token = 3; */
435
+ if (message.csrfToken.length)
436
+ writer.tag(3, WireType.LengthDelimited).bytes(message.csrfToken);
437
+ /* sid.v1.authn.ConsentDecision decision = 4; */
438
+ if (message.decision !== 0)
439
+ writer.tag(4, WireType.Varint).int32(message.decision);
440
+ /* repeated sid.v1.authn.ClaimChoice choices = 5; */
441
+ for (let i = 0; i < message.choices.length; i++)
442
+ ClaimChoice.internalBinaryWrite(message.choices[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
443
+ let u = options.writeUnknownFields;
444
+ if (u !== false)
445
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
446
+ return writer;
447
+ }
448
+ }
449
+ /**
450
+ * @generated MessageType for protobuf message sid.v1.authn.SubmitConsentRequest
451
+ */
452
+ export const SubmitConsentRequest = new SubmitConsentRequest$Type();
453
+ // @generated message type with reflection information, may provide speed optimized methods
454
+ class ClaimChoice$Type extends MessageType {
455
+ constructor() {
456
+ super("sid.v1.authn.ClaimChoice", [
457
+ { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
458
+ { no: 2, name: "sharing", kind: "enum", T: () => ["sid.v1.authn.ClaimSharing", ClaimSharing, "CLAIM_SHARING_"] }
459
+ ]);
460
+ }
461
+ create(value) {
462
+ const message = globalThis.Object.create((this.messagePrototype));
463
+ message.name = "";
464
+ message.sharing = 0;
465
+ if (value !== undefined)
466
+ reflectionMergePartial(this, message, value);
467
+ return message;
468
+ }
469
+ internalBinaryRead(reader, length, options, target) {
470
+ let message = target ?? this.create(), end = reader.pos + length;
471
+ while (reader.pos < end) {
472
+ let [fieldNo, wireType] = reader.tag();
473
+ switch (fieldNo) {
474
+ case /* string name */ 1:
475
+ message.name = reader.string();
476
+ break;
477
+ case /* sid.v1.authn.ClaimSharing sharing */ 2:
478
+ message.sharing = reader.int32();
479
+ break;
480
+ default:
481
+ let u = options.readUnknownField;
482
+ if (u === "throw")
483
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
484
+ let d = reader.skip(wireType);
485
+ if (u !== false)
486
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
487
+ }
488
+ }
489
+ return message;
490
+ }
491
+ internalBinaryWrite(message, writer, options) {
492
+ /* string name = 1; */
493
+ if (message.name !== "")
494
+ writer.tag(1, WireType.LengthDelimited).string(message.name);
495
+ /* sid.v1.authn.ClaimSharing sharing = 2; */
496
+ if (message.sharing !== 0)
497
+ writer.tag(2, WireType.Varint).int32(message.sharing);
498
+ let u = options.writeUnknownFields;
499
+ if (u !== false)
500
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
501
+ return writer;
502
+ }
503
+ }
504
+ /**
505
+ * @generated MessageType for protobuf message sid.v1.authn.ClaimChoice
506
+ */
507
+ export const ClaimChoice = new ClaimChoice$Type();
508
+ // @generated message type with reflection information, may provide speed optimized methods
509
+ class GetFlowStateRequest$Type extends MessageType {
510
+ constructor() {
511
+ super("sid.v1.authn.GetFlowStateRequest", [
512
+ { no: 1, name: "operation_id", kind: "message", T: () => AuthorizationOperationId }
513
+ ]);
514
+ }
515
+ create(value) {
516
+ const message = globalThis.Object.create((this.messagePrototype));
517
+ if (value !== undefined)
518
+ reflectionMergePartial(this, message, value);
519
+ return message;
520
+ }
521
+ internalBinaryRead(reader, length, options, target) {
522
+ let message = target ?? this.create(), end = reader.pos + length;
523
+ while (reader.pos < end) {
524
+ let [fieldNo, wireType] = reader.tag();
525
+ switch (fieldNo) {
526
+ case /* sid.v1.ids.AuthorizationOperationId operation_id */ 1:
527
+ message.operationId = AuthorizationOperationId.internalBinaryRead(reader, reader.uint32(), options, message.operationId);
528
+ break;
529
+ default:
530
+ let u = options.readUnknownField;
531
+ if (u === "throw")
532
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
533
+ let d = reader.skip(wireType);
534
+ if (u !== false)
535
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
536
+ }
537
+ }
538
+ return message;
539
+ }
540
+ internalBinaryWrite(message, writer, options) {
541
+ /* sid.v1.ids.AuthorizationOperationId operation_id = 1; */
542
+ if (message.operationId)
543
+ AuthorizationOperationId.internalBinaryWrite(message.operationId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
544
+ let u = options.writeUnknownFields;
545
+ if (u !== false)
546
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
547
+ return writer;
548
+ }
549
+ }
550
+ /**
551
+ * @generated MessageType for protobuf message sid.v1.authn.GetFlowStateRequest
552
+ */
553
+ export const GetFlowStateRequest = new GetFlowStateRequest$Type();
554
+ // @generated message type with reflection information, may provide speed optimized methods
555
+ class FlowState$Type extends MessageType {
556
+ constructor() {
557
+ super("sid.v1.authn.FlowState", [
558
+ { no: 1, name: "operation_id", kind: "message", T: () => AuthorizationOperationId },
559
+ { no: 2, name: "step", kind: "enum", T: () => ["sid.v1.authn.AuthorizationStep", AuthorizationStep, "AUTHORIZATION_STEP_"] },
560
+ { no: 3, name: "continuation_uri", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
561
+ ]);
562
+ }
563
+ create(value) {
564
+ const message = globalThis.Object.create((this.messagePrototype));
565
+ message.step = 0;
566
+ if (value !== undefined)
567
+ reflectionMergePartial(this, message, value);
568
+ return message;
569
+ }
570
+ internalBinaryRead(reader, length, options, target) {
571
+ let message = target ?? this.create(), end = reader.pos + length;
572
+ while (reader.pos < end) {
573
+ let [fieldNo, wireType] = reader.tag();
574
+ switch (fieldNo) {
575
+ case /* sid.v1.ids.AuthorizationOperationId operation_id */ 1:
576
+ message.operationId = AuthorizationOperationId.internalBinaryRead(reader, reader.uint32(), options, message.operationId);
577
+ break;
578
+ case /* sid.v1.authn.AuthorizationStep step */ 2:
579
+ message.step = reader.int32();
580
+ break;
581
+ case /* optional string continuation_uri */ 3:
582
+ message.continuationUri = reader.string();
583
+ break;
584
+ default:
585
+ let u = options.readUnknownField;
586
+ if (u === "throw")
587
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
588
+ let d = reader.skip(wireType);
589
+ if (u !== false)
590
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
591
+ }
592
+ }
593
+ return message;
594
+ }
595
+ internalBinaryWrite(message, writer, options) {
596
+ /* sid.v1.ids.AuthorizationOperationId operation_id = 1; */
597
+ if (message.operationId)
598
+ AuthorizationOperationId.internalBinaryWrite(message.operationId, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
599
+ /* sid.v1.authn.AuthorizationStep step = 2; */
600
+ if (message.step !== 0)
601
+ writer.tag(2, WireType.Varint).int32(message.step);
602
+ /* optional string continuation_uri = 3; */
603
+ if (message.continuationUri !== undefined)
604
+ writer.tag(3, WireType.LengthDelimited).string(message.continuationUri);
605
+ let u = options.writeUnknownFields;
606
+ if (u !== false)
607
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
608
+ return writer;
609
+ }
610
+ }
611
+ /**
612
+ * @generated MessageType for protobuf message sid.v1.authn.FlowState
613
+ */
614
+ export const FlowState = new FlowState$Type();
615
+ /**
616
+ * @generated ServiceType for protobuf service sid.v1.authn.AuthFlowService
617
+ */
618
+ export const AuthFlowService = new ServiceType("sid.v1.authn.AuthFlowService", [
619
+ { name: "GetConsent", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { post: "/v1/auth/flows/{operation_id.value}/consent:review", body: "*" }, "sid.v1.common.access": { open: "the issuer's own IdP session cookie authenticates the browser authorization interaction; checked by the handler with the exact trusted Origin" }, "sid.v1.common.maintenance": "MAINTENANCE_PURPOSE_SIGN_IN" }, I: GetConsentRequest, O: ConsentDetails },
620
+ { name: "SubmitConsent", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/auth/flows/{operation_id.value}/consent", body: "*" }, "sid.v1.common.access": { open: "the issuer's own IdP session cookie authenticates the browser authorization interaction; checked by the handler with the exact trusted Origin and the operation's CSRF value" }, "sid.v1.common.retry": { natural: "the operation records one decision per revision: the same decision submitted again answers the committed state and records no second grant or audit entry, and a different decision for that revision is refused" }, "sid.v1.common.maintenance": "MAINTENANCE_PURPOSE_SIGN_IN" }, I: SubmitConsentRequest, O: FlowState },
621
+ { name: "GetFlowState", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { post: "/v1/auth/flows/{operation_id.value}/state:read", body: "*" }, "sid.v1.common.access": { open: "the issuer's own IdP session cookie authenticates the browser authorization interaction; checked by the handler with the exact trusted Origin" }, "sid.v1.common.maintenance": "MAINTENANCE_PURPOSE_SIGN_IN" }, I: GetFlowStateRequest, O: FlowState }
622
+ ]);
623
+ //# sourceMappingURL=auth_flow.js.map