@structured-id/proto 0.7.0 → 0.8.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.
@@ -7,6 +7,7 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
7
7
  import { MessageType } from "@protobuf-ts/runtime";
8
8
  import { MachineUserId } from "../ids/ids.js";
9
9
  import { ResourceId } from "../ids/ids.js";
10
+ import { Empty } from "../../../google/protobuf/empty.js";
10
11
  import { Duration } from "../../../google/protobuf/duration.js";
11
12
  import { ProvisioningConnectorId } from "../ids/ids.js";
12
13
  import { Timestamp } from "../../../google/protobuf/timestamp.js";
@@ -172,6 +173,27 @@ export interface RoleAssignment {
172
173
  * @generated from protobuf field: optional sid.v1.authz.AssignmentProvenance provenance = 12
173
174
  */
174
175
  provenance?: AssignmentProvenance;
176
+ /**
177
+ * Present when the assignment administers the policies of the protected
178
+ * resource `scope` names. Independent of `admin`: neither implies the other.
179
+ *
180
+ * @generated from protobuf field: optional sid.v1.authz.PolicyAuthority policy_admin = 13
181
+ */
182
+ policyAdmin?: PolicyAuthority;
183
+ }
184
+ /**
185
+ * What an assignment may do with the policies of its protected resource.
186
+ *
187
+ * @generated from protobuf message sid.v1.authz.PolicyAuthority
188
+ */
189
+ export interface PolicyAuthority {
190
+ /**
191
+ * The permitted operations, at least one. An assignment scoped to anything
192
+ * but one protected resource cannot carry them.
193
+ *
194
+ * @generated from protobuf field: repeated sid.v1.authz.PolicyOperation operations = 1
195
+ */
196
+ operations: PolicyOperation[];
175
197
  }
176
198
  /**
177
199
  * What an administrative assignment may administer. Every field is an
@@ -261,9 +283,49 @@ export interface AssignmentProvenance {
261
283
  */
262
284
  approvedCeiling: string[];
263
285
  }
286
+ /**
287
+ * What a policy applies to within its installation. A decision on a
288
+ * protected resource applies the installation's, its parent project's and
289
+ * its own policies; a decision on a project, the installation's and the
290
+ * project's. A prohibition at any of them denies.
291
+ *
292
+ * @generated from protobuf message sid.v1.authz.PolicyScope
293
+ */
294
+ export interface PolicyScope {
295
+ /**
296
+ * @generated from protobuf oneof: scope
297
+ */
298
+ scope: {
299
+ oneofKind: "installation";
300
+ /**
301
+ * Every decision of this installation.
302
+ *
303
+ * @generated from protobuf field: google.protobuf.Empty installation = 1
304
+ */
305
+ installation: Empty;
306
+ } | {
307
+ oneofKind: "projectId";
308
+ /**
309
+ * Decisions on one project of this installation and on the protected
310
+ * resources of its applications (UUID text).
311
+ *
312
+ * @generated from protobuf field: string project_id = 2
313
+ */
314
+ projectId: string;
315
+ } | {
316
+ oneofKind: "resource";
317
+ /**
318
+ * Decisions on one registered protected resource of this installation.
319
+ *
320
+ * @generated from protobuf field: sid.v1.ids.ResourceId resource = 3
321
+ */
322
+ resource: ResourceId;
323
+ } | {
324
+ oneofKind: undefined;
325
+ };
326
+ }
264
327
  /**
265
328
  * Policy represents a Cedar policy (ABAC).
266
- * Scoped to a project.
267
329
  *
268
330
  * @generated from protobuf message sid.v1.authz.Policy
269
331
  */
