@structured-id/ui-core 2.0.0 → 3.0.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 (152) hide show
  1. package/README.md +22 -10
  2. package/package.json +25 -43
  3. package/src/components/SidStatusBadge.vue +1 -5
  4. package/src/composables/useAccountTransport.test.ts +2 -1
  5. package/src/composables/useGrpc.test.ts +17 -14
  6. package/src/composables/useGrpc.ts +4 -2
  7. package/src/index.ts +2 -120
  8. package/src/profile/components/ConsentManager.vue +5 -1
  9. package/src/profile/components/ProfileEditor.vue +1 -1
  10. package/src/profile/components/SecuritySettings.vue +5 -1
  11. package/src/profile/components/SessionList.vue +2 -1
  12. package/src/profile/components/SidRegistrationForm.test.ts +173 -1
  13. package/src/profile/components/SidRegistrationForm.vue +88 -32
  14. package/src/profile/components/index.ts +1 -4
  15. package/src/profile/composables/index.ts +1 -0
  16. package/src/profile/composables/operationPlan.test.ts +155 -0
  17. package/src/profile/composables/operationPlan.ts +218 -0
  18. package/src/profile/composables/useAccountApi.ts +4 -4
  19. package/src/profile/composables/useAuth.test.ts +312 -31
  20. package/src/profile/composables/useAuth.ts +176 -30
  21. package/src/profile/composables/useAuthApi.opaque.test.ts +13 -6
  22. package/src/profile/composables/useAuthApi.ts +40 -18
  23. package/src/profile/composables/useCurrentPasswordRequirement.test.ts +196 -0
  24. package/src/profile/composables/useCurrentPasswordRequirement.ts +95 -0
  25. package/src/profile/composables/useEnrollmentApi.test.ts +7 -3
  26. package/src/profile/composables/useEnrollmentApi.ts +3 -5
  27. package/src/profile/composables/useIdentityApi.ts +4 -4
  28. package/src/profile/composables/useSecurityLevel.test.ts +1 -1
  29. package/src/profile/composables/useSecurityLevel.ts +1 -1
  30. package/src/quasar/SidPasswordCeremony.test.ts +253 -0
  31. package/src/quasar/SidPasswordCeremony.vue +456 -0
  32. package/src/quasar/index.ts +2 -0
  33. package/src/utils/rpcRefusal.test.ts +4 -4
  34. package/src/utils/rpcRefusal.ts +8 -4
  35. package/dist/browser-vp/index.cjs +0 -349
  36. package/dist/browser-vp/index.d.cts +0 -276
  37. package/dist/browser-vp/index.d.ts +0 -276
  38. package/dist/browser-vp/index.js +0 -349
  39. package/dist/chunk-C3Q766CY.cjs +0 -125
  40. package/dist/chunk-J5YXRXB5.js +0 -125
  41. package/dist/index.cjs +0 -23581
  42. package/dist/index.d.cts +0 -11539
  43. package/dist/index.d.ts +0 -11539
  44. package/dist/index.js +0 -23581
  45. package/dist/storage-4CB2JTLW.cjs +0 -22
  46. package/dist/storage-THRWREZP.js +0 -22
  47. package/src/browser-vp/crypto.ts +0 -253
  48. package/src/browser-vp/index.test.ts +0 -10
  49. package/src/browser-vp/index.ts +0 -116
  50. package/src/browser-vp/prf.ts +0 -179
  51. package/src/browser-vp/storage.test.ts +0 -9
  52. package/src/browser-vp/storage.ts +0 -163
  53. package/src/browser-vp/types.ts +0 -95
  54. package/src/browser-vp/vp.test.ts +0 -43
  55. package/src/browser-vp/vp.ts +0 -111
  56. package/src/generated/google/api/http.ts +0 -687
  57. package/src/generated/google/api/httpbody.ts +0 -159
  58. package/src/generated/google/protobuf/any.ts +0 -326
  59. package/src/generated/google/protobuf/descriptor.ts +0 -4865
  60. package/src/generated/google/protobuf/duration.ts +0 -230
  61. package/src/generated/google/protobuf/empty.ts +0 -94
  62. package/src/generated/google/protobuf/struct.ts +0 -484
  63. package/src/generated/google/protobuf/timestamp.ts +0 -287
  64. package/src/generated/google/rpc/error_details.ts +0 -1386
  65. package/src/generated/google/rpc/status.ts +0 -127
  66. package/src/generated/sid/v1/account/account.client.ts +0 -527
  67. package/src/generated/sid/v1/account/account.ts +0 -3261
  68. package/src/generated/sid/v1/admin/admin.client.ts +0 -139
  69. package/src/generated/sid/v1/admin/admin.ts +0 -781
  70. package/src/generated/sid/v1/admin/admin_roles.client.ts +0 -181
  71. package/src/generated/sid/v1/admin/admin_roles.ts +0 -1606
  72. package/src/generated/sid/v1/admin/analytics.client.ts +0 -106
  73. package/src/generated/sid/v1/admin/analytics.ts +0 -1017
  74. package/src/generated/sid/v1/admin/branding.client.ts +0 -166
  75. package/src/generated/sid/v1/admin/branding.ts +0 -1906
  76. package/src/generated/sid/v1/admin/enrollment.client.ts +0 -177
  77. package/src/generated/sid/v1/admin/enrollment.ts +0 -1766
  78. package/src/generated/sid/v1/admin/events.client.ts +0 -195
  79. package/src/generated/sid/v1/admin/events.ts +0 -1900
  80. package/src/generated/sid/v1/admin/flow.client.ts +0 -183
  81. package/src/generated/sid/v1/admin/flow.ts +0 -1552
  82. package/src/generated/sid/v1/admin/keys.client.ts +0 -107
  83. package/src/generated/sid/v1/admin/keys.ts +0 -931
  84. package/src/generated/sid/v1/admin/login_experience.client.ts +0 -160
  85. package/src/generated/sid/v1/admin/login_experience.ts +0 -1061
  86. package/src/generated/sid/v1/admin/migration.client.ts +0 -127
  87. package/src/generated/sid/v1/admin/migration.ts +0 -1948
  88. package/src/generated/sid/v1/admin/notifications.client.ts +0 -134
  89. package/src/generated/sid/v1/admin/notifications.ts +0 -1273
  90. package/src/generated/sid/v1/admin/operations.client.ts +0 -241
  91. package/src/generated/sid/v1/admin/operations.ts +0 -2633
  92. package/src/generated/sid/v1/admin/organizations.client.ts +0 -57
  93. package/src/generated/sid/v1/admin/organizations.ts +0 -332
  94. package/src/generated/sid/v1/admin/provisioning.client.ts +0 -232
  95. package/src/generated/sid/v1/admin/provisioning.ts +0 -1383
  96. package/src/generated/sid/v1/admin/scopes.client.ts +0 -171
  97. package/src/generated/sid/v1/admin/scopes.ts +0 -1324
  98. package/src/generated/sid/v1/admin/security.client.ts +0 -410
  99. package/src/generated/sid/v1/admin/security.ts +0 -4077
  100. package/src/generated/sid/v1/admin/sessions.client.ts +0 -114
  101. package/src/generated/sid/v1/admin/sessions.ts +0 -923
  102. package/src/generated/sid/v1/admin/settings.client.ts +0 -351
  103. package/src/generated/sid/v1/admin/settings.ts +0 -2458
  104. package/src/generated/sid/v1/admin/user_profile.client.ts +0 -57
  105. package/src/generated/sid/v1/admin/user_profile.ts +0 -730
  106. package/src/generated/sid/v1/admin/webhooks.client.ts +0 -269
  107. package/src/generated/sid/v1/admin/webhooks.ts +0 -2804
  108. package/src/generated/sid/v1/attestation/attestation.client.ts +0 -115
  109. package/src/generated/sid/v1/attestation/attestation.ts +0 -813
  110. package/src/generated/sid/v1/authn/auth.client.ts +0 -943
  111. package/src/generated/sid/v1/authn/auth.ts +0 -9719
  112. package/src/generated/sid/v1/authn/flows.client.ts +0 -413
  113. package/src/generated/sid/v1/authn/flows.ts +0 -3205
  114. package/src/generated/sid/v1/authn/issuer.client.ts +0 -489
  115. package/src/generated/sid/v1/authn/issuer.ts +0 -1600
  116. package/src/generated/sid/v1/authn/password_history.client.ts +0 -57
  117. package/src/generated/sid/v1/authn/password_history.ts +0 -578
  118. package/src/generated/sid/v1/authn/system_integration.client.ts +0 -73
  119. package/src/generated/sid/v1/authn/system_integration.ts +0 -218
  120. package/src/generated/sid/v1/authz/authz.client.ts +0 -459
  121. package/src/generated/sid/v1/authz/authz.ts +0 -6524
  122. package/src/generated/sid/v1/authz/forward_auth.client.ts +0 -97
  123. package/src/generated/sid/v1/authz/forward_auth.ts +0 -79
  124. package/src/generated/sid/v1/authz/governance.client.ts +0 -102
  125. package/src/generated/sid/v1/authz/governance.ts +0 -875
  126. package/src/generated/sid/v1/common/errors.ts +0 -710
  127. package/src/generated/sid/v1/common/pagination.ts +0 -152
  128. package/src/generated/sid/v1/common/transport.ts +0 -227
  129. package/src/generated/sid/v1/common/types.ts +0 -151
  130. package/src/generated/sid/v1/events/event_stream.client.ts +0 -67
  131. package/src/generated/sid/v1/events/event_stream.ts +0 -375
  132. package/src/generated/sid/v1/federation/upstream.client.ts +0 -142
  133. package/src/generated/sid/v1/federation/upstream.ts +0 -1736
  134. package/src/generated/sid/v1/identity/identity.client.ts +0 -467
  135. package/src/generated/sid/v1/identity/identity.ts +0 -5676
  136. package/src/generated/sid/v1/ids/ids.ts +0 -395
  137. package/src/generated/sid/v1/machine/machine_user.client.ts +0 -219
  138. package/src/generated/sid/v1/machine/machine_user.ts +0 -2364
  139. package/src/generated/sid/v1/machine/pat.client.ts +0 -130
  140. package/src/generated/sid/v1/machine/pat.ts +0 -1083
  141. package/src/generated/sid/v1/projects/projects.client.ts +0 -404
  142. package/src/generated/sid/v1/projects/projects.ts +0 -4446
  143. package/src/generated/sid/v1/scim/scim.client.ts +0 -520
  144. package/src/generated/sid/v1/scim/scim.ts +0 -3182
  145. package/src/generated/sid/v1/test/test.client.ts +0 -232
  146. package/src/generated/sid/v1/test/test.ts +0 -1136
  147. package/src/transport/adaptive.test.ts +0 -728
  148. package/src/transport/adaptive.ts +0 -308
  149. package/src/transport/framing.test.ts +0 -227
  150. package/src/transport/framing.ts +0 -98
  151. package/src/transport/webtransport.test.ts +0 -728
  152. package/src/transport/webtransport.ts +0 -323