@@ -273,9 +335,11 @@ export interface Policy {
273
335
  */
274
336
  id: string;
275
337
  /**
276
- * @generated from protobuf field: string project_id = 2
338
+ * What the policy applies to; set by its creation and never changed.
339
+ *
340
+ * @generated from protobuf field: sid.v1.authz.PolicyScope scope = 10
277
341
  */
278
- projectId: string;
342
+ scope?: PolicyScope;
279
343
  /**
280
344
  * @generated from protobuf field: string name = 3
281
345
  */
@@ -310,6 +374,12 @@ export interface Policy {
310
374
  * @generated from protobuf field: google.protobuf.Timestamp updated_at = 9
311
375
  */
312
376
  updatedAt?: Timestamp;
377
+ /**
378
+ * Stored revision: 0 when created, moved on by every change.
379
+ *
380
+ * @generated from protobuf field: uint64 revision = 11
381
+ */
382
+ revision: bigint;
313
383
  }
314
384
  /**
315
385
  * One permission question: may a subject perform `action` on `target`.
@@ -848,6 +918,15 @@ export interface AssignRoleRequest {
848
918
  * @generated from protobuf field: optional sid.v1.authz.AdminEnvelope admin = 9
849
919
  */
850
920
  admin?: AdminEnvelope;
921
+ /**
922
+ * Makes the assignment administer the policies of the protected resource
923
+ * `scope` names. Granting it requires the root of the scope, or an
924
+ * assignment of the same role holding POLICY_OPERATION_REDELEGATE and every
925
+ * operation granted here, with `expires_at` no later than its own.
926
+ *
927
+ * @generated from protobuf field: optional sid.v1.authz.PolicyAuthority policy_admin = 10
928
+ */
929
+ policyAdmin?: PolicyAuthority;
851
930
  }
852
931
  /**
853
932
  * @generated from protobuf message sid.v1.authz.AssignRoleResponse
@@ -1119,9 +1198,11 @@ export interface ListGroupMembersResponse {
1119
1198
  */