@@ -1,2364 +0,0 @@
1
- // @generated by protobuf-ts 2.11.1 with parameter client_generic,generate_dependencies
2
- // @generated from protobuf file "sid/v1/machine/machine_user.proto" (package "sid.v1.machine", syntax proto3)
3
- // tslint:disable
4
- import { ServiceType } from "@protobuf-ts/runtime-rpc";
5
- import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
6
- import type { IBinaryWriter } from "@protobuf-ts/runtime";
7
- import { WireType } from "@protobuf-ts/runtime";
8
- import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
- import type { IBinaryReader } from "@protobuf-ts/runtime";
10
- import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
- import type { PartialMessage } from "@protobuf-ts/runtime";
12
- import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
- import { MessageType } from "@protobuf-ts/runtime";
14
- import { Timestamp } from "../../../google/protobuf/timestamp";
15
- /**
16
- * Messages
17
- *
18
- * @generated from protobuf message sid.v1.machine.MachineUserInfo
19
- */
20
- export interface MachineUserInfo {
21
- /**
22
- * @generated from protobuf field: string id = 1
23
- */
24
- id: string;
25
- /**
26
- * @generated from protobuf field: string project_id = 2
27
- */
28
- projectId: string;
29
- /**
30
- * @generated from protobuf field: string client_id = 3
31
- */
32
- clientId: string;
33
- /**
34
- * @generated from protobuf field: string display_name = 4
35
- */
36
- displayName: string;
37
- /**
38
- * @generated from protobuf field: string description = 5
39
- */
40
- description: string;
41
- /**
42
- * @generated from protobuf field: sid.v1.machine.MachineUserType machine_type = 6
43
- */
44
- machineType: MachineUserType;
45
- /**
46
- * @generated from protobuf field: sid.v1.machine.MachineUserStatus status = 7
47
- */
48
- status: MachineUserStatus;
49
- /**
50
- * @generated from protobuf field: string owner_type = 8
51
- */
52
- ownerType: string;
53
- /**
54
- * @generated from protobuf field: string owner_id = 9
55
- */
56
- ownerId: string;
57
- /**
58
- * @generated from protobuf field: repeated string scopes = 10
59
- */
60
- scopes: string[];
61
- /**
62
- * @generated from protobuf field: repeated string ip_allowlist = 12
63
- */
64
- ipAllowlist: string[];
65
- /**
66
- * @generated from protobuf field: int32 rate_limit_rpm = 13
67
- */
68
- rateLimitRpm: number;
69
- /**
70
- * @generated from protobuf field: int32 max_token_lifetime = 14
71
- */
72
- maxTokenLifetime: number;
73
- /**
74
- * @generated from protobuf field: google.protobuf.Timestamp expires_at = 15
75
- */
76
- expiresAt?: Timestamp;
77
- /**
78
- * @generated from protobuf field: google.protobuf.Timestamp last_used_at = 16
79
- */
80
- lastUsedAt?: Timestamp;
81
- /**
82
- * @generated from protobuf field: google.protobuf.Timestamp created_at = 17
83
- */
84
- createdAt?: Timestamp;
85
- /**
86
- * @generated from protobuf field: google.protobuf.Timestamp updated_at = 18
87
- */
88
- updatedAt?: Timestamp;
89
- }
90
- /**
91
- * @generated from protobuf message sid.v1.machine.MachineCredentialInfo
92
- */
93
- export interface MachineCredentialInfo {
94
- /**
95
- * @generated from protobuf field: string kid = 1
96
- */
97
- kid: string;
98
- /**
99
- * @generated from protobuf field: sid.v1.machine.MachineCredentialType credential_type = 2
100
- */
101
- credentialType: MachineCredentialType;
102
- /**
103
- * @generated from protobuf field: sid.v1.machine.MachineCredentialStatus status = 3
104
- */
105
- status: MachineCredentialStatus;
106
- /**
107
- * @generated from protobuf field: string algorithm = 4
108
- */
109
- algorithm: string;
110
- /**
111
- * @generated from protobuf field: google.protobuf.Timestamp expires_at = 5
112
- */
113
- expiresAt?: Timestamp;
114
- /**
115
- * @generated from protobuf field: google.protobuf.Timestamp created_at = 6
116
- */
117
- createdAt?: Timestamp; // NOTE: credential_data is NEVER returned for client_secret type
118
- }
119
- /**
120
- * @generated from protobuf message sid.v1.machine.ImpersonationGrantInfo
121
- */
122
- export interface ImpersonationGrantInfo {
123
- /**
124
- * @generated from protobuf field: string id = 1
125
- */
126
- id: string;
127
- /**
128
- * @generated from protobuf field: string machine_user_id = 2
129
- */
130
- machineUserId: string;
131
- /**
132
- * @generated from protobuf field: sid.v1.machine.ImpersonationTargetType target_type = 3
133
- */
134
- targetType: ImpersonationTargetType;
135
- /**
136
- * @generated from protobuf field: string target = 4
137
- */
138
- target: string;
139
- /**
140
- * @generated from protobuf field: repeated string allowed_scopes = 5
141
- */
142
- allowedScopes: string[];
143
- /**
144
- * @generated from protobuf field: google.protobuf.Timestamp created_at = 6
145
- */
146
- createdAt?: Timestamp;
147
- }
148
- // -- CRUD messages --
149
-
150
- /**
151
- * @generated from protobuf message sid.v1.machine.CreateMachineUserRequest
152
- */
153
- export interface CreateMachineUserRequest {
154
- /**
155
- * @generated from protobuf field: string project_id = 1
156
- */
157
- projectId: string;
158
- /**
159
- * @generated from protobuf field: string display_name = 2
160
- */
161
- displayName: string;
162
- /**
163
- * @generated from protobuf field: string description = 3
164
- */
165
- description: string;
166
- /**
167
- * @generated from protobuf field: sid.v1.machine.MachineUserType machine_type = 4
168
- */
169
- machineType: MachineUserType;
170
- /**
171
- * @generated from protobuf field: repeated string scopes = 5
172
- */
173
- scopes: string[];
174
- /**
175
- * @generated from protobuf field: repeated string ip_allowlist = 7
176
- */
177
- ipAllowlist: string[];
178
- /**
179
- * @generated from protobuf field: int32 rate_limit_rpm = 8
180
- */
181
- rateLimitRpm: number;
182
- /**
183
- * @generated from protobuf field: int32 max_token_lifetime = 9
184
- */
185
- maxTokenLifetime: number;
186
- /**
187
- * @generated from protobuf field: google.protobuf.Timestamp expires_at = 10
188
- */
189
- expiresAt?: Timestamp;
190
- }
191
- /**
192
- * @generated from protobuf message sid.v1.machine.CreateMachineUserResponse
193
- */
194
- export interface CreateMachineUserResponse {
195
- /**
196
- * @generated from protobuf field: sid.v1.machine.MachineUserInfo machine_user = 1
197
- */
198
- machineUser?: MachineUserInfo;
199
- }
200
- /**
201
- * @generated from protobuf message sid.v1.machine.GetMachineUserRequest
202
- */
203
- export interface GetMachineUserRequest {
204
- /**
205
- * @generated from protobuf field: string machine_user_id = 1
206
- */
207
- machineUserId: string;
208
- }
209
- /**
210
- * @generated from protobuf message sid.v1.machine.MachineUserResponse
211
- */
212
- export interface MachineUserResponse {
213
- /**
214
- * @generated from protobuf field: sid.v1.machine.MachineUserInfo machine_user = 1
215
- */
216
- machineUser?: MachineUserInfo;
217
- }
218
- /**
219
- * @generated from protobuf message sid.v1.machine.UpdateMachineUserRequest
220
- */
221
- export interface UpdateMachineUserRequest {
222
- /**
223
- * @generated from protobuf field: string machine_user_id = 1
224
- */
225
- machineUserId: string;
226
- /**
227
- * @generated from protobuf field: string display_name = 2
228
- */
229
- displayName: string;
230
- /**
231
- * @generated from protobuf field: string description = 3
232
- */
233
- description: string;
234
- /**
235
- * @generated from protobuf field: repeated string scopes = 4
236
- */
237
- scopes: string[];
238
- /**
239
- * @generated from protobuf field: repeated string ip_allowlist = 6
240
- */
241
- ipAllowlist: string[];
242
- /**
243
- * @generated from protobuf field: int32 rate_limit_rpm = 7
244
- */
245
- rateLimitRpm: number;
246
- /**
247
- * @generated from protobuf field: int32 max_token_lifetime = 8
248
- */
249
- maxTokenLifetime: number;
250
- /**
251
- * @generated from protobuf field: google.protobuf.Timestamp expires_at = 9
252
- */
253
- expiresAt?: Timestamp;
254
- }
255
- /**
256
- * @generated from protobuf message sid.v1.machine.DeleteMachineUserRequest
257
- */
258
- export interface DeleteMachineUserRequest {
259
- /**
260
- * @generated from protobuf field: string machine_user_id = 1
261
- */
262
- machineUserId: string;
263
- }
264
- /**
265
- * @generated from protobuf message sid.v1.machine.DeleteMachineUserResponse
266
- */
267
- export interface DeleteMachineUserResponse {
268
- }
269
- /**
270
- * @generated from protobuf message sid.v1.machine.ListMachineUsersRequest
271
- */
272
- export interface ListMachineUsersRequest {
273
- /**
274
- * @generated from protobuf field: string project_id = 1
275
- */
276
- projectId: string;
277
- }
278
- /**
279
- * @generated from protobuf message sid.v1.machine.ListMachineUsersResponse
280
- */
281
- export interface ListMachineUsersResponse {
282
- /**
283
- * @generated from protobuf field: repeated sid.v1.machine.MachineUserInfo machine_users = 1
284
- */
285
- machineUsers: MachineUserInfo[];
286
- }
287
- /**
288
- * @generated from protobuf message sid.v1.machine.SuspendMachineUserRequest
289
- */
290
- export interface SuspendMachineUserRequest {
291
- /**
292
- * @generated from protobuf field: string machine_user_id = 1
293
- */
294
- machineUserId: string;
295
- }
296
- /**
297
- * @generated from protobuf message sid.v1.machine.ReactivateMachineUserRequest
298
- */
299
- export interface ReactivateMachineUserRequest {
300
- /**
301
- * @generated from protobuf field: string machine_user_id = 1
302
- */
303
- machineUserId: string;
304
- }
305
- // -- Credential messages --
306
-
307
- /**
308
- * @generated from protobuf message sid.v1.machine.AddMachineCredentialRequest
309
- */
310
- export interface AddMachineCredentialRequest {
311
- /**
312
- * @generated from protobuf field: string machine_user_id = 1
313
- */
314
- machineUserId: string;
315
- /**
316
- * @generated from protobuf field: sid.v1.machine.MachineCredentialType credential_type = 2
317
- */
318
- credentialType: MachineCredentialType;
319
- /**
320
- * @generated from protobuf field: string algorithm = 3
321
- */
322
- algorithm: string; // For private_key_jwt: "RS256", "ES256"
323
- /**
324
- * @generated from protobuf field: string public_key_pem = 4
325
- */
326
- publicKeyPem: string; // For private_key_jwt: PEM-encoded public key
327
- /**
328
- * @generated from protobuf field: google.protobuf.Timestamp expires_at = 5
329
- */
330
- expiresAt?: Timestamp;
331
- }
332
- /**
333
- * @generated from protobuf message sid.v1.machine.AddMachineCredentialResponse
334
- */
335
- export interface AddMachineCredentialResponse {
336
- /**
337
- * @generated from protobuf field: sid.v1.machine.MachineCredentialInfo credential = 1
338
- */
339
- credential?: MachineCredentialInfo;
340
- /**
341
- * @generated from protobuf field: string client_secret = 2
342
- */
343
- clientSecret: string; // Plaintext — shown ONCE for client_secret type. Empty for others.
344
- }
345
- /**
346
- * @generated from protobuf message sid.v1.machine.RevokeMachineCredentialRequest
347
- */
348
- export interface RevokeMachineCredentialRequest {
349
- /**
350
- * @generated from protobuf field: string machine_user_id = 1
351
- */
352
- machineUserId: string;
353
- /**
354
- * @generated from protobuf field: string kid = 2
355
- */
356
- kid: string;
357
- }
358
- /**
359
- * @generated from protobuf message sid.v1.machine.RevokeMachineCredentialResponse
360
- */
361
- export interface RevokeMachineCredentialResponse {
362
- }
363
- /**
364
- * @generated from protobuf message sid.v1.machine.ListMachineCredentialsRequest
365
- */
366
- export interface ListMachineCredentialsRequest {
367
- /**
368
- * @generated from protobuf field: string machine_user_id = 1
369
- */
370
- machineUserId: string;
371
- }
372
- /**
373
- * @generated from protobuf message sid.v1.machine.ListMachineCredentialsResponse
374
- */
375
- export interface ListMachineCredentialsResponse {
376
- /**
377
- * @generated from protobuf field: repeated sid.v1.machine.MachineCredentialInfo credentials = 1
378
- */
379
- credentials: MachineCredentialInfo[];
380
- }
381
- /**
382
- * @generated from protobuf message sid.v1.machine.RotateMachineCredentialRequest
383
- */
384
- export interface RotateMachineCredentialRequest {
385
- /**
386
- * @generated from protobuf field: string machine_user_id = 1
387
- */
388
- machineUserId: string;
389
- /**
390
- * @generated from protobuf field: string kid = 2
391
- */
392
- kid: string; // Old credential kid to rotate
393
- /**
394
- * @generated from protobuf field: string algorithm = 3
395
- */
396
- algorithm: string; // For new private_key_jwt
397
- /**
398
- * @generated from protobuf field: string public_key_pem = 4
399
- */
400
- publicKeyPem: string; // For new private_key_jwt
401
- /**
402
- * @generated from protobuf field: google.protobuf.Timestamp expires_at = 5
403
- */
404
- expiresAt?: Timestamp;
405
- }
406
- /**
407
- * @generated from protobuf message sid.v1.machine.RotateMachineCredentialResponse
408
- */
409
- export interface RotateMachineCredentialResponse {
410
- /**
411
- * @generated from protobuf field: sid.v1.machine.MachineCredentialInfo old_credential = 1
412
- */
413
- oldCredential?: MachineCredentialInfo; // Set to grace_period
414
- /**
415
- * @generated from protobuf field: sid.v1.machine.MachineCredentialInfo new_credential = 2
416
- */
417
- newCredential?: MachineCredentialInfo;
418
- /**
419
- * @generated from protobuf field: string client_secret = 3
420
- */
421
- clientSecret: string; // If client_secret type
422
- }
423
- // -- Impersonation messages --
424
-
425
- /**
426
- * @generated from protobuf message sid.v1.machine.GrantImpersonationRequest
427
- */
428
- export interface GrantImpersonationRequest {
429
- /**
430
- * @generated from protobuf field: string machine_user_id = 1
431
- */
432
- machineUserId: string;
433
- /**
434
- * @generated from protobuf field: sid.v1.machine.ImpersonationTargetType target_type = 2
435
- */
436
- targetType: ImpersonationTargetType;
437
- /**
438
- * @generated from protobuf field: string target = 3
439
- */
440
- target: string;
441
- /**
442
- * @generated from protobuf field: repeated string allowed_scopes = 4
443
- */
444
- allowedScopes: string[];
445
- }
446
- /**
447
- * @generated from protobuf message sid.v1.machine.GrantImpersonationResponse
448
- */
449
- export interface GrantImpersonationResponse {
450
- /**
451
- * @generated from protobuf field: sid.v1.machine.ImpersonationGrantInfo grant = 1
452
- */
453
- grant?: ImpersonationGrantInfo;
454
- }
455
- /**
456
- * @generated from protobuf message sid.v1.machine.RevokeImpersonationRequest
457
- */
458
- export interface RevokeImpersonationRequest {
459
- /**
460
- * @generated from protobuf field: string machine_user_id = 1
461
- */
462
- machineUserId: string;
463
- /**
464
- * @generated from protobuf field: string target_type = 2
465
- */
466
- targetType: string;
467
- /**
468
- * @generated from protobuf field: string target = 3
469
- */
470
- target: string;
471
- }
472
- /**
473
- * @generated from protobuf message sid.v1.machine.RevokeImpersonationResponse
474
- */
475
- export interface RevokeImpersonationResponse {
476
- }
477
- /**
478
- * @generated from protobuf message sid.v1.machine.ListImpersonationGrantsRequest
479
- */
480
- export interface ListImpersonationGrantsRequest {
481
- /**
482
- * @generated from protobuf field: string machine_user_id = 1
483
- */
484
- machineUserId: string;
485
- }
486
- /**
487
- * @generated from protobuf message sid.v1.machine.ListImpersonationGrantsResponse
488
- */
489
- export interface ListImpersonationGrantsResponse {
490
- /**
491
- * @generated from protobuf field: repeated sid.v1.machine.ImpersonationGrantInfo grants = 1
492
- */
493
- grants: ImpersonationGrantInfo[];
494
- }
495
- /**
496
- * Enums
497
- *
498
- * @generated from protobuf enum sid.v1.machine.MachineUserType
499
- */
500
- export enum MachineUserType {
501
- /**
502
- * @generated from protobuf enum value: MACHINE_USER_TYPE_UNSPECIFIED = 0;
503
- */
504
- UNSPECIFIED = 0,
505
- /**
506
- * @generated from protobuf enum value: MACHINE_USER_TYPE_SERVICE = 1;
507
- */
508
- SERVICE = 1,
509
- /**
510
- * @generated from protobuf enum value: MACHINE_USER_TYPE_BOT = 2;
511
- */
512
- BOT = 2,
513
- /**
514
- * @generated from protobuf enum value: MACHINE_USER_TYPE_AGENT = 3;
515
- */
516
- AGENT = 3
517
- }
518
- /**
519
- * @generated from protobuf enum sid.v1.machine.MachineUserStatus
520
- */
521
- export enum MachineUserStatus {
522
- /**
523
- * @generated from protobuf enum value: MACHINE_USER_STATUS_UNSPECIFIED = 0;
524
- */
525
- UNSPECIFIED = 0,
526
- /**
527
- * @generated from protobuf enum value: MACHINE_USER_STATUS_ACTIVE = 1;
528
- */
529
- ACTIVE = 1,
530
- /**
531
- * @generated from protobuf enum value: MACHINE_USER_STATUS_SUSPENDED = 2;
532
- */
533
- SUSPENDED = 2,
534
- /**
535
- * @generated from protobuf enum value: MACHINE_USER_STATUS_EXPIRED = 3;
536
- */
537
- EXPIRED = 3,
538
- /**
539
- * @generated from protobuf enum value: MACHINE_USER_STATUS_DELETED = 4;
540
- */
541
- DELETED = 4
542
- }
543
- /**
544
- * @generated from protobuf enum sid.v1.machine.MachineCredentialType
545
- */
546
- export enum MachineCredentialType {
547
- /**
548
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_TYPE_UNSPECIFIED = 0;
549
- */
550
- UNSPECIFIED = 0,
551
- /**
552
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_TYPE_CLIENT_SECRET = 1;
553
- */
554
- CLIENT_SECRET = 1,
555
- /**
556
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_TYPE_PRIVATE_KEY_JWT = 2;
557
- */
558
- PRIVATE_KEY_JWT = 2,
559
- /**
560
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_TYPE_MTLS = 3;
561
- */
562
- MTLS = 3,
563
- /**
564
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_TYPE_WORKLOAD_IDENTITY = 4;
565
- */
566
- WORKLOAD_IDENTITY = 4
567
- }
568
- /**
569
- * @generated from protobuf enum sid.v1.machine.MachineCredentialStatus
570
- */
571
- export enum MachineCredentialStatus {
572
- /**
573
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_STATUS_UNSPECIFIED = 0;
574
- */
575
- UNSPECIFIED = 0,
576
- /**
577
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_STATUS_ACTIVE = 1;
578
- */
579
- ACTIVE = 1,
580
- /**
581
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_STATUS_GRACE_PERIOD = 2;
582
- */
583
- GRACE_PERIOD = 2,
584
- /**
585
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_STATUS_EXPIRED = 3;
586
- */
587
- EXPIRED = 3,
588
- /**
589
- * @generated from protobuf enum value: MACHINE_CREDENTIAL_STATUS_REVOKED = 4;
590
- */
591
- REVOKED = 4
592
- }
593
- /**
594
- * @generated from protobuf enum sid.v1.machine.ImpersonationTargetType
595
- */
596
- export enum ImpersonationTargetType {
597
- /**
598
- * @generated from protobuf enum value: IMPERSONATION_TARGET_TYPE_UNSPECIFIED = 0;
599
- */
600
- UNSPECIFIED = 0,
601
- /**
602
- * @generated from protobuf enum value: IMPERSONATION_TARGET_TYPE_ROLE = 1;
603
- */
604
- ROLE = 1,
605
- /**
606
- * @generated from protobuf enum value: IMPERSONATION_TARGET_TYPE_USER = 2;
607
- */
608
- USER = 2
609
- }
610
- // @generated message type with reflection information, may provide speed optimized methods
611
- class MachineUserInfo$Type extends MessageType<MachineUserInfo> {
612
- constructor() {
613
- super("sid.v1.machine.MachineUserInfo", [
614
- { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
615
- { no: 2, name: "project_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
616
- { no: 3, name: "client_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
617
- { no: 4, name: "display_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
618
- { no: 5, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
619
- { no: 6, name: "machine_type", kind: "enum", T: () => ["sid.v1.machine.MachineUserType", MachineUserType, "MACHINE_USER_TYPE_"] },
620
- { no: 7, name: "status", kind: "enum", T: () => ["sid.v1.machine.MachineUserStatus", MachineUserStatus, "MACHINE_USER_STATUS_"] },
621
- { no: 8, name: "owner_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
622
- { no: 9, name: "owner_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
623
- { no: 10, name: "scopes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
624
- { no: 12, name: "ip_allowlist", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
625
- { no: 13, name: "rate_limit_rpm", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
626
- { no: 14, name: "max_token_lifetime", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
627
- { no: 15, name: "expires_at", kind: "message", T: () => Timestamp },
628
- { no: 16, name: "last_used_at", kind: "message", T: () => Timestamp },
629
- { no: 17, name: "created_at", kind: "message", T: () => Timestamp },
630
- { no: 18, name: "updated_at", kind: "message", T: () => Timestamp }
631
- ]);
632
- }
633
- create(value?: PartialMessage<MachineUserInfo>): MachineUserInfo {
634
- const message = globalThis.Object.create((this.messagePrototype!));
635
- message.id = "";
636
- message.projectId = "";
637
- message.clientId = "";
638
- message.displayName = "";
639
- message.description = "";
640
- message.machineType = 0;
641
- message.status = 0;
642
- message.ownerType = "";
643
- message.ownerId = "";
644
- message.scopes = [];
645
- message.ipAllowlist = [];
646
- message.rateLimitRpm = 0;
647
- message.maxTokenLifetime = 0;
648
- if (value !== undefined)
649
- reflectionMergePartial<MachineUserInfo>(this, message, value);
650
- return message;
651
- }
652
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MachineUserInfo): MachineUserInfo {
653
- let message = target ?? this.create(), end = reader.pos + length;
654
- while (reader.pos < end) {
655
- let [fieldNo, wireType] = reader.tag();
656
- switch (fieldNo) {
657
- case /* string id */ 1:
658
- message.id = reader.string();
659
- break;
660
- case /* string project_id */ 2:
661
- message.projectId = reader.string();
662
- break;
663
- case /* string client_id */ 3:
664
- message.clientId = reader.string();
665
- break;
666
- case /* string display_name */ 4:
667
- message.displayName = reader.string();
668
- break;
669
- case /* string description */ 5:
670
- message.description = reader.string();
671
- break;
672
- case /* sid.v1.machine.MachineUserType machine_type */ 6:
673
- message.machineType = reader.int32();
674
- break;
675
- case /* sid.v1.machine.MachineUserStatus status */ 7:
676
- message.status = reader.int32();
677
- break;
678
- case /* string owner_type */ 8:
679
- message.ownerType = reader.string();
680
- break;
681
- case /* string owner_id */ 9:
682
- message.ownerId = reader.string();
683
- break;
684
- case /* repeated string scopes */ 10:
685
- message.scopes.push(reader.string());
686
- break;
687
- case /* repeated string ip_allowlist */ 12:
688
- message.ipAllowlist.push(reader.string());
689
- break;
690
- case /* int32 rate_limit_rpm */ 13:
691
- message.rateLimitRpm = reader.int32();
692
- break;
693
- case /* int32 max_token_lifetime */ 14:
694
- message.maxTokenLifetime = reader.int32();
695
- break;
696
- case /* google.protobuf.Timestamp expires_at */ 15:
697
- message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
698
- break;
699
- case /* google.protobuf.Timestamp last_used_at */ 16:
700
- message.lastUsedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastUsedAt);
701
- break;
702
- case /* google.protobuf.Timestamp created_at */ 17:
703
- message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
704
- break;
705
- case /* google.protobuf.Timestamp updated_at */ 18:
706
- message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
707
- break;
708
- default:
709
- let u = options.readUnknownField;
710
- if (u === "throw")
711
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
712
- let d = reader.skip(wireType);
713
- if (u !== false)
714
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
715
- }
716
- }
717
- return message;
718
- }
719
- internalBinaryWrite(message: MachineUserInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
720
- /* string id = 1; */
721
- if (message.id !== "")
722
- writer.tag(1, WireType.LengthDelimited).string(message.id);
723
- /* string project_id = 2; */
724
- if (message.projectId !== "")
725
- writer.tag(2, WireType.LengthDelimited).string(message.projectId);
726
- /* string client_id = 3; */
727
- if (message.clientId !== "")
728
- writer.tag(3, WireType.LengthDelimited).string(message.clientId);
729
- /* string display_name = 4; */
730
- if (message.displayName !== "")
731
- writer.tag(4, WireType.LengthDelimited).string(message.displayName);
732
- /* string description = 5; */
733
- if (message.description !== "")
734
- writer.tag(5, WireType.LengthDelimited).string(message.description);
735
- /* sid.v1.machine.MachineUserType machine_type = 6; */
736
- if (message.machineType !== 0)
737
- writer.tag(6, WireType.Varint).int32(message.machineType);
738
- /* sid.v1.machine.MachineUserStatus status = 7; */
739
- if (message.status !== 0)
740
- writer.tag(7, WireType.Varint).int32(message.status);
741
- /* string owner_type = 8; */
742
- if (message.ownerType !== "")
743
- writer.tag(8, WireType.LengthDelimited).string(message.ownerType);
744
- /* string owner_id = 9; */
745
- if (message.ownerId !== "")
746
- writer.tag(9, WireType.LengthDelimited).string(message.ownerId);
747
- /* repeated string scopes = 10; */
748
- for (let i = 0; i < message.scopes.length; i++)
749
- writer.tag(10, WireType.LengthDelimited).string(message.scopes[i]);
750
- /* repeated string ip_allowlist = 12; */
751
- for (let i = 0; i < message.ipAllowlist.length; i++)
752
- writer.tag(12, WireType.LengthDelimited).string(message.ipAllowlist[i]);
753
- /* int32 rate_limit_rpm = 13; */
754
- if (message.rateLimitRpm !== 0)
755
- writer.tag(13, WireType.Varint).int32(message.rateLimitRpm);
756
- /* int32 max_token_lifetime = 14; */
757
- if (message.maxTokenLifetime !== 0)
758
- writer.tag(14, WireType.Varint).int32(message.maxTokenLifetime);
759
- /* google.protobuf.Timestamp expires_at = 15; */
760
- if (message.expiresAt)
761
- Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(15, WireType.LengthDelimited).fork(), options).join();
762
- /* google.protobuf.Timestamp last_used_at = 16; */
763
- if (message.lastUsedAt)
764
- Timestamp.internalBinaryWrite(message.lastUsedAt, writer.tag(16, WireType.LengthDelimited).fork(), options).join();
765
- /* google.protobuf.Timestamp created_at = 17; */
766
- if (message.createdAt)
767
- Timestamp.internalBinaryWrite(message.createdAt, writer.tag(17, WireType.LengthDelimited).fork(), options).join();
768
- /* google.protobuf.Timestamp updated_at = 18; */
769
- if (message.updatedAt)
770
- Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(18, WireType.LengthDelimited).fork(), options).join();
771
- let u = options.writeUnknownFields;
772
- if (u !== false)
773
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
774
- return writer;
775
- }
776
- }
777
- /**
778
- * @generated MessageType for protobuf message sid.v1.machine.MachineUserInfo
779
- */
780
- export const MachineUserInfo = new MachineUserInfo$Type();
781
- // @generated message type with reflection information, may provide speed optimized methods
782
- class MachineCredentialInfo$Type extends MessageType<MachineCredentialInfo> {
783
- constructor() {
784
- super("sid.v1.machine.MachineCredentialInfo", [
785
- { no: 1, name: "kid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
786
- { no: 2, name: "credential_type", kind: "enum", T: () => ["sid.v1.machine.MachineCredentialType", MachineCredentialType, "MACHINE_CREDENTIAL_TYPE_"] },
787
- { no: 3, name: "status", kind: "enum", T: () => ["sid.v1.machine.MachineCredentialStatus", MachineCredentialStatus, "MACHINE_CREDENTIAL_STATUS_"] },
788
- { no: 4, name: "algorithm", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
789
- { no: 5, name: "expires_at", kind: "message", T: () => Timestamp },
790
- { no: 6, name: "created_at", kind: "message", T: () => Timestamp }
791
- ]);
792
- }
793
- create(value?: PartialMessage<MachineCredentialInfo>): MachineCredentialInfo {
794
- const message = globalThis.Object.create((this.messagePrototype!));
795
- message.kid = "";
796
- message.credentialType = 0;
797
- message.status = 0;
798
- message.algorithm = "";
799
- if (value !== undefined)
800
- reflectionMergePartial<MachineCredentialInfo>(this, message, value);
801
- return message;
802
- }
803
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MachineCredentialInfo): MachineCredentialInfo {
804
- let message = target ?? this.create(), end = reader.pos + length;
805
- while (reader.pos < end) {
806
- let [fieldNo, wireType] = reader.tag();
807
- switch (fieldNo) {
808
- case /* string kid */ 1:
809
- message.kid = reader.string();
810
- break;
811
- case /* sid.v1.machine.MachineCredentialType credential_type */ 2:
812
- message.credentialType = reader.int32();
813
- break;
814
- case /* sid.v1.machine.MachineCredentialStatus status */ 3:
815
- message.status = reader.int32();
816
- break;
817
- case /* string algorithm */ 4:
818
- message.algorithm = reader.string();
819
- break;
820
- case /* google.protobuf.Timestamp expires_at */ 5:
821
- message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
822
- break;
823
- case /* google.protobuf.Timestamp created_at */ 6:
824
- message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
825
- break;
826
- default:
827
- let u = options.readUnknownField;
828
- if (u === "throw")
829
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
830
- let d = reader.skip(wireType);
831
- if (u !== false)
832
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
833
- }
834
- }
835
- return message;
836
- }
837
- internalBinaryWrite(message: MachineCredentialInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
838
- /* string kid = 1; */
839
- if (message.kid !== "")
840
- writer.tag(1, WireType.LengthDelimited).string(message.kid);
841
- /* sid.v1.machine.MachineCredentialType credential_type = 2; */
842
- if (message.credentialType !== 0)
843
- writer.tag(2, WireType.Varint).int32(message.credentialType);
844
- /* sid.v1.machine.MachineCredentialStatus status = 3; */
845
- if (message.status !== 0)
846
- writer.tag(3, WireType.Varint).int32(message.status);
847
- /* string algorithm = 4; */
848
- if (message.algorithm !== "")
849
- writer.tag(4, WireType.LengthDelimited).string(message.algorithm);
850
- /* google.protobuf.Timestamp expires_at = 5; */
851
- if (message.expiresAt)
852
- Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
853
- /* google.protobuf.Timestamp created_at = 6; */
854
- if (message.createdAt)
855
- Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
856
- let u = options.writeUnknownFields;
857
- if (u !== false)
858
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
859
- return writer;
860
- }
861
- }
862
- /**
863
- * @generated MessageType for protobuf message sid.v1.machine.MachineCredentialInfo
864
- */
865
- export const MachineCredentialInfo = new MachineCredentialInfo$Type();
866
- // @generated message type with reflection information, may provide speed optimized methods
867
- class ImpersonationGrantInfo$Type extends MessageType<ImpersonationGrantInfo> {
868
- constructor() {
869
- super("sid.v1.machine.ImpersonationGrantInfo", [
870
- { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
871
- { no: 2, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
872
- { no: 3, name: "target_type", kind: "enum", T: () => ["sid.v1.machine.ImpersonationTargetType", ImpersonationTargetType, "IMPERSONATION_TARGET_TYPE_"] },
873
- { no: 4, name: "target", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
874
- { no: 5, name: "allowed_scopes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
875
- { no: 6, name: "created_at", kind: "message", T: () => Timestamp }
876
- ]);
877
- }
878
- create(value?: PartialMessage<ImpersonationGrantInfo>): ImpersonationGrantInfo {
879
- const message = globalThis.Object.create((this.messagePrototype!));
880
- message.id = "";
881
- message.machineUserId = "";
882
- message.targetType = 0;
883
- message.target = "";
884
- message.allowedScopes = [];
885
- if (value !== undefined)
886
- reflectionMergePartial<ImpersonationGrantInfo>(this, message, value);
887
- return message;
888
- }
889
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ImpersonationGrantInfo): ImpersonationGrantInfo {
890
- let message = target ?? this.create(), end = reader.pos + length;
891
- while (reader.pos < end) {
892
- let [fieldNo, wireType] = reader.tag();
893
- switch (fieldNo) {
894
- case /* string id */ 1:
895
- message.id = reader.string();
896
- break;
897
- case /* string machine_user_id */ 2:
898
- message.machineUserId = reader.string();
899
- break;
900
- case /* sid.v1.machine.ImpersonationTargetType target_type */ 3:
901
- message.targetType = reader.int32();
902
- break;
903
- case /* string target */ 4:
904
- message.target = reader.string();
905
- break;
906
- case /* repeated string allowed_scopes */ 5:
907
- message.allowedScopes.push(reader.string());
908
- break;
909
- case /* google.protobuf.Timestamp created_at */ 6:
910
- message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
911
- break;
912
- default:
913
- let u = options.readUnknownField;
914
- if (u === "throw")
915
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
916
- let d = reader.skip(wireType);
917
- if (u !== false)
918
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
919
- }
920
- }
921
- return message;
922
- }
923
- internalBinaryWrite(message: ImpersonationGrantInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
924
- /* string id = 1; */
925
- if (message.id !== "")
926
- writer.tag(1, WireType.LengthDelimited).string(message.id);
927
- /* string machine_user_id = 2; */
928
- if (message.machineUserId !== "")
929
- writer.tag(2, WireType.LengthDelimited).string(message.machineUserId);
930
- /* sid.v1.machine.ImpersonationTargetType target_type = 3; */
931
- if (message.targetType !== 0)
932
- writer.tag(3, WireType.Varint).int32(message.targetType);
933
- /* string target = 4; */
934
- if (message.target !== "")
935
- writer.tag(4, WireType.LengthDelimited).string(message.target);
936
- /* repeated string allowed_scopes = 5; */
937
- for (let i = 0; i < message.allowedScopes.length; i++)
938
- writer.tag(5, WireType.LengthDelimited).string(message.allowedScopes[i]);
939
- /* google.protobuf.Timestamp created_at = 6; */
940
- if (message.createdAt)
941
- Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
942
- let u = options.writeUnknownFields;
943
- if (u !== false)
944
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
945
- return writer;
946
- }
947
- }
948
- /**
949
- * @generated MessageType for protobuf message sid.v1.machine.ImpersonationGrantInfo
950
- */
951
- export const ImpersonationGrantInfo = new ImpersonationGrantInfo$Type();
952
- // @generated message type with reflection information, may provide speed optimized methods
953
- class CreateMachineUserRequest$Type extends MessageType<CreateMachineUserRequest> {
954
- constructor() {
955
- super("sid.v1.machine.CreateMachineUserRequest", [
956
- { no: 1, name: "project_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
957
- { no: 2, name: "display_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
958
- { no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
959
- { no: 4, name: "machine_type", kind: "enum", T: () => ["sid.v1.machine.MachineUserType", MachineUserType, "MACHINE_USER_TYPE_"] },
960
- { no: 5, name: "scopes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
961
- { no: 7, name: "ip_allowlist", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
962
- { no: 8, name: "rate_limit_rpm", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
963
- { no: 9, name: "max_token_lifetime", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
964
- { no: 10, name: "expires_at", kind: "message", T: () => Timestamp }
965
- ]);
966
- }
967
- create(value?: PartialMessage<CreateMachineUserRequest>): CreateMachineUserRequest {
968
- const message = globalThis.Object.create((this.messagePrototype!));
969
- message.projectId = "";
970
- message.displayName = "";
971
- message.description = "";
972
- message.machineType = 0;
973
- message.scopes = [];
974
- message.ipAllowlist = [];
975
- message.rateLimitRpm = 0;
976
- message.maxTokenLifetime = 0;
977
- if (value !== undefined)
978
- reflectionMergePartial<CreateMachineUserRequest>(this, message, value);
979
- return message;
980
- }
981
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateMachineUserRequest): CreateMachineUserRequest {
982
- let message = target ?? this.create(), end = reader.pos + length;
983
- while (reader.pos < end) {
984
- let [fieldNo, wireType] = reader.tag();
985
- switch (fieldNo) {
986
- case /* string project_id */ 1:
987
- message.projectId = reader.string();
988
- break;
989
- case /* string display_name */ 2:
990
- message.displayName = reader.string();
991
- break;
992
- case /* string description */ 3:
993
- message.description = reader.string();
994
- break;
995
- case /* sid.v1.machine.MachineUserType machine_type */ 4:
996
- message.machineType = reader.int32();
997
- break;
998
- case /* repeated string scopes */ 5:
999
- message.scopes.push(reader.string());
1000
- break;
1001
- case /* repeated string ip_allowlist */ 7:
1002
- message.ipAllowlist.push(reader.string());
1003
- break;
1004
- case /* int32 rate_limit_rpm */ 8:
1005
- message.rateLimitRpm = reader.int32();
1006
- break;
1007
- case /* int32 max_token_lifetime */ 9:
1008
- message.maxTokenLifetime = reader.int32();
1009
- break;
1010
- case /* google.protobuf.Timestamp expires_at */ 10:
1011
- message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
1012
- break;
1013
- default:
1014
- let u = options.readUnknownField;
1015
- if (u === "throw")
1016
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1017
- let d = reader.skip(wireType);
1018
- if (u !== false)
1019
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1020
- }
1021
- }
1022
- return message;
1023
- }
1024
- internalBinaryWrite(message: CreateMachineUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1025
- /* string project_id = 1; */
1026
- if (message.projectId !== "")
1027
- writer.tag(1, WireType.LengthDelimited).string(message.projectId);
1028
- /* string display_name = 2; */
1029
- if (message.displayName !== "")
1030
- writer.tag(2, WireType.LengthDelimited).string(message.displayName);
1031
- /* string description = 3; */
1032
- if (message.description !== "")
1033
- writer.tag(3, WireType.LengthDelimited).string(message.description);
1034
- /* sid.v1.machine.MachineUserType machine_type = 4; */
1035
- if (message.machineType !== 0)
1036
- writer.tag(4, WireType.Varint).int32(message.machineType);
1037
- /* repeated string scopes = 5; */
1038
- for (let i = 0; i < message.scopes.length; i++)
1039
- writer.tag(5, WireType.LengthDelimited).string(message.scopes[i]);
1040
- /* repeated string ip_allowlist = 7; */
1041
- for (let i = 0; i < message.ipAllowlist.length; i++)
1042
- writer.tag(7, WireType.LengthDelimited).string(message.ipAllowlist[i]);
1043
- /* int32 rate_limit_rpm = 8; */
1044
- if (message.rateLimitRpm !== 0)
1045
- writer.tag(8, WireType.Varint).int32(message.rateLimitRpm);
1046
- /* int32 max_token_lifetime = 9; */
1047
- if (message.maxTokenLifetime !== 0)
1048
- writer.tag(9, WireType.Varint).int32(message.maxTokenLifetime);
1049
- /* google.protobuf.Timestamp expires_at = 10; */
1050
- if (message.expiresAt)
1051
- Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
1052
- let u = options.writeUnknownFields;
1053
- if (u !== false)
1054
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1055
- return writer;
1056
- }
1057
- }
1058
- /**
1059
- * @generated MessageType for protobuf message sid.v1.machine.CreateMachineUserRequest
1060
- */
1061
- export const CreateMachineUserRequest = new CreateMachineUserRequest$Type();
1062
- // @generated message type with reflection information, may provide speed optimized methods
1063
- class CreateMachineUserResponse$Type extends MessageType<CreateMachineUserResponse> {
1064
- constructor() {
1065
- super("sid.v1.machine.CreateMachineUserResponse", [
1066
- { no: 1, name: "machine_user", kind: "message", T: () => MachineUserInfo }
1067
- ]);
1068
- }
1069
- create(value?: PartialMessage<CreateMachineUserResponse>): CreateMachineUserResponse {
1070
- const message = globalThis.Object.create((this.messagePrototype!));
1071
- if (value !== undefined)
1072
- reflectionMergePartial<CreateMachineUserResponse>(this, message, value);
1073
- return message;
1074
- }
1075
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateMachineUserResponse): CreateMachineUserResponse {
1076
- let message = target ?? this.create(), end = reader.pos + length;
1077
- while (reader.pos < end) {
1078
- let [fieldNo, wireType] = reader.tag();
1079
- switch (fieldNo) {
1080
- case /* sid.v1.machine.MachineUserInfo machine_user */ 1:
1081
- message.machineUser = MachineUserInfo.internalBinaryRead(reader, reader.uint32(), options, message.machineUser);
1082
- break;
1083
- default:
1084
- let u = options.readUnknownField;
1085
- if (u === "throw")
1086
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1087
- let d = reader.skip(wireType);
1088
- if (u !== false)
1089
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1090
- }
1091
- }
1092
- return message;
1093
- }
1094
- internalBinaryWrite(message: CreateMachineUserResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1095
- /* sid.v1.machine.MachineUserInfo machine_user = 1; */
1096
- if (message.machineUser)
1097
- MachineUserInfo.internalBinaryWrite(message.machineUser, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1098
- let u = options.writeUnknownFields;
1099
- if (u !== false)
1100
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1101
- return writer;
1102
- }
1103
- }
1104
- /**
1105
- * @generated MessageType for protobuf message sid.v1.machine.CreateMachineUserResponse
1106
- */
1107
- export const CreateMachineUserResponse = new CreateMachineUserResponse$Type();
1108
- // @generated message type with reflection information, may provide speed optimized methods
1109
- class GetMachineUserRequest$Type extends MessageType<GetMachineUserRequest> {
1110
- constructor() {
1111
- super("sid.v1.machine.GetMachineUserRequest", [
1112
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1113
- ]);
1114
- }
1115
- create(value?: PartialMessage<GetMachineUserRequest>): GetMachineUserRequest {
1116
- const message = globalThis.Object.create((this.messagePrototype!));
1117
- message.machineUserId = "";
1118
- if (value !== undefined)
1119
- reflectionMergePartial<GetMachineUserRequest>(this, message, value);
1120
- return message;
1121
- }
1122
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMachineUserRequest): GetMachineUserRequest {
1123
- let message = target ?? this.create(), end = reader.pos + length;
1124
- while (reader.pos < end) {
1125
- let [fieldNo, wireType] = reader.tag();
1126
- switch (fieldNo) {
1127
- case /* string machine_user_id */ 1:
1128
- message.machineUserId = reader.string();
1129
- break;
1130
- default:
1131
- let u = options.readUnknownField;
1132
- if (u === "throw")
1133
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1134
- let d = reader.skip(wireType);
1135
- if (u !== false)
1136
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1137
- }
1138
- }
1139
- return message;
1140
- }
1141
- internalBinaryWrite(message: GetMachineUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1142
- /* string machine_user_id = 1; */
1143
- if (message.machineUserId !== "")
1144
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1145
- let u = options.writeUnknownFields;
1146
- if (u !== false)
1147
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1148
- return writer;
1149
- }
1150
- }
1151
- /**
1152
- * @generated MessageType for protobuf message sid.v1.machine.GetMachineUserRequest
1153
- */
1154
- export const GetMachineUserRequest = new GetMachineUserRequest$Type();
1155
- // @generated message type with reflection information, may provide speed optimized methods
1156
- class MachineUserResponse$Type extends MessageType<MachineUserResponse> {
1157
- constructor() {
1158
- super("sid.v1.machine.MachineUserResponse", [
1159
- { no: 1, name: "machine_user", kind: "message", T: () => MachineUserInfo }
1160
- ]);
1161
- }
1162
- create(value?: PartialMessage<MachineUserResponse>): MachineUserResponse {
1163
- const message = globalThis.Object.create((this.messagePrototype!));
1164
- if (value !== undefined)
1165
- reflectionMergePartial<MachineUserResponse>(this, message, value);
1166
- return message;
1167
- }
1168
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MachineUserResponse): MachineUserResponse {
1169
- let message = target ?? this.create(), end = reader.pos + length;
1170
- while (reader.pos < end) {
1171
- let [fieldNo, wireType] = reader.tag();
1172
- switch (fieldNo) {
1173
- case /* sid.v1.machine.MachineUserInfo machine_user */ 1:
1174
- message.machineUser = MachineUserInfo.internalBinaryRead(reader, reader.uint32(), options, message.machineUser);
1175
- break;
1176
- default:
1177
- let u = options.readUnknownField;
1178
- if (u === "throw")
1179
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1180
- let d = reader.skip(wireType);
1181
- if (u !== false)
1182
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1183
- }
1184
- }
1185
- return message;
1186
- }
1187
- internalBinaryWrite(message: MachineUserResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1188
- /* sid.v1.machine.MachineUserInfo machine_user = 1; */
1189
- if (message.machineUser)
1190
- MachineUserInfo.internalBinaryWrite(message.machineUser, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1191
- let u = options.writeUnknownFields;
1192
- if (u !== false)
1193
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1194
- return writer;
1195
- }
1196
- }
1197
- /**
1198
- * @generated MessageType for protobuf message sid.v1.machine.MachineUserResponse
1199
- */
1200
- export const MachineUserResponse = new MachineUserResponse$Type();
1201
- // @generated message type with reflection information, may provide speed optimized methods
1202
- class UpdateMachineUserRequest$Type extends MessageType<UpdateMachineUserRequest> {
1203
- constructor() {
1204
- super("sid.v1.machine.UpdateMachineUserRequest", [
1205
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1206
- { no: 2, name: "display_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1207
- { no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1208
- { no: 4, name: "scopes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
1209
- { no: 6, name: "ip_allowlist", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
1210
- { no: 7, name: "rate_limit_rpm", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
1211
- { no: 8, name: "max_token_lifetime", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
1212
- { no: 9, name: "expires_at", kind: "message", T: () => Timestamp }
1213
- ]);
1214
- }
1215
- create(value?: PartialMessage<UpdateMachineUserRequest>): UpdateMachineUserRequest {
1216
- const message = globalThis.Object.create((this.messagePrototype!));
1217
- message.machineUserId = "";
1218
- message.displayName = "";
1219
- message.description = "";
1220
- message.scopes = [];
1221
- message.ipAllowlist = [];
1222
- message.rateLimitRpm = 0;
1223
- message.maxTokenLifetime = 0;
1224
- if (value !== undefined)
1225
- reflectionMergePartial<UpdateMachineUserRequest>(this, message, value);
1226
- return message;
1227
- }
1228
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateMachineUserRequest): UpdateMachineUserRequest {
1229
- let message = target ?? this.create(), end = reader.pos + length;
1230
- while (reader.pos < end) {
1231
- let [fieldNo, wireType] = reader.tag();
1232
- switch (fieldNo) {
1233
- case /* string machine_user_id */ 1:
1234
- message.machineUserId = reader.string();
1235
- break;
1236
- case /* string display_name */ 2:
1237
- message.displayName = reader.string();
1238
- break;
1239
- case /* string description */ 3:
1240
- message.description = reader.string();
1241
- break;
1242
- case /* repeated string scopes */ 4:
1243
- message.scopes.push(reader.string());
1244
- break;
1245
- case /* repeated string ip_allowlist */ 6:
1246
- message.ipAllowlist.push(reader.string());
1247
- break;
1248
- case /* int32 rate_limit_rpm */ 7:
1249
- message.rateLimitRpm = reader.int32();
1250
- break;
1251
- case /* int32 max_token_lifetime */ 8:
1252
- message.maxTokenLifetime = reader.int32();
1253
- break;
1254
- case /* google.protobuf.Timestamp expires_at */ 9:
1255
- message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
1256
- break;
1257
- default:
1258
- let u = options.readUnknownField;
1259
- if (u === "throw")
1260
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1261
- let d = reader.skip(wireType);
1262
- if (u !== false)
1263
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1264
- }
1265
- }
1266
- return message;
1267
- }
1268
- internalBinaryWrite(message: UpdateMachineUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1269
- /* string machine_user_id = 1; */
1270
- if (message.machineUserId !== "")
1271
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1272
- /* string display_name = 2; */
1273
- if (message.displayName !== "")
1274
- writer.tag(2, WireType.LengthDelimited).string(message.displayName);
1275
- /* string description = 3; */
1276
- if (message.description !== "")
1277
- writer.tag(3, WireType.LengthDelimited).string(message.description);
1278
- /* repeated string scopes = 4; */
1279
- for (let i = 0; i < message.scopes.length; i++)
1280
- writer.tag(4, WireType.LengthDelimited).string(message.scopes[i]);
1281
- /* repeated string ip_allowlist = 6; */
1282
- for (let i = 0; i < message.ipAllowlist.length; i++)
1283
- writer.tag(6, WireType.LengthDelimited).string(message.ipAllowlist[i]);
1284
- /* int32 rate_limit_rpm = 7; */
1285
- if (message.rateLimitRpm !== 0)
1286
- writer.tag(7, WireType.Varint).int32(message.rateLimitRpm);
1287
- /* int32 max_token_lifetime = 8; */
1288
- if (message.maxTokenLifetime !== 0)
1289
- writer.tag(8, WireType.Varint).int32(message.maxTokenLifetime);
1290
- /* google.protobuf.Timestamp expires_at = 9; */
1291
- if (message.expiresAt)
1292
- Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
1293
- let u = options.writeUnknownFields;
1294
- if (u !== false)
1295
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1296
- return writer;
1297
- }
1298
- }
1299
- /**
1300
- * @generated MessageType for protobuf message sid.v1.machine.UpdateMachineUserRequest
1301
- */
1302
- export const UpdateMachineUserRequest = new UpdateMachineUserRequest$Type();
1303
- // @generated message type with reflection information, may provide speed optimized methods
1304
- class DeleteMachineUserRequest$Type extends MessageType<DeleteMachineUserRequest> {
1305
- constructor() {
1306
- super("sid.v1.machine.DeleteMachineUserRequest", [
1307
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1308
- ]);
1309
- }
1310
- create(value?: PartialMessage<DeleteMachineUserRequest>): DeleteMachineUserRequest {
1311
- const message = globalThis.Object.create((this.messagePrototype!));
1312
- message.machineUserId = "";
1313
- if (value !== undefined)
1314
- reflectionMergePartial<DeleteMachineUserRequest>(this, message, value);
1315
- return message;
1316
- }
1317
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMachineUserRequest): DeleteMachineUserRequest {
1318
- let message = target ?? this.create(), end = reader.pos + length;
1319
- while (reader.pos < end) {
1320
- let [fieldNo, wireType] = reader.tag();
1321
- switch (fieldNo) {
1322
- case /* string machine_user_id */ 1:
1323
- message.machineUserId = reader.string();
1324
- break;
1325
- default:
1326
- let u = options.readUnknownField;
1327
- if (u === "throw")
1328
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1329
- let d = reader.skip(wireType);
1330
- if (u !== false)
1331
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1332
- }
1333
- }
1334
- return message;
1335
- }
1336
- internalBinaryWrite(message: DeleteMachineUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1337
- /* string machine_user_id = 1; */
1338
- if (message.machineUserId !== "")
1339
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1340
- let u = options.writeUnknownFields;
1341
- if (u !== false)
1342
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1343
- return writer;
1344
- }
1345
- }
1346
- /**
1347
- * @generated MessageType for protobuf message sid.v1.machine.DeleteMachineUserRequest
1348
- */
1349
- export const DeleteMachineUserRequest = new DeleteMachineUserRequest$Type();
1350
- // @generated message type with reflection information, may provide speed optimized methods
1351
- class DeleteMachineUserResponse$Type extends MessageType<DeleteMachineUserResponse> {
1352
- constructor() {
1353
- super("sid.v1.machine.DeleteMachineUserResponse", []);
1354
- }
1355
- create(value?: PartialMessage<DeleteMachineUserResponse>): DeleteMachineUserResponse {
1356
- const message = globalThis.Object.create((this.messagePrototype!));
1357
- if (value !== undefined)
1358
- reflectionMergePartial<DeleteMachineUserResponse>(this, message, value);
1359
- return message;
1360
- }
1361
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMachineUserResponse): DeleteMachineUserResponse {
1362
- let message = target ?? this.create(), end = reader.pos + length;
1363
- while (reader.pos < end) {
1364
- let [fieldNo, wireType] = reader.tag();
1365
- switch (fieldNo) {
1366
- default:
1367
- let u = options.readUnknownField;
1368
- if (u === "throw")
1369
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1370
- let d = reader.skip(wireType);
1371
- if (u !== false)
1372
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1373
- }
1374
- }
1375
- return message;
1376
- }
1377
- internalBinaryWrite(message: DeleteMachineUserResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1378
- let u = options.writeUnknownFields;
1379
- if (u !== false)
1380
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1381
- return writer;
1382
- }
1383
- }
1384
- /**
1385
- * @generated MessageType for protobuf message sid.v1.machine.DeleteMachineUserResponse
1386
- */
1387
- export const DeleteMachineUserResponse = new DeleteMachineUserResponse$Type();
1388
- // @generated message type with reflection information, may provide speed optimized methods
1389
- class ListMachineUsersRequest$Type extends MessageType<ListMachineUsersRequest> {
1390
- constructor() {
1391
- super("sid.v1.machine.ListMachineUsersRequest", [
1392
- { no: 1, name: "project_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1393
- ]);
1394
- }
1395
- create(value?: PartialMessage<ListMachineUsersRequest>): ListMachineUsersRequest {
1396
- const message = globalThis.Object.create((this.messagePrototype!));
1397
- message.projectId = "";
1398
- if (value !== undefined)
1399
- reflectionMergePartial<ListMachineUsersRequest>(this, message, value);
1400
- return message;
1401
- }
1402
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMachineUsersRequest): ListMachineUsersRequest {
1403
- let message = target ?? this.create(), end = reader.pos + length;
1404
- while (reader.pos < end) {
1405
- let [fieldNo, wireType] = reader.tag();
1406
- switch (fieldNo) {
1407
- case /* string project_id */ 1:
1408
- message.projectId = reader.string();
1409
- break;
1410
- default:
1411
- let u = options.readUnknownField;
1412
- if (u === "throw")
1413
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1414
- let d = reader.skip(wireType);
1415
- if (u !== false)
1416
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1417
- }
1418
- }
1419
- return message;
1420
- }
1421
- internalBinaryWrite(message: ListMachineUsersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1422
- /* string project_id = 1; */
1423
- if (message.projectId !== "")
1424
- writer.tag(1, WireType.LengthDelimited).string(message.projectId);
1425
- let u = options.writeUnknownFields;
1426
- if (u !== false)
1427
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1428
- return writer;
1429
- }
1430
- }
1431
- /**
1432
- * @generated MessageType for protobuf message sid.v1.machine.ListMachineUsersRequest
1433
- */
1434
- export const ListMachineUsersRequest = new ListMachineUsersRequest$Type();
1435
- // @generated message type with reflection information, may provide speed optimized methods
1436
- class ListMachineUsersResponse$Type extends MessageType<ListMachineUsersResponse> {
1437
- constructor() {
1438
- super("sid.v1.machine.ListMachineUsersResponse", [
1439
- { no: 1, name: "machine_users", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MachineUserInfo }
1440
- ]);
1441
- }
1442
- create(value?: PartialMessage<ListMachineUsersResponse>): ListMachineUsersResponse {
1443
- const message = globalThis.Object.create((this.messagePrototype!));
1444
- message.machineUsers = [];
1445
- if (value !== undefined)
1446
- reflectionMergePartial<ListMachineUsersResponse>(this, message, value);
1447
- return message;
1448
- }
1449
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMachineUsersResponse): ListMachineUsersResponse {
1450
- let message = target ?? this.create(), end = reader.pos + length;
1451
- while (reader.pos < end) {
1452
- let [fieldNo, wireType] = reader.tag();
1453
- switch (fieldNo) {
1454
- case /* repeated sid.v1.machine.MachineUserInfo machine_users */ 1:
1455
- message.machineUsers.push(MachineUserInfo.internalBinaryRead(reader, reader.uint32(), options));
1456
- break;
1457
- default:
1458
- let u = options.readUnknownField;
1459
- if (u === "throw")
1460
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1461
- let d = reader.skip(wireType);
1462
- if (u !== false)
1463
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1464
- }
1465
- }
1466
- return message;
1467
- }
1468
- internalBinaryWrite(message: ListMachineUsersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1469
- /* repeated sid.v1.machine.MachineUserInfo machine_users = 1; */
1470
- for (let i = 0; i < message.machineUsers.length; i++)
1471
- MachineUserInfo.internalBinaryWrite(message.machineUsers[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1472
- let u = options.writeUnknownFields;
1473
- if (u !== false)
1474
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1475
- return writer;
1476
- }
1477
- }
1478
- /**
1479
- * @generated MessageType for protobuf message sid.v1.machine.ListMachineUsersResponse
1480
- */
1481
- export const ListMachineUsersResponse = new ListMachineUsersResponse$Type();
1482
- // @generated message type with reflection information, may provide speed optimized methods
1483
- class SuspendMachineUserRequest$Type extends MessageType<SuspendMachineUserRequest> {
1484
- constructor() {
1485
- super("sid.v1.machine.SuspendMachineUserRequest", [
1486
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1487
- ]);
1488
- }
1489
- create(value?: PartialMessage<SuspendMachineUserRequest>): SuspendMachineUserRequest {
1490
- const message = globalThis.Object.create((this.messagePrototype!));
1491
- message.machineUserId = "";
1492
- if (value !== undefined)
1493
- reflectionMergePartial<SuspendMachineUserRequest>(this, message, value);
1494
- return message;
1495
- }
1496
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SuspendMachineUserRequest): SuspendMachineUserRequest {
1497
- let message = target ?? this.create(), end = reader.pos + length;
1498
- while (reader.pos < end) {
1499
- let [fieldNo, wireType] = reader.tag();
1500
- switch (fieldNo) {
1501
- case /* string machine_user_id */ 1:
1502
- message.machineUserId = reader.string();
1503
- break;
1504
- default:
1505
- let u = options.readUnknownField;
1506
- if (u === "throw")
1507
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1508
- let d = reader.skip(wireType);
1509
- if (u !== false)
1510
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1511
- }
1512
- }
1513
- return message;
1514
- }
1515
- internalBinaryWrite(message: SuspendMachineUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1516
- /* string machine_user_id = 1; */
1517
- if (message.machineUserId !== "")
1518
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1519
- let u = options.writeUnknownFields;
1520
- if (u !== false)
1521
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1522
- return writer;
1523
- }
1524
- }
1525
- /**
1526
- * @generated MessageType for protobuf message sid.v1.machine.SuspendMachineUserRequest
1527
- */
1528
- export const SuspendMachineUserRequest = new SuspendMachineUserRequest$Type();
1529
- // @generated message type with reflection information, may provide speed optimized methods
1530
- class ReactivateMachineUserRequest$Type extends MessageType<ReactivateMachineUserRequest> {
1531
- constructor() {
1532
- super("sid.v1.machine.ReactivateMachineUserRequest", [
1533
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1534
- ]);
1535
- }
1536
- create(value?: PartialMessage<ReactivateMachineUserRequest>): ReactivateMachineUserRequest {
1537
- const message = globalThis.Object.create((this.messagePrototype!));
1538
- message.machineUserId = "";
1539
- if (value !== undefined)
1540
- reflectionMergePartial<ReactivateMachineUserRequest>(this, message, value);
1541
- return message;
1542
- }
1543
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReactivateMachineUserRequest): ReactivateMachineUserRequest {
1544
- let message = target ?? this.create(), end = reader.pos + length;
1545
- while (reader.pos < end) {
1546
- let [fieldNo, wireType] = reader.tag();
1547
- switch (fieldNo) {
1548
- case /* string machine_user_id */ 1:
1549
- message.machineUserId = reader.string();
1550
- break;
1551
- default:
1552
- let u = options.readUnknownField;
1553
- if (u === "throw")
1554
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1555
- let d = reader.skip(wireType);
1556
- if (u !== false)
1557
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1558
- }
1559
- }
1560
- return message;
1561
- }
1562
- internalBinaryWrite(message: ReactivateMachineUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1563
- /* string machine_user_id = 1; */
1564
- if (message.machineUserId !== "")
1565
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1566
- let u = options.writeUnknownFields;
1567
- if (u !== false)
1568
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1569
- return writer;
1570
- }
1571
- }
1572
- /**
1573
- * @generated MessageType for protobuf message sid.v1.machine.ReactivateMachineUserRequest
1574
- */
1575
- export const ReactivateMachineUserRequest = new ReactivateMachineUserRequest$Type();
1576
- // @generated message type with reflection information, may provide speed optimized methods
1577
- class AddMachineCredentialRequest$Type extends MessageType<AddMachineCredentialRequest> {
1578
- constructor() {
1579
- super("sid.v1.machine.AddMachineCredentialRequest", [
1580
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1581
- { no: 2, name: "credential_type", kind: "enum", T: () => ["sid.v1.machine.MachineCredentialType", MachineCredentialType, "MACHINE_CREDENTIAL_TYPE_"] },
1582
- { no: 3, name: "algorithm", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1583
- { no: 4, name: "public_key_pem", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1584
- { no: 5, name: "expires_at", kind: "message", T: () => Timestamp }
1585
- ]);
1586
- }
1587
- create(value?: PartialMessage<AddMachineCredentialRequest>): AddMachineCredentialRequest {
1588
- const message = globalThis.Object.create((this.messagePrototype!));
1589
- message.machineUserId = "";
1590
- message.credentialType = 0;
1591
- message.algorithm = "";
1592
- message.publicKeyPem = "";
1593
- if (value !== undefined)
1594
- reflectionMergePartial<AddMachineCredentialRequest>(this, message, value);
1595
- return message;
1596
- }
1597
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddMachineCredentialRequest): AddMachineCredentialRequest {
1598
- let message = target ?? this.create(), end = reader.pos + length;
1599
- while (reader.pos < end) {
1600
- let [fieldNo, wireType] = reader.tag();
1601
- switch (fieldNo) {
1602
- case /* string machine_user_id */ 1:
1603
- message.machineUserId = reader.string();
1604
- break;
1605
- case /* sid.v1.machine.MachineCredentialType credential_type */ 2:
1606
- message.credentialType = reader.int32();
1607
- break;
1608
- case /* string algorithm */ 3:
1609
- message.algorithm = reader.string();
1610
- break;
1611
- case /* string public_key_pem */ 4:
1612
- message.publicKeyPem = reader.string();
1613
- break;
1614
- case /* google.protobuf.Timestamp expires_at */ 5:
1615
- message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
1616
- break;
1617
- default:
1618
- let u = options.readUnknownField;
1619
- if (u === "throw")
1620
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1621
- let d = reader.skip(wireType);
1622
- if (u !== false)
1623
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1624
- }
1625
- }
1626
- return message;
1627
- }
1628
- internalBinaryWrite(message: AddMachineCredentialRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1629
- /* string machine_user_id = 1; */
1630
- if (message.machineUserId !== "")
1631
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1632
- /* sid.v1.machine.MachineCredentialType credential_type = 2; */
1633
- if (message.credentialType !== 0)
1634
- writer.tag(2, WireType.Varint).int32(message.credentialType);
1635
- /* string algorithm = 3; */
1636
- if (message.algorithm !== "")
1637
- writer.tag(3, WireType.LengthDelimited).string(message.algorithm);
1638
- /* string public_key_pem = 4; */
1639
- if (message.publicKeyPem !== "")
1640
- writer.tag(4, WireType.LengthDelimited).string(message.publicKeyPem);
1641
- /* google.protobuf.Timestamp expires_at = 5; */
1642
- if (message.expiresAt)
1643
- Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
1644
- let u = options.writeUnknownFields;
1645
- if (u !== false)
1646
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1647
- return writer;
1648
- }
1649
- }
1650
- /**
1651
- * @generated MessageType for protobuf message sid.v1.machine.AddMachineCredentialRequest
1652
- */
1653
- export const AddMachineCredentialRequest = new AddMachineCredentialRequest$Type();
1654
- // @generated message type with reflection information, may provide speed optimized methods
1655
- class AddMachineCredentialResponse$Type extends MessageType<AddMachineCredentialResponse> {
1656
- constructor() {
1657
- super("sid.v1.machine.AddMachineCredentialResponse", [
1658
- { no: 1, name: "credential", kind: "message", T: () => MachineCredentialInfo },
1659
- { no: 2, name: "client_secret", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1660
- ]);
1661
- }
1662
- create(value?: PartialMessage<AddMachineCredentialResponse>): AddMachineCredentialResponse {
1663
- const message = globalThis.Object.create((this.messagePrototype!));
1664
- message.clientSecret = "";
1665
- if (value !== undefined)
1666
- reflectionMergePartial<AddMachineCredentialResponse>(this, message, value);
1667
- return message;
1668
- }
1669
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddMachineCredentialResponse): AddMachineCredentialResponse {
1670
- let message = target ?? this.create(), end = reader.pos + length;
1671
- while (reader.pos < end) {
1672
- let [fieldNo, wireType] = reader.tag();
1673
- switch (fieldNo) {
1674
- case /* sid.v1.machine.MachineCredentialInfo credential */ 1:
1675
- message.credential = MachineCredentialInfo.internalBinaryRead(reader, reader.uint32(), options, message.credential);
1676
- break;
1677
- case /* string client_secret */ 2:
1678
- message.clientSecret = reader.string();
1679
- break;
1680
- default:
1681
- let u = options.readUnknownField;
1682
- if (u === "throw")
1683
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1684
- let d = reader.skip(wireType);
1685
- if (u !== false)
1686
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1687
- }
1688
- }
1689
- return message;
1690
- }
1691
- internalBinaryWrite(message: AddMachineCredentialResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1692
- /* sid.v1.machine.MachineCredentialInfo credential = 1; */
1693
- if (message.credential)
1694
- MachineCredentialInfo.internalBinaryWrite(message.credential, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1695
- /* string client_secret = 2; */
1696
- if (message.clientSecret !== "")
1697
- writer.tag(2, WireType.LengthDelimited).string(message.clientSecret);
1698
- let u = options.writeUnknownFields;
1699
- if (u !== false)
1700
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1701
- return writer;
1702
- }
1703
- }
1704
- /**
1705
- * @generated MessageType for protobuf message sid.v1.machine.AddMachineCredentialResponse
1706
- */
1707
- export const AddMachineCredentialResponse = new AddMachineCredentialResponse$Type();
1708
- // @generated message type with reflection information, may provide speed optimized methods
1709
- class RevokeMachineCredentialRequest$Type extends MessageType<RevokeMachineCredentialRequest> {
1710
- constructor() {
1711
- super("sid.v1.machine.RevokeMachineCredentialRequest", [
1712
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1713
- { no: 2, name: "kid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1714
- ]);
1715
- }
1716
- create(value?: PartialMessage<RevokeMachineCredentialRequest>): RevokeMachineCredentialRequest {
1717
- const message = globalThis.Object.create((this.messagePrototype!));
1718
- message.machineUserId = "";
1719
- message.kid = "";
1720
- if (value !== undefined)
1721
- reflectionMergePartial<RevokeMachineCredentialRequest>(this, message, value);
1722
- return message;
1723
- }
1724
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RevokeMachineCredentialRequest): RevokeMachineCredentialRequest {
1725
- let message = target ?? this.create(), end = reader.pos + length;
1726
- while (reader.pos < end) {
1727
- let [fieldNo, wireType] = reader.tag();
1728
- switch (fieldNo) {
1729
- case /* string machine_user_id */ 1:
1730
- message.machineUserId = reader.string();
1731
- break;
1732
- case /* string kid */ 2:
1733
- message.kid = reader.string();
1734
- break;
1735
- default:
1736
- let u = options.readUnknownField;
1737
- if (u === "throw")
1738
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1739
- let d = reader.skip(wireType);
1740
- if (u !== false)
1741
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1742
- }
1743
- }
1744
- return message;
1745
- }
1746
- internalBinaryWrite(message: RevokeMachineCredentialRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1747
- /* string machine_user_id = 1; */
1748
- if (message.machineUserId !== "")
1749
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1750
- /* string kid = 2; */
1751
- if (message.kid !== "")
1752
- writer.tag(2, WireType.LengthDelimited).string(message.kid);
1753
- let u = options.writeUnknownFields;
1754
- if (u !== false)
1755
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1756
- return writer;
1757
- }
1758
- }
1759
- /**
1760
- * @generated MessageType for protobuf message sid.v1.machine.RevokeMachineCredentialRequest
1761
- */
1762
- export const RevokeMachineCredentialRequest = new RevokeMachineCredentialRequest$Type();
1763
- // @generated message type with reflection information, may provide speed optimized methods
1764
- class RevokeMachineCredentialResponse$Type extends MessageType<RevokeMachineCredentialResponse> {
1765
- constructor() {
1766
- super("sid.v1.machine.RevokeMachineCredentialResponse", []);
1767
- }
1768
- create(value?: PartialMessage<RevokeMachineCredentialResponse>): RevokeMachineCredentialResponse {
1769
- const message = globalThis.Object.create((this.messagePrototype!));
1770
- if (value !== undefined)
1771
- reflectionMergePartial<RevokeMachineCredentialResponse>(this, message, value);
1772
- return message;
1773
- }
1774
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RevokeMachineCredentialResponse): RevokeMachineCredentialResponse {
1775
- let message = target ?? this.create(), end = reader.pos + length;
1776
- while (reader.pos < end) {
1777
- let [fieldNo, wireType] = reader.tag();
1778
- switch (fieldNo) {
1779
- default:
1780
- let u = options.readUnknownField;
1781
- if (u === "throw")
1782
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1783
- let d = reader.skip(wireType);
1784
- if (u !== false)
1785
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1786
- }
1787
- }
1788
- return message;
1789
- }
1790
- internalBinaryWrite(message: RevokeMachineCredentialResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1791
- let u = options.writeUnknownFields;
1792
- if (u !== false)
1793
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1794
- return writer;
1795
- }
1796
- }
1797
- /**
1798
- * @generated MessageType for protobuf message sid.v1.machine.RevokeMachineCredentialResponse
1799
- */
1800
- export const RevokeMachineCredentialResponse = new RevokeMachineCredentialResponse$Type();
1801
- // @generated message type with reflection information, may provide speed optimized methods
1802
- class ListMachineCredentialsRequest$Type extends MessageType<ListMachineCredentialsRequest> {
1803
- constructor() {
1804
- super("sid.v1.machine.ListMachineCredentialsRequest", [
1805
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1806
- ]);
1807
- }
1808
- create(value?: PartialMessage<ListMachineCredentialsRequest>): ListMachineCredentialsRequest {
1809
- const message = globalThis.Object.create((this.messagePrototype!));
1810
- message.machineUserId = "";
1811
- if (value !== undefined)
1812
- reflectionMergePartial<ListMachineCredentialsRequest>(this, message, value);
1813
- return message;
1814
- }
1815
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMachineCredentialsRequest): ListMachineCredentialsRequest {
1816
- let message = target ?? this.create(), end = reader.pos + length;
1817
- while (reader.pos < end) {
1818
- let [fieldNo, wireType] = reader.tag();
1819
- switch (fieldNo) {
1820
- case /* string machine_user_id */ 1:
1821
- message.machineUserId = reader.string();
1822
- break;
1823
- default:
1824
- let u = options.readUnknownField;
1825
- if (u === "throw")
1826
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1827
- let d = reader.skip(wireType);
1828
- if (u !== false)
1829
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1830
- }
1831
- }
1832
- return message;
1833
- }
1834
- internalBinaryWrite(message: ListMachineCredentialsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1835
- /* string machine_user_id = 1; */
1836
- if (message.machineUserId !== "")
1837
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1838
- let u = options.writeUnknownFields;
1839
- if (u !== false)
1840
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1841
- return writer;
1842
- }
1843
- }
1844
- /**
1845
- * @generated MessageType for protobuf message sid.v1.machine.ListMachineCredentialsRequest
1846
- */
1847
- export const ListMachineCredentialsRequest = new ListMachineCredentialsRequest$Type();
1848
- // @generated message type with reflection information, may provide speed optimized methods
1849
- class ListMachineCredentialsResponse$Type extends MessageType<ListMachineCredentialsResponse> {
1850
- constructor() {
1851
- super("sid.v1.machine.ListMachineCredentialsResponse", [
1852
- { no: 1, name: "credentials", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MachineCredentialInfo }
1853
- ]);
1854
- }
1855
- create(value?: PartialMessage<ListMachineCredentialsResponse>): ListMachineCredentialsResponse {
1856
- const message = globalThis.Object.create((this.messagePrototype!));
1857
- message.credentials = [];
1858
- if (value !== undefined)
1859
- reflectionMergePartial<ListMachineCredentialsResponse>(this, message, value);
1860
- return message;
1861
- }
1862
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMachineCredentialsResponse): ListMachineCredentialsResponse {
1863
- let message = target ?? this.create(), end = reader.pos + length;
1864
- while (reader.pos < end) {
1865
- let [fieldNo, wireType] = reader.tag();
1866
- switch (fieldNo) {
1867
- case /* repeated sid.v1.machine.MachineCredentialInfo credentials */ 1:
1868
- message.credentials.push(MachineCredentialInfo.internalBinaryRead(reader, reader.uint32(), options));
1869
- break;
1870
- default:
1871
- let u = options.readUnknownField;
1872
- if (u === "throw")
1873
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1874
- let d = reader.skip(wireType);
1875
- if (u !== false)
1876
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1877
- }
1878
- }
1879
- return message;
1880
- }
1881
- internalBinaryWrite(message: ListMachineCredentialsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1882
- /* repeated sid.v1.machine.MachineCredentialInfo credentials = 1; */
1883
- for (let i = 0; i < message.credentials.length; i++)
1884
- MachineCredentialInfo.internalBinaryWrite(message.credentials[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1885
- let u = options.writeUnknownFields;
1886
- if (u !== false)
1887
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1888
- return writer;
1889
- }
1890
- }
1891
- /**
1892
- * @generated MessageType for protobuf message sid.v1.machine.ListMachineCredentialsResponse
1893
- */
1894
- export const ListMachineCredentialsResponse = new ListMachineCredentialsResponse$Type();
1895
- // @generated message type with reflection information, may provide speed optimized methods
1896
- class RotateMachineCredentialRequest$Type extends MessageType<RotateMachineCredentialRequest> {
1897
- constructor() {
1898
- super("sid.v1.machine.RotateMachineCredentialRequest", [
1899
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1900
- { no: 2, name: "kid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1901
- { no: 3, name: "algorithm", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1902
- { no: 4, name: "public_key_pem", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1903
- { no: 5, name: "expires_at", kind: "message", T: () => Timestamp }
1904
- ]);
1905
- }
1906
- create(value?: PartialMessage<RotateMachineCredentialRequest>): RotateMachineCredentialRequest {
1907
- const message = globalThis.Object.create((this.messagePrototype!));
1908
- message.machineUserId = "";
1909
- message.kid = "";
1910
- message.algorithm = "";
1911
- message.publicKeyPem = "";
1912
- if (value !== undefined)
1913
- reflectionMergePartial<RotateMachineCredentialRequest>(this, message, value);
1914
- return message;
1915
- }
1916
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RotateMachineCredentialRequest): RotateMachineCredentialRequest {
1917
- let message = target ?? this.create(), end = reader.pos + length;
1918
- while (reader.pos < end) {
1919
- let [fieldNo, wireType] = reader.tag();
1920
- switch (fieldNo) {
1921
- case /* string machine_user_id */ 1:
1922
- message.machineUserId = reader.string();
1923
- break;
1924
- case /* string kid */ 2:
1925
- message.kid = reader.string();
1926
- break;
1927
- case /* string algorithm */ 3:
1928
- message.algorithm = reader.string();
1929
- break;
1930
- case /* string public_key_pem */ 4:
1931
- message.publicKeyPem = reader.string();
1932
- break;
1933
- case /* google.protobuf.Timestamp expires_at */ 5:
1934
- message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
1935
- break;
1936
- default:
1937
- let u = options.readUnknownField;
1938
- if (u === "throw")
1939
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1940
- let d = reader.skip(wireType);
1941
- if (u !== false)
1942
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1943
- }
1944
- }
1945
- return message;
1946
- }
1947
- internalBinaryWrite(message: RotateMachineCredentialRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1948
- /* string machine_user_id = 1; */
1949
- if (message.machineUserId !== "")
1950
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
1951
- /* string kid = 2; */
1952
- if (message.kid !== "")
1953
- writer.tag(2, WireType.LengthDelimited).string(message.kid);
1954
- /* string algorithm = 3; */
1955
- if (message.algorithm !== "")
1956
- writer.tag(3, WireType.LengthDelimited).string(message.algorithm);
1957
- /* string public_key_pem = 4; */
1958
- if (message.publicKeyPem !== "")
1959
- writer.tag(4, WireType.LengthDelimited).string(message.publicKeyPem);
1960
- /* google.protobuf.Timestamp expires_at = 5; */
1961
- if (message.expiresAt)
1962
- Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
1963
- let u = options.writeUnknownFields;
1964
- if (u !== false)
1965
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1966
- return writer;
1967
- }
1968
- }
1969
- /**
1970
- * @generated MessageType for protobuf message sid.v1.machine.RotateMachineCredentialRequest
1971
- */
1972
- export const RotateMachineCredentialRequest = new RotateMachineCredentialRequest$Type();
1973
- // @generated message type with reflection information, may provide speed optimized methods
1974
- class RotateMachineCredentialResponse$Type extends MessageType<RotateMachineCredentialResponse> {
1975
- constructor() {
1976
- super("sid.v1.machine.RotateMachineCredentialResponse", [
1977
- { no: 1, name: "old_credential", kind: "message", T: () => MachineCredentialInfo },
1978
- { no: 2, name: "new_credential", kind: "message", T: () => MachineCredentialInfo },
1979
- { no: 3, name: "client_secret", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1980
- ]);
1981
- }
1982
- create(value?: PartialMessage<RotateMachineCredentialResponse>): RotateMachineCredentialResponse {
1983
- const message = globalThis.Object.create((this.messagePrototype!));
1984
- message.clientSecret = "";
1985
- if (value !== undefined)
1986
- reflectionMergePartial<RotateMachineCredentialResponse>(this, message, value);
1987
- return message;
1988
- }
1989
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RotateMachineCredentialResponse): RotateMachineCredentialResponse {
1990
- let message = target ?? this.create(), end = reader.pos + length;
1991
- while (reader.pos < end) {
1992
- let [fieldNo, wireType] = reader.tag();
1993
- switch (fieldNo) {
1994
- case /* sid.v1.machine.MachineCredentialInfo old_credential */ 1:
1995
- message.oldCredential = MachineCredentialInfo.internalBinaryRead(reader, reader.uint32(), options, message.oldCredential);
1996
- break;
1997
- case /* sid.v1.machine.MachineCredentialInfo new_credential */ 2:
1998
- message.newCredential = MachineCredentialInfo.internalBinaryRead(reader, reader.uint32(), options, message.newCredential);
1999
- break;
2000
- case /* string client_secret */ 3:
2001
- message.clientSecret = reader.string();
2002
- break;
2003
- default:
2004
- let u = options.readUnknownField;
2005
- if (u === "throw")
2006
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2007
- let d = reader.skip(wireType);
2008
- if (u !== false)
2009
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2010
- }
2011
- }
2012
- return message;
2013
- }
2014
- internalBinaryWrite(message: RotateMachineCredentialResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
2015
- /* sid.v1.machine.MachineCredentialInfo old_credential = 1; */
2016
- if (message.oldCredential)
2017
- MachineCredentialInfo.internalBinaryWrite(message.oldCredential, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
2018
- /* sid.v1.machine.MachineCredentialInfo new_credential = 2; */
2019
- if (message.newCredential)
2020
- MachineCredentialInfo.internalBinaryWrite(message.newCredential, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
2021
- /* string client_secret = 3; */
2022
- if (message.clientSecret !== "")
2023
- writer.tag(3, WireType.LengthDelimited).string(message.clientSecret);
2024
- let u = options.writeUnknownFields;
2025
- if (u !== false)
2026
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2027
- return writer;
2028
- }
2029
- }
2030
- /**
2031
- * @generated MessageType for protobuf message sid.v1.machine.RotateMachineCredentialResponse
2032
- */
2033
- export const RotateMachineCredentialResponse = new RotateMachineCredentialResponse$Type();
2034
- // @generated message type with reflection information, may provide speed optimized methods
2035
- class GrantImpersonationRequest$Type extends MessageType<GrantImpersonationRequest> {
2036
- constructor() {
2037
- super("sid.v1.machine.GrantImpersonationRequest", [
2038
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
2039
- { no: 2, name: "target_type", kind: "enum", T: () => ["sid.v1.machine.ImpersonationTargetType", ImpersonationTargetType, "IMPERSONATION_TARGET_TYPE_"] },
2040
- { no: 3, name: "target", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
2041
- { no: 4, name: "allowed_scopes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
2042
- ]);
2043
- }
2044
- create(value?: PartialMessage<GrantImpersonationRequest>): GrantImpersonationRequest {
2045
- const message = globalThis.Object.create((this.messagePrototype!));
2046
- message.machineUserId = "";
2047
- message.targetType = 0;
2048
- message.target = "";
2049
- message.allowedScopes = [];
2050
- if (value !== undefined)
2051
- reflectionMergePartial<GrantImpersonationRequest>(this, message, value);
2052
- return message;
2053
- }
2054
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GrantImpersonationRequest): GrantImpersonationRequest {
2055
- let message = target ?? this.create(), end = reader.pos + length;
2056
- while (reader.pos < end) {
2057
- let [fieldNo, wireType] = reader.tag();
2058
- switch (fieldNo) {
2059
- case /* string machine_user_id */ 1:
2060
- message.machineUserId = reader.string();
2061
- break;
2062
- case /* sid.v1.machine.ImpersonationTargetType target_type */ 2:
2063
- message.targetType = reader.int32();
2064
- break;
2065
- case /* string target */ 3:
2066
- message.target = reader.string();
2067
- break;
2068
- case /* repeated string allowed_scopes */ 4:
2069
- message.allowedScopes.push(reader.string());
2070
- break;
2071
- default:
2072
- let u = options.readUnknownField;
2073
- if (u === "throw")
2074
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2075
- let d = reader.skip(wireType);
2076
- if (u !== false)
2077
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2078
- }
2079
- }
2080
- return message;
2081
- }
2082
- internalBinaryWrite(message: GrantImpersonationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
2083
- /* string machine_user_id = 1; */
2084
- if (message.machineUserId !== "")
2085
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
2086
- /* sid.v1.machine.ImpersonationTargetType target_type = 2; */
2087
- if (message.targetType !== 0)
2088
- writer.tag(2, WireType.Varint).int32(message.targetType);
2089
- /* string target = 3; */
2090
- if (message.target !== "")
2091
- writer.tag(3, WireType.LengthDelimited).string(message.target);
2092
- /* repeated string allowed_scopes = 4; */
2093
- for (let i = 0; i < message.allowedScopes.length; i++)
2094
- writer.tag(4, WireType.LengthDelimited).string(message.allowedScopes[i]);
2095
- let u = options.writeUnknownFields;
2096
- if (u !== false)
2097
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2098
- return writer;
2099
- }
2100
- }
2101
- /**
2102
- * @generated MessageType for protobuf message sid.v1.machine.GrantImpersonationRequest
2103
- */
2104
- export const GrantImpersonationRequest = new GrantImpersonationRequest$Type();
2105
- // @generated message type with reflection information, may provide speed optimized methods
2106
- class GrantImpersonationResponse$Type extends MessageType<GrantImpersonationResponse> {
2107
- constructor() {
2108
- super("sid.v1.machine.GrantImpersonationResponse", [
2109
- { no: 1, name: "grant", kind: "message", T: () => ImpersonationGrantInfo }
2110
- ]);
2111
- }
2112
- create(value?: PartialMessage<GrantImpersonationResponse>): GrantImpersonationResponse {
2113
- const message = globalThis.Object.create((this.messagePrototype!));
2114
- if (value !== undefined)
2115
- reflectionMergePartial<GrantImpersonationResponse>(this, message, value);
2116
- return message;
2117
- }
2118
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GrantImpersonationResponse): GrantImpersonationResponse {
2119
- let message = target ?? this.create(), end = reader.pos + length;
2120
- while (reader.pos < end) {
2121
- let [fieldNo, wireType] = reader.tag();
2122
- switch (fieldNo) {
2123
- case /* sid.v1.machine.ImpersonationGrantInfo grant */ 1:
2124
- message.grant = ImpersonationGrantInfo.internalBinaryRead(reader, reader.uint32(), options, message.grant);
2125
- break;
2126
- default:
2127
- let u = options.readUnknownField;
2128
- if (u === "throw")
2129
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2130
- let d = reader.skip(wireType);
2131
- if (u !== false)
2132
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2133
- }
2134
- }
2135
- return message;
2136
- }
2137
- internalBinaryWrite(message: GrantImpersonationResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
2138
- /* sid.v1.machine.ImpersonationGrantInfo grant = 1; */
2139
- if (message.grant)
2140
- ImpersonationGrantInfo.internalBinaryWrite(message.grant, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
2141
- let u = options.writeUnknownFields;
2142
- if (u !== false)
2143
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2144
- return writer;
2145
- }
2146
- }
2147
- /**
2148
- * @generated MessageType for protobuf message sid.v1.machine.GrantImpersonationResponse
2149
- */
2150
- export const GrantImpersonationResponse = new GrantImpersonationResponse$Type();
2151
- // @generated message type with reflection information, may provide speed optimized methods
2152
- class RevokeImpersonationRequest$Type extends MessageType<RevokeImpersonationRequest> {
2153
- constructor() {
2154
- super("sid.v1.machine.RevokeImpersonationRequest", [
2155
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
2156
- { no: 2, name: "target_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
2157
- { no: 3, name: "target", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
2158
- ]);
2159
- }
2160
- create(value?: PartialMessage<RevokeImpersonationRequest>): RevokeImpersonationRequest {
2161
- const message = globalThis.Object.create((this.messagePrototype!));
2162
- message.machineUserId = "";
2163
- message.targetType = "";
2164
- message.target = "";
2165
- if (value !== undefined)
2166
- reflectionMergePartial<RevokeImpersonationRequest>(this, message, value);
2167
- return message;
2168
- }
2169
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RevokeImpersonationRequest): RevokeImpersonationRequest {
2170
- let message = target ?? this.create(), end = reader.pos + length;
2171
- while (reader.pos < end) {
2172
- let [fieldNo, wireType] = reader.tag();
2173
- switch (fieldNo) {
2174
- case /* string machine_user_id */ 1:
2175
- message.machineUserId = reader.string();
2176
- break;
2177
- case /* string target_type */ 2:
2178
- message.targetType = reader.string();
2179
- break;
2180
- case /* string target */ 3:
2181
- message.target = reader.string();
2182
- break;
2183
- default:
2184
- let u = options.readUnknownField;
2185
- if (u === "throw")
2186
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2187
- let d = reader.skip(wireType);
2188
- if (u !== false)
2189
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2190
- }
2191
- }
2192
- return message;
2193
- }
2194
- internalBinaryWrite(message: RevokeImpersonationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
2195
- /* string machine_user_id = 1; */
2196
- if (message.machineUserId !== "")
2197
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
2198
- /* string target_type = 2; */
2199
- if (message.targetType !== "")
2200
- writer.tag(2, WireType.LengthDelimited).string(message.targetType);
2201
- /* string target = 3; */
2202
- if (message.target !== "")
2203
- writer.tag(3, WireType.LengthDelimited).string(message.target);
2204
- let u = options.writeUnknownFields;
2205
- if (u !== false)
2206
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2207
- return writer;
2208
- }
2209
- }
2210
- /**
2211
- * @generated MessageType for protobuf message sid.v1.machine.RevokeImpersonationRequest
2212
- */
2213
- export const RevokeImpersonationRequest = new RevokeImpersonationRequest$Type();
2214
- // @generated message type with reflection information, may provide speed optimized methods
2215
- class RevokeImpersonationResponse$Type extends MessageType<RevokeImpersonationResponse> {
2216
- constructor() {
2217
- super("sid.v1.machine.RevokeImpersonationResponse", []);
2218
- }
2219
- create(value?: PartialMessage<RevokeImpersonationResponse>): RevokeImpersonationResponse {
2220
- const message = globalThis.Object.create((this.messagePrototype!));
2221
- if (value !== undefined)
2222
- reflectionMergePartial<RevokeImpersonationResponse>(this, message, value);
2223
- return message;
2224
- }
2225
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RevokeImpersonationResponse): RevokeImpersonationResponse {
2226
- let message = target ?? this.create(), end = reader.pos + length;
2227
- while (reader.pos < end) {
2228
- let [fieldNo, wireType] = reader.tag();
2229
- switch (fieldNo) {
2230
- default:
2231
- let u = options.readUnknownField;
2232
- if (u === "throw")
2233
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2234
- let d = reader.skip(wireType);
2235
- if (u !== false)
2236
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2237
- }
2238
- }
2239
- return message;
2240
- }
2241
- internalBinaryWrite(message: RevokeImpersonationResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
2242
- let u = options.writeUnknownFields;
2243
- if (u !== false)
2244
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2245
- return writer;
2246
- }
2247
- }
2248
- /**
2249
- * @generated MessageType for protobuf message sid.v1.machine.RevokeImpersonationResponse
2250
- */
2251
- export const RevokeImpersonationResponse = new RevokeImpersonationResponse$Type();
2252
- // @generated message type with reflection information, may provide speed optimized methods
2253
- class ListImpersonationGrantsRequest$Type extends MessageType<ListImpersonationGrantsRequest> {
2254
- constructor() {
2255
- super("sid.v1.machine.ListImpersonationGrantsRequest", [
2256
- { no: 1, name: "machine_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
2257
- ]);
2258
- }
2259
- create(value?: PartialMessage<ListImpersonationGrantsRequest>): ListImpersonationGrantsRequest {
2260
- const message = globalThis.Object.create((this.messagePrototype!));
2261
- message.machineUserId = "";
2262
- if (value !== undefined)
2263
- reflectionMergePartial<ListImpersonationGrantsRequest>(this, message, value);
2264
- return message;
2265
- }
2266
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListImpersonationGrantsRequest): ListImpersonationGrantsRequest {
2267
- let message = target ?? this.create(), end = reader.pos + length;
2268
- while (reader.pos < end) {
2269
- let [fieldNo, wireType] = reader.tag();
2270
- switch (fieldNo) {
2271
- case /* string machine_user_id */ 1:
2272
- message.machineUserId = reader.string();
2273
- break;
2274
- default:
2275
- let u = options.readUnknownField;
2276
- if (u === "throw")
2277
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2278
- let d = reader.skip(wireType);
2279
- if (u !== false)
2280
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2281
- }
2282
- }
2283
- return message;
2284
- }
2285
- internalBinaryWrite(message: ListImpersonationGrantsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
2286
- /* string machine_user_id = 1; */
2287
- if (message.machineUserId !== "")
2288
- writer.tag(1, WireType.LengthDelimited).string(message.machineUserId);
2289
- let u = options.writeUnknownFields;
2290
- if (u !== false)
2291
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2292
- return writer;
2293
- }
2294
- }
2295
- /**
2296
- * @generated MessageType for protobuf message sid.v1.machine.ListImpersonationGrantsRequest
2297
- */
2298
- export const ListImpersonationGrantsRequest = new ListImpersonationGrantsRequest$Type();
2299
- // @generated message type with reflection information, may provide speed optimized methods
2300
- class ListImpersonationGrantsResponse$Type extends MessageType<ListImpersonationGrantsResponse> {
2301
- constructor() {
2302
- super("sid.v1.machine.ListImpersonationGrantsResponse", [
2303
- { no: 1, name: "grants", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ImpersonationGrantInfo }
2304
- ]);
2305
- }
2306
- create(value?: PartialMessage<ListImpersonationGrantsResponse>): ListImpersonationGrantsResponse {
2307
- const message = globalThis.Object.create((this.messagePrototype!));
2308
- message.grants = [];
2309
- if (value !== undefined)
2310
- reflectionMergePartial<ListImpersonationGrantsResponse>(this, message, value);
2311
- return message;
2312
- }
2313
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListImpersonationGrantsResponse): ListImpersonationGrantsResponse {
2314
- let message = target ?? this.create(), end = reader.pos + length;
2315
- while (reader.pos < end) {
2316
- let [fieldNo, wireType] = reader.tag();
2317
- switch (fieldNo) {
2318
- case /* repeated sid.v1.machine.ImpersonationGrantInfo grants */ 1:
2319
- message.grants.push(ImpersonationGrantInfo.internalBinaryRead(reader, reader.uint32(), options));
2320
- break;
2321
- default:
2322
- let u = options.readUnknownField;
2323
- if (u === "throw")
2324
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2325
- let d = reader.skip(wireType);
2326
- if (u !== false)
2327
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2328
- }
2329
- }
2330
- return message;
2331
- }
2332
- internalBinaryWrite(message: ListImpersonationGrantsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
2333
- /* repeated sid.v1.machine.ImpersonationGrantInfo grants = 1; */
2334
- for (let i = 0; i < message.grants.length; i++)
2335
- ImpersonationGrantInfo.internalBinaryWrite(message.grants[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
2336
- let u = options.writeUnknownFields;
2337
- if (u !== false)
2338
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2339
- return writer;
2340
- }
2341
- }
2342
- /**
2343
- * @generated MessageType for protobuf message sid.v1.machine.ListImpersonationGrantsResponse
2344
- */
2345
- export const ListImpersonationGrantsResponse = new ListImpersonationGrantsResponse$Type();
2346
- /**
2347
- * @generated ServiceType for protobuf service sid.v1.machine.MachineUserService
2348
- */
2349
- export const MachineUserService = new ServiceType("sid.v1.machine.MachineUserService", [
2350
- { name: "CreateMachineUser", options: { "google.api.http": { post: "/v1/machine-users", body: "*" } }, I: CreateMachineUserRequest, O: CreateMachineUserResponse },
2351
- { name: "GetMachineUser", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/machine-users/{machine_user_id}" } }, I: GetMachineUserRequest, O: MachineUserResponse },
2352
- { name: "UpdateMachineUser", idempotency: "IDEMPOTENT", options: { "google.api.http": { patch: "/v1/machine-users/{machine_user_id}", body: "*" } }, I: UpdateMachineUserRequest, O: MachineUserResponse },
2353
- { name: "DeleteMachineUser", idempotency: "IDEMPOTENT", options: { "google.api.http": { delete: "/v1/machine-users/{machine_user_id}" } }, I: DeleteMachineUserRequest, O: DeleteMachineUserResponse },
2354
- { name: "ListMachineUsers", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/projects/{project_id}/machine-users" } }, I: ListMachineUsersRequest, O: ListMachineUsersResponse },
2355
- { name: "SuspendMachineUser", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/machine-users/{machine_user_id}/suspend", body: "*" } }, I: SuspendMachineUserRequest, O: MachineUserResponse },
2356
- { name: "ReactivateMachineUser", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/machine-users/{machine_user_id}/reactivate", body: "*" } }, I: ReactivateMachineUserRequest, O: MachineUserResponse },
2357
- { name: "AddMachineCredential", options: { "google.api.http": { post: "/v1/machine-users/{machine_user_id}/credentials", body: "*" } }, I: AddMachineCredentialRequest, O: AddMachineCredentialResponse },
2358
- { name: "RevokeMachineCredential", idempotency: "IDEMPOTENT", options: { "google.api.http": { delete: "/v1/machine-users/{machine_user_id}/credentials/{kid}" } }, I: RevokeMachineCredentialRequest, O: RevokeMachineCredentialResponse },
2359
- { name: "ListMachineCredentials", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/machine-users/{machine_user_id}/credentials" } }, I: ListMachineCredentialsRequest, O: ListMachineCredentialsResponse },
2360
- { name: "RotateMachineCredential", options: { "google.api.http": { post: "/v1/machine-users/{machine_user_id}/credentials/{kid}/rotate", body: "*" } }, I: RotateMachineCredentialRequest, O: RotateMachineCredentialResponse },
2361
- { name: "GrantImpersonation", idempotency: "IDEMPOTENT", options: { "google.api.http": { post: "/v1/machine-users/{machine_user_id}/impersonation", body: "*" } }, I: GrantImpersonationRequest, O: GrantImpersonationResponse },
2362
- { name: "RevokeImpersonation", idempotency: "IDEMPOTENT", options: { "google.api.http": { delete: "/v1/machine-users/{machine_user_id}/impersonation/{target_type}/{target}" } }, I: RevokeImpersonationRequest, O: RevokeImpersonationResponse },
2363
- { name: "ListImpersonationGrants", idempotency: "NO_SIDE_EFFECTS", options: { "google.api.http": { get: "/v1/machine-users/{machine_user_id}/impersonation" } }, I: ListImpersonationGrantsRequest, O: ListImpersonationGrantsResponse }
2364
- ]);