1120
1199
  export interface CreatePolicyRequest {
1121
1200
  /**
1122
- * @generated from protobuf field: string project_id = 1
1201
+ * What the new policy applies to; required.
1202
+ *
1203
+ * @generated from protobuf field: sid.v1.authz.PolicyScope scope = 7
1123
1204
  */
1124
- projectId: string;
1205
+ scope?: PolicyScope;
1125
1206
  /**
1126
1207
  * @generated from protobuf field: string name = 2
1127
1208
  */
@@ -1223,9 +1304,11 @@ export interface DeletePolicyResponse {
1223
1304
  */
1224
1305
  export interface ListPoliciesRequest {
1225
1306
  /**
1226
- * @generated from protobuf field: string project_id = 1
1307
+ * The scope whose own policies are listed; required.
1308
+ *
1309
+ * @generated from protobuf field: sid.v1.authz.PolicyScope scope = 4
1227
1310
  */
1228
- projectId: string;
1311
+ scope?: PolicyScope;
1229
1312
  /**
1230
1313
  * @generated from protobuf field: int32 page_size = 2
1231
1314
  */
@@ -1271,11 +1354,11 @@ export interface EvaluatePolicyRequest {
1271
1354
  [key: string]: string;
1272
1355
  };
1273
1356
  /**
1274
- * Evaluate only policies in this project.
1357
+ * The scope whose own policies are evaluated; required.
1275
1358
  *
1276
- * @generated from protobuf field: optional string project_id = 5
1359
+ * @generated from protobuf field: sid.v1.authz.PolicyScope scope = 6
1277
1360
  */
1278
- projectId?: string;
1361
+ scope?: PolicyScope;
1279
1362
  }
1280
1363
  /**
1281
1364
  * @generated from protobuf message sid.v1.authz.EvaluatePolicyResponse
@@ -1676,6 +1759,36 @@ export declare enum AdminOperation {
1676
1759
  */
1677
1760
  REDELEGATE = 4
1678
1761
  }
1762
+ /**
1763
+ * A policy administration operation an assignment may permit on the policies
1764
+ * of its own protected resource. None implies another.
1765
+ *
1766
+ * @generated from protobuf enum sid.v1.authz.PolicyOperation
1767
+ */
1768
+ export declare enum PolicyOperation {
1769
+ /**
1770
+ * @generated from protobuf enum value: POLICY_OPERATION_UNSPECIFIED = 0;
1771
+ */
1772
+ UNSPECIFIED = 0,
1773
+ /**
1774
+ * Read the resource's policies.
1775
+ *
1776
+ * @generated from protobuf enum value: POLICY_OPERATION_READ = 1;
1777
+ */
1778
+ READ = 1,
1779
+ /**
1780
+ * Create, change, disable and remove them.
1781
+ *
1782
+ * @generated from protobuf enum value: POLICY_OPERATION_EDIT = 2;
1783
+ */
1784
+ EDIT = 2,
1785
+ /**
1786
+ * Grant this authority, narrower or equal, to another holder.
1787
+ *
1788
+ * @generated from protobuf enum value: POLICY_OPERATION_REDELEGATE = 3;
1789
+ */
1790
+ REDELEGATE = 3
1791
+ }
1679
1792
  /**
1680
1793
  * A kind of principal an administrative assignment lets its holder assign
1681
1794
  * roles to. A SCIM provisioning connector is never an administered recipient.
@@ -1811,6 +1924,16 @@ declare class RoleAssignment$Type extends MessageType<RoleAssignment> {
1811
1924
  * @generated MessageType for protobuf message sid.v1.authz.RoleAssignment
1812
1925
  */
1813
1926
  export declare const RoleAssignment: RoleAssignment$Type;
1927
+ declare class PolicyAuthority$Type extends MessageType<PolicyAuthority> {
1928
+ constructor();
1929
+ create(value?: PartialMessage<PolicyAuthority>): PolicyAuthority;
1930
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyAuthority): PolicyAuthority;
1931
+ internalBinaryWrite(message: PolicyAuthority, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
1932
+ }
1933
+ /**
1934
+ * @generated MessageType for protobuf message sid.v1.authz.PolicyAuthority
1935
+ */
1936
+ export declare const PolicyAuthority: PolicyAuthority$Type;
1814
1937
  declare class AdminEnvelope$Type extends MessageType<AdminEnvelope> {
1815
1938
  constructor();
1816
1939
  create(value?: PartialMessage<AdminEnvelope>): AdminEnvelope;
@@ -1831,6 +1954,16 @@ declare class AssignmentProvenance$Type extends MessageType<AssignmentProvenance
1831
1954
  * @generated MessageType for protobuf message sid.v1.authz.AssignmentProvenance
1832
1955
  */
1833
1956
  export declare const AssignmentProvenance: AssignmentProvenance$Type;
1957
+ declare class PolicyScope$Type extends MessageType<PolicyScope> {
1958
+ constructor();
1959
+ create(value?: PartialMessage<PolicyScope>): PolicyScope;
1960
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyScope): PolicyScope;
1961
+ internalBinaryWrite(message: PolicyScope, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
1962
+ }
1963
+ /**
1964
+ * @generated MessageType for protobuf message sid.v1.authz.PolicyScope
1965
+ */
1966
+ export declare const PolicyScope: PolicyScope$Type;
1834
1967
  declare class Policy$Type extends MessageType<Policy> {
1835
1968
  constructor();
1836
1969
  create(value?: PartialMessage<Policy>): Policy;
@@ -9,6 +9,7 @@ import { reflectionMergePartial } from "@protobuf-ts/runtime";
9
9
  import { MessageType } from "@protobuf-ts/runtime";
10
10
  import { MachineUserId } from "../ids/ids.js";
11
11
  import { ResourceId } from "../ids/ids.js";
12
+ import { Empty } from "../../../google/protobuf/empty.js";
12
13
  import { Duration } from "../../../google/protobuf/duration.js";
13
14
  import { ProvisioningConnectorId } from "../ids/ids.js";
14
15
  import { Timestamp } from "../../../google/protobuf/timestamp.js";
@@ -101,6 +102,37 @@ export var AdminOperation;
101
102
  */
102
103
  AdminOperation[AdminOperation["REDELEGATE"] = 4] = "REDELEGATE";
103
104
  })(AdminOperation || (AdminOperation = {}));
105
+ /**
106
+ * A policy administration operation an assignment may permit on the policies
107
+ * of its own protected resource. None implies another.
108
+ *
109
+ * @generated from protobuf enum sid.v1.authz.PolicyOperation
110
+ */
111
+ export var PolicyOperation;
112
+ (function (PolicyOperation) {
113
+ /**
114
+ * @generated from protobuf enum value: POLICY_OPERATION_UNSPECIFIED = 0;
115
+ */
116
+ PolicyOperation[PolicyOperation["UNSPECIFIED"] = 0] = "UNSPECIFIED";
117
+ /**
118
+ * Read the resource's policies.
119
+ *
120
+ * @generated from protobuf enum value: POLICY_OPERATION_READ = 1;
121
+ */
122
+ PolicyOperation[PolicyOperation["READ"] = 1] = "READ";
123
+ /**
124
+ * Create, change, disable and remove them.
125
+ *
126
+ * @generated from protobuf enum value: POLICY_OPERATION_EDIT = 2;
127
+ */
128
+ PolicyOperation[PolicyOperation["EDIT"] = 2] = "EDIT";
129
+ /**
130
+ * Grant this authority, narrower or equal, to another holder.
131
+ *
132
+ * @generated from protobuf enum value: POLICY_OPERATION_REDELEGATE = 3;
133
+ */
134
+ PolicyOperation[PolicyOperation["REDELEGATE"] = 3] = "REDELEGATE";
135
+ })(PolicyOperation || (PolicyOperation = {}));
104
136
  /**
105
137
  * A kind of principal an administrative assignment lets its holder assign
106
138
  * roles to. A SCIM provisioning connector is never an administered recipient.
@@ -401,7 +433,8 @@ class RoleAssignment$Type extends MessageType {
401
433
  { no: 6, name: "expires_at", kind: "message", T: () => Timestamp },
402
434
  { no: 7, name: "created_at", kind: "message", T: () => Timestamp },
403
435
  { no: 11, name: "admin", kind: "message", T: () => AdminEnvelope },
404
- { no: 12, name: "provenance", kind: "message", T: () => AssignmentProvenance }
436
+ { no: 12, name: "provenance", kind: "message", T: () => AssignmentProvenance },
437
+ { no: 13, name: "policy_admin", kind: "message", T: () => PolicyAuthority }
405
438
  ]);
406
439
  }
407
440
  create(value) {
@@ -469,6 +502,9 @@ class RoleAssignment$Type extends MessageType {
469
502
  case /* optional sid.v1.authz.AssignmentProvenance provenance */ 12:
470
503
  message.provenance = AssignmentProvenance.internalBinaryRead(reader, reader.uint32(), options, message.provenance);
471
504
  break;
505
+ case /* optional sid.v1.authz.PolicyAuthority policy_admin */ 13:
506
+ message.policyAdmin = PolicyAuthority.internalBinaryRead(reader, reader.uint32(), options, message.policyAdmin);
507
+ break;
472
508
  default:
473
509
  let u = options.readUnknownField;
474
510
  if (u === "throw")
@@ -517,6 +553,9 @@ class RoleAssignment$Type extends MessageType {
517
553
  /* optional sid.v1.authz.AssignmentProvenance provenance = 12; */
518
554
  if (message.provenance)
519
555
  AssignmentProvenance.internalBinaryWrite(message.provenance, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
556
+ /* optional sid.v1.authz.PolicyAuthority policy_admin = 13; */
557
+ if (message.policyAdmin)
558
+ PolicyAuthority.internalBinaryWrite(message.policyAdmin, writer.tag(13, WireType.LengthDelimited).fork(), options).join();
520
559
  let u = options.writeUnknownFields;
521
560
  if (u !== false)
522
561
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -528,6 +567,61 @@ class RoleAssignment$Type extends MessageType {
528
567
  */
529
568
  export const RoleAssignment = new RoleAssignment$Type();
530
569
  // @generated message type with reflection information, may provide speed optimized methods
570
+ class PolicyAuthority$Type extends MessageType {
571
+ constructor() {
572
+ super("sid.v1.authz.PolicyAuthority", [
573
+ { no: 1, name: "operations", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["sid.v1.authz.PolicyOperation", PolicyOperation, "POLICY_OPERATION_"] }
574
+ ]);
575
+ }
576
+ create(value) {
577
+ const message = globalThis.Object.create((this.messagePrototype));
578
+ message.operations = [];
579
+ if (value !== undefined)
580
+ reflectionMergePartial(this, message, value);
581
+ return message;
582
+ }
583
+ internalBinaryRead(reader, length, options, target) {
584
+ let message = target ?? this.create(), end = reader.pos + length;
585
+ while (reader.pos < end) {
586
+ let [fieldNo, wireType] = reader.tag();
587
+ switch (fieldNo) {
588
+ case /* repeated sid.v1.authz.PolicyOperation operations */ 1:
589
+ if (wireType === WireType.LengthDelimited)
590
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
591
+ message.operations.push(reader.int32());
592
+ else
593
+ message.operations.push(reader.int32());
594
+ break;
595
+ default:
596
+ let u = options.readUnknownField;
597
+ if (u === "throw")
598
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
599
+ let d = reader.skip(wireType);
600
+ if (u !== false)
601
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
602
+ }
603
+ }
604
+ return message;
605
+ }
606
+ internalBinaryWrite(message, writer, options) {
607
+ /* repeated sid.v1.authz.PolicyOperation operations = 1; */
608
+ if (message.operations.length) {
609
+ writer.tag(1, WireType.LengthDelimited).fork();
610
+ for (let i = 0; i < message.operations.length; i++)
611
+ writer.int32(message.operations[i]);
612
+ writer.join();
613
+ }
614
+ let u = options.writeUnknownFields;
615
+ if (u !== false)
616
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
617
+ return writer;
618
+ }
619
+ }
620
+ /**
621
+ * @generated MessageType for protobuf message sid.v1.authz.PolicyAuthority
622
+ */
623
+ export const PolicyAuthority = new PolicyAuthority$Type();
624
+ // @generated message type with reflection information, may provide speed optimized methods
531
625
  class AdminEnvelope$Type extends MessageType {
532
626
  constructor() {
533
627
  super("sid.v1.authz.AdminEnvelope", [
@@ -698,28 +792,99 @@ class AssignmentProvenance$Type extends MessageType {
698
792
  */
699
793
  export const AssignmentProvenance = new AssignmentProvenance$Type();
700
794
  // @generated message type with reflection information, may provide speed optimized methods
795
+ class PolicyScope$Type extends MessageType {
796
+ constructor() {
797
+ super("sid.v1.authz.PolicyScope", [
798
+ { no: 1, name: "installation", kind: "message", oneof: "scope", T: () => Empty },
799
+ { no: 2, name: "project_id", kind: "scalar", oneof: "scope", T: 9 /*ScalarType.STRING*/ },
800
+ { no: 3, name: "resource", kind: "message", oneof: "scope", T: () => ResourceId }
801
+ ]);
802
+ }
803
+ create(value) {
804
+ const message = globalThis.Object.create((this.messagePrototype));
805
+ message.scope = { oneofKind: undefined };
806
+ if (value !== undefined)
807
+ reflectionMergePartial(this, message, value);
808
+ return message;
809
+ }
810
+ internalBinaryRead(reader, length, options, target) {
811
+ let message = target ?? this.create(), end = reader.pos + length;
812
+ while (reader.pos < end) {
813
+ let [fieldNo, wireType] = reader.tag();
814
+ switch (fieldNo) {
815
+ case /* google.protobuf.Empty installation */ 1:
816
+ message.scope = {
817
+ oneofKind: "installation",
818
+ installation: Empty.internalBinaryRead(reader, reader.uint32(), options, message.scope.installation)
819
+ };
820
+ break;
821
+ case /* string project_id */ 2:
822
+ message.scope = {
823
+ oneofKind: "projectId",
824
+ projectId: reader.string()
825
+ };
826
+ break;
827
+ case /* sid.v1.ids.ResourceId resource */ 3:
828
+ message.scope = {
829
+ oneofKind: "resource",
830
+ resource: ResourceId.internalBinaryRead(reader, reader.uint32(), options, message.scope.resource)
831
+ };
832
+ break;
833
+ default:
834
+ let u = options.readUnknownField;
835
+ if (u === "throw")
836
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
837
+ let d = reader.skip(wireType);
838
+ if (u !== false)
839
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
840
+ }
841
+ }
842
+ return message;
843
+ }
844
+ internalBinaryWrite(message, writer, options) {
845
+ /* google.protobuf.Empty installation = 1; */
846
+ if (message.scope.oneofKind === "installation")
847
+ Empty.internalBinaryWrite(message.scope.installation, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
848
+ /* string project_id = 2; */
849
+ if (message.scope.oneofKind === "projectId")
850
+ writer.tag(2, WireType.LengthDelimited).string(message.scope.projectId);
851
+ /* sid.v1.ids.ResourceId resource = 3; */
852
+ if (message.scope.oneofKind === "resource")
853
+ ResourceId.internalBinaryWrite(message.scope.resource, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
854
+ let u = options.writeUnknownFields;
855
+ if (u !== false)
856
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
857
+ return writer;
858
+ }
859
+ }
860
+ /**
861
+ * @generated MessageType for protobuf message sid.v1.authz.PolicyScope
862
+ */
863
+ export const PolicyScope = new PolicyScope$Type();
864
+ // @generated message type with reflection information, may provide speed optimized methods
701
865
  class Policy$Type extends MessageType {
702
866
  constructor() {
703
867
  super("sid.v1.authz.Policy", [
704
868
  { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
705
- { no: 2, name: "project_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
869
+ { no: 10, name: "scope", kind: "message", T: () => PolicyScope },
706
870
  { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
707
871
  { no: 4, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
708
872
  { no: 5, name: "policy_text", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
709
873
  { no: 6, name: "effect", kind: "enum", T: () => ["sid.v1.authz.PolicyEffect", PolicyEffect, "POLICY_EFFECT_"] },
710
874
  { no: 7, name: "enabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
711
875
  { no: 8, name: "created_at", kind: "message", T: () => Timestamp },
712
- { no: 9, name: "updated_at", kind: "message", T: () => Timestamp }
876
+ { no: 9, name: "updated_at", kind: "message", T: () => Timestamp },
877
+ { no: 11, name: "revision", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
713
878
  ]);
714
879
  }
715
880
  create(value) {
716
881
  const message = globalThis.Object.create((this.messagePrototype));
717
882
  message.id = "";
718
- message.projectId = "";
719
883
  message.name = "";
720
884
  message.policyText = "";
721
885
  message.effect = 0;
722
886
  message.enabled = false;
887
+ message.revision = 0n;
723
888
  if (value !== undefined)
724
889
  reflectionMergePartial(this, message, value);
725
890
  return message;
@@ -732,8 +897,8 @@ class Policy$Type extends MessageType {
732
897
  case /* string id */ 1:
733
898
  message.id = reader.string();
734
899
  break;
735
- case /* string project_id */ 2:
736
- message.projectId = reader.string();
900
+ case /* sid.v1.authz.PolicyScope scope */ 10:
901
+ message.scope = PolicyScope.internalBinaryRead(reader, reader.uint32(), options, message.scope);
737
902
  break;
738
903
  case /* string name */ 3:
739
904
  message.name = reader.string();
@@ -756,6 +921,9 @@ class Policy$Type extends MessageType {
756
921
  case /* google.protobuf.Timestamp updated_at */ 9:
757
922
  message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
758
923
  break;
924
+ case /* uint64 revision */ 11:
925
+ message.revision = reader.uint64().toBigInt();
926
+ break;
759
927
  default:
760
928
  let u = options.readUnknownField;
761
929
  if (u === "throw")
@@ -771,9 +939,6 @@ class Policy$Type extends MessageType {
771
939
  /* string id = 1; */
772
940
  if (message.id !== "")
773
941
  writer.tag(1, WireType.LengthDelimited).string(message.id);
774
- /* string project_id = 2; */
775
- if (message.projectId !== "")
776
- writer.tag(2, WireType.LengthDelimited).string(message.projectId);
777
942
  /* string name = 3; */
778
943
  if (message.name !== "")
779
944
  writer.tag(3, WireType.LengthDelimited).string(message.name);
@@ -795,6 +960,12 @@ class Policy$Type extends MessageType {
795
960
  /* google.protobuf.Timestamp updated_at = 9; */
796
961
  if (message.updatedAt)
797
962
  Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
963
+ /* sid.v1.authz.PolicyScope scope = 10; */
964
+ if (message.scope)
965
+ PolicyScope.internalBinaryWrite(message.scope, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
966
+ /* uint64 revision = 11; */
967
+ if (message.revision !== 0n)
968
+ writer.tag(11, WireType.Varint).uint64(message.revision);
798
969
  let u = options.writeUnknownFields;
799
970
  if (u !== false)
800
971
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -1983,7 +2154,8 @@ class AssignRoleRequest$Type extends MessageType {
1983
2154
  { no: 3, name: "role_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1984
2155
  { no: 4, name: "scope", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
1985
2156
  { no: 5, name: "expires_at", kind: "message", T: () => Timestamp },
1986
- { no: 9, name: "admin", kind: "message", T: () => AdminEnvelope }
2157
+ { no: 9, name: "admin", kind: "message", T: () => AdminEnvelope },
2158
+ { no: 10, name: "policy_admin", kind: "message", T: () => PolicyAuthority }
1987
2159
  ]);
1988
2160
  }
1989
2161
  create(value) {
@@ -2041,6 +2213,9 @@ class AssignRoleRequest$Type extends MessageType {
2041
2213
  case /* optional sid.v1.authz.AdminEnvelope admin */ 9:
2042
2214
  message.admin = AdminEnvelope.internalBinaryRead(reader, reader.uint32(), options, message.admin);
2043
2215
  break;
2216
+ case /* optional sid.v1.authz.PolicyAuthority policy_admin */ 10:
2217
+ message.policyAdmin = PolicyAuthority.internalBinaryRead(reader, reader.uint32(), options, message.policyAdmin);
2218
+ break;
2044
2219
  default:
2045
2220
  let u = options.readUnknownField;
2046
2221
  if (u === "throw")
@@ -2080,6 +2255,9 @@ class AssignRoleRequest$Type extends MessageType {
2080
2255
  /* optional sid.v1.authz.AdminEnvelope admin = 9; */
2081
2256
  if (message.admin)
2082
2257
  AdminEnvelope.internalBinaryWrite(message.admin, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
2258
+ /* optional sid.v1.authz.PolicyAuthority policy_admin = 10; */
2259
+ if (message.policyAdmin)
2260
+ PolicyAuthority.internalBinaryWrite(message.policyAdmin, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
2083
2261
  let u = options.writeUnknownFields;
2084
2262
  if (u !== false)
2085
2263
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -3176,7 +3354,7 @@ export const ListGroupMembersResponse = new ListGroupMembersResponse$Type();
3176
3354
  class CreatePolicyRequest$Type extends MessageType {
3177
3355
  constructor() {
3178
3356
  super("sid.v1.authz.CreatePolicyRequest", [
3179
- { no: 1, name: "project_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3357
+ { no: 7, name: "scope", kind: "message", T: () => PolicyScope },
3180
3358
  { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3181
3359
  { no: 3, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
3182
3360
  { no: 4, name: "policy_text", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
@@ -3186,7 +3364,6 @@ class CreatePolicyRequest$Type extends MessageType {
3186
3364
  }
3187
3365
  create(value) {
3188
3366
  const message = globalThis.Object.create((this.messagePrototype));
3189
- message.projectId = "";
3190
3367
  message.name = "";
3191
3368
  message.policyText = "";
3192
3369
  message.effect = 0;
@@ -3200,8 +3377,8 @@ class CreatePolicyRequest$Type extends MessageType {
3200
3377
  while (reader.pos < end) {
3201
3378
  let [fieldNo, wireType] = reader.tag();
3202
3379
  switch (fieldNo) {
3203
- case /* string project_id */ 1:
3204
- message.projectId = reader.string();
3380
+ case /* sid.v1.authz.PolicyScope scope */ 7:
3381
+ message.scope = PolicyScope.internalBinaryRead(reader, reader.uint32(), options, message.scope);
3205
3382
  break;
3206
3383
  case /* string name */ 2:
3207
3384
  message.name = reader.string();
@@ -3230,9 +3407,6 @@ class CreatePolicyRequest$Type extends MessageType {
3230
3407
  return message;
3231
3408
  }
3232
3409
  internalBinaryWrite(message, writer, options) {
3233
- /* string project_id = 1; */
3234
- if (message.projectId !== "")
3235
- writer.tag(1, WireType.LengthDelimited).string(message.projectId);
3236
3410
  /* string name = 2; */
3237
3411
  if (message.name !== "")
3238
3412
  writer.tag(2, WireType.LengthDelimited).string(message.name);
@@ -3248,6 +3422,9 @@ class CreatePolicyRequest$Type extends MessageType {
3248
3422
  /* bool enabled = 6; */
3249
3423
  if (message.enabled !== false)
3250
3424
  writer.tag(6, WireType.Varint).bool(message.enabled);
3425
+ /* sid.v1.authz.PolicyScope scope = 7; */
3426
+ if (message.scope)
3427
+ PolicyScope.internalBinaryWrite(message.scope, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
3251
3428
  let u = options.writeUnknownFields;
3252
3429
  if (u !== false)
3253
3430
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -3607,14 +3784,13 @@ export const DeletePolicyResponse = new DeletePolicyResponse$Type();
3607
3784
  class ListPoliciesRequest$Type extends MessageType {
3608
3785
  constructor() {
3609
3786
  super("sid.v1.authz.ListPoliciesRequest", [
3610
- { no: 1, name: "project_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3787
+ { no: 4, name: "scope", kind: "message", T: () => PolicyScope },
3611
3788
  { no: 2, name: "page_size", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
3612
3789
  { no: 3, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
3613
3790
  ]);
3614
3791
  }
3615
3792
  create(value) {
3616
3793
  const message = globalThis.Object.create((this.messagePrototype));
3617
- message.projectId = "";
3618
3794
  message.pageSize = 0;
3619
3795
  message.pageToken = "";
3620
3796
  if (value !== undefined)
@@ -3626,8 +3802,8 @@ class ListPoliciesRequest$Type extends MessageType {
3626
3802
  while (reader.pos < end) {
3627
3803
  let [fieldNo, wireType] = reader.tag();
3628
3804
  switch (fieldNo) {
3629
- case /* string project_id */ 1:
3630
- message.projectId = reader.string();
3805
+ case /* sid.v1.authz.PolicyScope scope */ 4:
3806
+ message.scope = PolicyScope.internalBinaryRead(reader, reader.uint32(), options, message.scope);
3631
3807
  break;
3632
3808
  case /* int32 page_size */ 2:
3633
3809
  message.pageSize = reader.int32();
@@ -3647,15 +3823,15 @@ class ListPoliciesRequest$Type extends MessageType {
3647
3823
  return message;
3648
3824
  }
3649
3825
  internalBinaryWrite(message, writer, options) {
3650
- /* string project_id = 1; */
3651
- if (message.projectId !== "")
3652
- writer.tag(1, WireType.LengthDelimited).string(message.projectId);
3653
3826
  /* int32 page_size = 2; */
3654
3827
  if (message.pageSize !== 0)
3655
3828
  writer.tag(2, WireType.Varint).int32(message.pageSize);
3656
3829
  /* string page_token = 3; */
3657
3830
  if (message.pageToken !== "")
3658
3831
  writer.tag(3, WireType.LengthDelimited).string(message.pageToken);
3832
+ /* sid.v1.authz.PolicyScope scope = 4; */
3833
+ if (message.scope)
3834
+ PolicyScope.internalBinaryWrite(message.scope, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
3659
3835
  let u = options.writeUnknownFields;
3660
3836
  if (u !== false)
3661
3837
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -3729,7 +3905,7 @@ class EvaluatePolicyRequest$Type extends MessageType {
3729
3905
  { no: 2, name: "action", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3730
3906
  { no: 3, name: "resource", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3731
3907
  { no: 4, name: "context", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
3732
- { no: 5, name: "project_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
3908
+ { no: 6, name: "scope", kind: "message", T: () => PolicyScope }
3733
3909
  ]);
3734
3910
  }
3735
3911
  create(value) {
@@ -3759,8 +3935,8 @@ class EvaluatePolicyRequest$Type extends MessageType {
3759
3935
  case /* map<string, string> context */ 4:
3760
3936
  this.binaryReadMap4(message.context, reader, options);
3761
3937
  break;
3762
- case /* optional string project_id */ 5:
3763
- message.projectId = reader.string();
3938
+ case /* sid.v1.authz.PolicyScope scope */ 6:
3939
+ message.scope = PolicyScope.internalBinaryRead(reader, reader.uint32(), options, message.scope);
3764
3940
  break;
3765
3941
  default:
3766
3942
  let u = options.readUnknownField;
@@ -3802,9 +3978,9 @@ class EvaluatePolicyRequest$Type extends MessageType {
3802
3978
  /* map<string, string> context = 4; */
3803
3979
  for (let k of globalThis.Object.keys(message.context))
3804
3980
  writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.context[k]).join();
3805
- /* optional string project_id = 5; */
3806
- if (message.projectId !== undefined)
3807
- writer.tag(5, WireType.LengthDelimited).string(message.projectId);
3981
+ /* sid.v1.authz.PolicyScope scope = 6; */
3982
+ if (message.scope)
3983
+ PolicyScope.internalBinaryWrite(message.scope, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
3808
3984
  let u = options.writeUnknownFields;
3809
3985
  if (u !== false)
3810
3986
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);