/
permission_service.pb.go
1876 lines (1679 loc) · 81.7 KB
/
permission_service.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc (unknown)
// source: authzed/api/v1/permission_service.proto
package v1
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Precondition_Operation int32
const (
Precondition_OPERATION_UNSPECIFIED Precondition_Operation = 0
Precondition_OPERATION_MUST_NOT_MATCH Precondition_Operation = 1
Precondition_OPERATION_MUST_MATCH Precondition_Operation = 2
)
// Enum value maps for Precondition_Operation.
var (
Precondition_Operation_name = map[int32]string{
0: "OPERATION_UNSPECIFIED",
1: "OPERATION_MUST_NOT_MATCH",
2: "OPERATION_MUST_MATCH",
}
Precondition_Operation_value = map[string]int32{
"OPERATION_UNSPECIFIED": 0,
"OPERATION_MUST_NOT_MATCH": 1,
"OPERATION_MUST_MATCH": 2,
}
)
func (x Precondition_Operation) Enum() *Precondition_Operation {
p := new(Precondition_Operation)
*p = x
return p
}
func (x Precondition_Operation) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Precondition_Operation) Descriptor() protoreflect.EnumDescriptor {
return file_authzed_api_v1_permission_service_proto_enumTypes[0].Descriptor()
}
func (Precondition_Operation) Type() protoreflect.EnumType {
return &file_authzed_api_v1_permission_service_proto_enumTypes[0]
}
func (x Precondition_Operation) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Precondition_Operation.Descriptor instead.
func (Precondition_Operation) EnumDescriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{5, 0}
}
type CheckPermissionResponse_Permissionship int32
const (
CheckPermissionResponse_PERMISSIONSHIP_UNSPECIFIED CheckPermissionResponse_Permissionship = 0
CheckPermissionResponse_PERMISSIONSHIP_NO_PERMISSION CheckPermissionResponse_Permissionship = 1
CheckPermissionResponse_PERMISSIONSHIP_HAS_PERMISSION CheckPermissionResponse_Permissionship = 2
)
// Enum value maps for CheckPermissionResponse_Permissionship.
var (
CheckPermissionResponse_Permissionship_name = map[int32]string{
0: "PERMISSIONSHIP_UNSPECIFIED",
1: "PERMISSIONSHIP_NO_PERMISSION",
2: "PERMISSIONSHIP_HAS_PERMISSION",
}
CheckPermissionResponse_Permissionship_value = map[string]int32{
"PERMISSIONSHIP_UNSPECIFIED": 0,
"PERMISSIONSHIP_NO_PERMISSION": 1,
"PERMISSIONSHIP_HAS_PERMISSION": 2,
}
)
func (x CheckPermissionResponse_Permissionship) Enum() *CheckPermissionResponse_Permissionship {
p := new(CheckPermissionResponse_Permissionship)
*p = x
return p
}
func (x CheckPermissionResponse_Permissionship) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (CheckPermissionResponse_Permissionship) Descriptor() protoreflect.EnumDescriptor {
return file_authzed_api_v1_permission_service_proto_enumTypes[1].Descriptor()
}
func (CheckPermissionResponse_Permissionship) Type() protoreflect.EnumType {
return &file_authzed_api_v1_permission_service_proto_enumTypes[1]
}
func (x CheckPermissionResponse_Permissionship) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use CheckPermissionResponse_Permissionship.Descriptor instead.
func (CheckPermissionResponse_Permissionship) EnumDescriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{11, 0}
}
// Consistency will define how a request is handled by the backend.
// By defining a consistency requirement, and a token at which those
// requirements should be applied, where applicable.
type Consistency struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Requirement:
// *Consistency_MinimizeLatency
// *Consistency_AtLeastAsFresh
// *Consistency_AtExactSnapshot
// *Consistency_FullyConsistent
Requirement isConsistency_Requirement `protobuf_oneof:"requirement"`
}
func (x *Consistency) Reset() {
*x = Consistency{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Consistency) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Consistency) ProtoMessage() {}
func (x *Consistency) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Consistency.ProtoReflect.Descriptor instead.
func (*Consistency) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{0}
}
func (m *Consistency) GetRequirement() isConsistency_Requirement {
if m != nil {
return m.Requirement
}
return nil
}
func (x *Consistency) GetMinimizeLatency() bool {
if x, ok := x.GetRequirement().(*Consistency_MinimizeLatency); ok {
return x.MinimizeLatency
}
return false
}
func (x *Consistency) GetAtLeastAsFresh() *ZedToken {
if x, ok := x.GetRequirement().(*Consistency_AtLeastAsFresh); ok {
return x.AtLeastAsFresh
}
return nil
}
func (x *Consistency) GetAtExactSnapshot() *ZedToken {
if x, ok := x.GetRequirement().(*Consistency_AtExactSnapshot); ok {
return x.AtExactSnapshot
}
return nil
}
func (x *Consistency) GetFullyConsistent() bool {
if x, ok := x.GetRequirement().(*Consistency_FullyConsistent); ok {
return x.FullyConsistent
}
return false
}
type isConsistency_Requirement interface {
isConsistency_Requirement()
}
type Consistency_MinimizeLatency struct {
// minimize_latency indicates that the latency for the call should be
// minimized by having the system select the fastest snapshot available.
MinimizeLatency bool `protobuf:"varint,1,opt,name=minimize_latency,json=minimizeLatency,proto3,oneof"`
}
type Consistency_AtLeastAsFresh struct {
// at_least_as_fresh indicates that all data used in the API call must be
// *at least as fresh* as that found in the ZedToken; more recent data might
// be used if available or faster.
AtLeastAsFresh *ZedToken `protobuf:"bytes,2,opt,name=at_least_as_fresh,json=atLeastAsFresh,proto3,oneof"`
}
type Consistency_AtExactSnapshot struct {
// at_exact_snapshot indicates that all data used in the API call must be
// *at the given* snapshot in time; if the snapshot is no longer available,
// an error will be returned to the caller.
AtExactSnapshot *ZedToken `protobuf:"bytes,3,opt,name=at_exact_snapshot,json=atExactSnapshot,proto3,oneof"`
}
type Consistency_FullyConsistent struct {
// fully_consistent indicates that all data used in the API call *must* be
// at the most recent snapshot found.
//
// NOTE: using this method can be *quite slow*, so unless there is a need to
// do so, it is recommended to use `at_least_as_fresh` with a stored
// ZedToken.
FullyConsistent bool `protobuf:"varint,4,opt,name=fully_consistent,json=fullyConsistent,proto3,oneof"`
}
func (*Consistency_MinimizeLatency) isConsistency_Requirement() {}
func (*Consistency_AtLeastAsFresh) isConsistency_Requirement() {}
func (*Consistency_AtExactSnapshot) isConsistency_Requirement() {}
func (*Consistency_FullyConsistent) isConsistency_Requirement() {}
// RelationshipFilter is a collection of filters which when applied to a
// relationship will return relationships that have exactly matching fields.
//
// resource_type is required. All other fields are optional and if left
// unspecified will not filter relationships.
type RelationshipFilter struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
OptionalResourceId string `protobuf:"bytes,2,opt,name=optional_resource_id,json=optionalResourceId,proto3" json:"optional_resource_id,omitempty"`
OptionalRelation string `protobuf:"bytes,3,opt,name=optional_relation,json=optionalRelation,proto3" json:"optional_relation,omitempty"`
OptionalSubjectFilter *SubjectFilter `protobuf:"bytes,4,opt,name=optional_subject_filter,json=optionalSubjectFilter,proto3" json:"optional_subject_filter,omitempty"`
}
func (x *RelationshipFilter) Reset() {
*x = RelationshipFilter{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RelationshipFilter) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RelationshipFilter) ProtoMessage() {}
func (x *RelationshipFilter) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RelationshipFilter.ProtoReflect.Descriptor instead.
func (*RelationshipFilter) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{1}
}
func (x *RelationshipFilter) GetResourceType() string {
if x != nil {
return x.ResourceType
}
return ""
}
func (x *RelationshipFilter) GetOptionalResourceId() string {
if x != nil {
return x.OptionalResourceId
}
return ""
}
func (x *RelationshipFilter) GetOptionalRelation() string {
if x != nil {
return x.OptionalRelation
}
return ""
}
func (x *RelationshipFilter) GetOptionalSubjectFilter() *SubjectFilter {
if x != nil {
return x.OptionalSubjectFilter
}
return nil
}
// SubjectFilter specifies a filter on the subject of a relationship.
//
// subject_type is required and all other fields are optional, and will not
// impose any additional requirements if left unspecified.
type SubjectFilter struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SubjectType string `protobuf:"bytes,1,opt,name=subject_type,json=subjectType,proto3" json:"subject_type,omitempty"`
OptionalSubjectId string `protobuf:"bytes,2,opt,name=optional_subject_id,json=optionalSubjectId,proto3" json:"optional_subject_id,omitempty"`
OptionalRelation *SubjectFilter_RelationFilter `protobuf:"bytes,3,opt,name=optional_relation,json=optionalRelation,proto3" json:"optional_relation,omitempty"`
}
func (x *SubjectFilter) Reset() {
*x = SubjectFilter{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SubjectFilter) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SubjectFilter) ProtoMessage() {}
func (x *SubjectFilter) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SubjectFilter.ProtoReflect.Descriptor instead.
func (*SubjectFilter) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{2}
}
func (x *SubjectFilter) GetSubjectType() string {
if x != nil {
return x.SubjectType
}
return ""
}
func (x *SubjectFilter) GetOptionalSubjectId() string {
if x != nil {
return x.OptionalSubjectId
}
return ""
}
func (x *SubjectFilter) GetOptionalRelation() *SubjectFilter_RelationFilter {
if x != nil {
return x.OptionalRelation
}
return nil
}
// ReadRelationshipsRequest specifies one or more filters used to read matching
// relationships within the system.
type ReadRelationshipsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Consistency *Consistency `protobuf:"bytes,1,opt,name=consistency,proto3" json:"consistency,omitempty"`
RelationshipFilter *RelationshipFilter `protobuf:"bytes,2,opt,name=relationship_filter,json=relationshipFilter,proto3" json:"relationship_filter,omitempty"`
}
func (x *ReadRelationshipsRequest) Reset() {
*x = ReadRelationshipsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ReadRelationshipsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReadRelationshipsRequest) ProtoMessage() {}
func (x *ReadRelationshipsRequest) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReadRelationshipsRequest.ProtoReflect.Descriptor instead.
func (*ReadRelationshipsRequest) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{3}
}
func (x *ReadRelationshipsRequest) GetConsistency() *Consistency {
if x != nil {
return x.Consistency
}
return nil
}
func (x *ReadRelationshipsRequest) GetRelationshipFilter() *RelationshipFilter {
if x != nil {
return x.RelationshipFilter
}
return nil
}
// ReadRelationshipsResponse contains a Relationship found that matches the
// specified relationship filter(s). A instance of this response message will
// be streamed to the client for each relationship found.
type ReadRelationshipsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ReadAt *ZedToken `protobuf:"bytes,1,opt,name=read_at,json=readAt,proto3" json:"read_at,omitempty"`
Relationship *Relationship `protobuf:"bytes,2,opt,name=relationship,proto3" json:"relationship,omitempty"`
}
func (x *ReadRelationshipsResponse) Reset() {
*x = ReadRelationshipsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ReadRelationshipsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReadRelationshipsResponse) ProtoMessage() {}
func (x *ReadRelationshipsResponse) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReadRelationshipsResponse.ProtoReflect.Descriptor instead.
func (*ReadRelationshipsResponse) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{4}
}
func (x *ReadRelationshipsResponse) GetReadAt() *ZedToken {
if x != nil {
return x.ReadAt
}
return nil
}
func (x *ReadRelationshipsResponse) GetRelationship() *Relationship {
if x != nil {
return x.Relationship
}
return nil
}
// Precondition specifies how and the existence or absence of certain
// relationships as expressed through the accompanying filter should affect
// whether or not the operation proceeds.
//
// MUST_NOT_MATCH will fail the parent request if any relationships match the
// relationships filter.
// MUST_MATCH will fail the parent request if there are no
// relationships that match the filter.
type Precondition struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Operation Precondition_Operation `protobuf:"varint,1,opt,name=operation,proto3,enum=authzed.api.v1.Precondition_Operation" json:"operation,omitempty"`
Filter *RelationshipFilter `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
}
func (x *Precondition) Reset() {
*x = Precondition{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Precondition) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Precondition) ProtoMessage() {}
func (x *Precondition) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Precondition.ProtoReflect.Descriptor instead.
func (*Precondition) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{5}
}
func (x *Precondition) GetOperation() Precondition_Operation {
if x != nil {
return x.Operation
}
return Precondition_OPERATION_UNSPECIFIED
}
func (x *Precondition) GetFilter() *RelationshipFilter {
if x != nil {
return x.Filter
}
return nil
}
// WriteRelationshipsRequest contains a list of Relationship mutations that
// should be applied to the service. If the optional_preconditions parameter
// is included, all of the specified preconditions must also be satisfied before
// the write will be committed.
type WriteRelationshipsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Updates []*RelationshipUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"`
OptionalPreconditions []*Precondition `protobuf:"bytes,2,rep,name=optional_preconditions,json=optionalPreconditions,proto3" json:"optional_preconditions,omitempty"` // To be bounded by configuration
}
func (x *WriteRelationshipsRequest) Reset() {
*x = WriteRelationshipsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WriteRelationshipsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WriteRelationshipsRequest) ProtoMessage() {}
func (x *WriteRelationshipsRequest) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WriteRelationshipsRequest.ProtoReflect.Descriptor instead.
func (*WriteRelationshipsRequest) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{6}
}
func (x *WriteRelationshipsRequest) GetUpdates() []*RelationshipUpdate {
if x != nil {
return x.Updates
}
return nil
}
func (x *WriteRelationshipsRequest) GetOptionalPreconditions() []*Precondition {
if x != nil {
return x.OptionalPreconditions
}
return nil
}
type WriteRelationshipsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
WrittenAt *ZedToken `protobuf:"bytes,1,opt,name=written_at,json=writtenAt,proto3" json:"written_at,omitempty"`
}
func (x *WriteRelationshipsResponse) Reset() {
*x = WriteRelationshipsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WriteRelationshipsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WriteRelationshipsResponse) ProtoMessage() {}
func (x *WriteRelationshipsResponse) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WriteRelationshipsResponse.ProtoReflect.Descriptor instead.
func (*WriteRelationshipsResponse) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{7}
}
func (x *WriteRelationshipsResponse) GetWrittenAt() *ZedToken {
if x != nil {
return x.WrittenAt
}
return nil
}
// DeleteRelationshipsRequest specifies which Relationships should be deleted,
// requesting the delete of *ALL* relationships that match the specified
// filters. If the optional_preconditions parameter is included, all of the
// specified preconditions must also be satisfied before the delete will be
// executed.
type DeleteRelationshipsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RelationshipFilter *RelationshipFilter `protobuf:"bytes,1,opt,name=relationship_filter,json=relationshipFilter,proto3" json:"relationship_filter,omitempty"`
OptionalPreconditions []*Precondition `protobuf:"bytes,2,rep,name=optional_preconditions,json=optionalPreconditions,proto3" json:"optional_preconditions,omitempty"` // To be bounded by configuration
}
func (x *DeleteRelationshipsRequest) Reset() {
*x = DeleteRelationshipsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteRelationshipsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteRelationshipsRequest) ProtoMessage() {}
func (x *DeleteRelationshipsRequest) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteRelationshipsRequest.ProtoReflect.Descriptor instead.
func (*DeleteRelationshipsRequest) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{8}
}
func (x *DeleteRelationshipsRequest) GetRelationshipFilter() *RelationshipFilter {
if x != nil {
return x.RelationshipFilter
}
return nil
}
func (x *DeleteRelationshipsRequest) GetOptionalPreconditions() []*Precondition {
if x != nil {
return x.OptionalPreconditions
}
return nil
}
type DeleteRelationshipsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DeletedAt *ZedToken `protobuf:"bytes,1,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"`
}
func (x *DeleteRelationshipsResponse) Reset() {
*x = DeleteRelationshipsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteRelationshipsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteRelationshipsResponse) ProtoMessage() {}
func (x *DeleteRelationshipsResponse) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteRelationshipsResponse.ProtoReflect.Descriptor instead.
func (*DeleteRelationshipsResponse) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{9}
}
func (x *DeleteRelationshipsResponse) GetDeletedAt() *ZedToken {
if x != nil {
return x.DeletedAt
}
return nil
}
// CheckPermissionRequest issues a check on whether a subject has a permission
// or is a member of a relation, on a specific resource.
type CheckPermissionRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Consistency *Consistency `protobuf:"bytes,1,opt,name=consistency,proto3" json:"consistency,omitempty"`
// resource is the resource on which to check the permission or relation.
Resource *ObjectReference `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
// permission is the name of the permission (or relation) on which to execute
// the check.
Permission string `protobuf:"bytes,3,opt,name=permission,proto3" json:"permission,omitempty"`
// subject is the subject that will be checked for the permission or relation.
Subject *SubjectReference `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
}
func (x *CheckPermissionRequest) Reset() {
*x = CheckPermissionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckPermissionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckPermissionRequest) ProtoMessage() {}
func (x *CheckPermissionRequest) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckPermissionRequest.ProtoReflect.Descriptor instead.
func (*CheckPermissionRequest) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{10}
}
func (x *CheckPermissionRequest) GetConsistency() *Consistency {
if x != nil {
return x.Consistency
}
return nil
}
func (x *CheckPermissionRequest) GetResource() *ObjectReference {
if x != nil {
return x.Resource
}
return nil
}
func (x *CheckPermissionRequest) GetPermission() string {
if x != nil {
return x.Permission
}
return ""
}
func (x *CheckPermissionRequest) GetSubject() *SubjectReference {
if x != nil {
return x.Subject
}
return nil
}
type CheckPermissionResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CheckedAt *ZedToken `protobuf:"bytes,1,opt,name=checked_at,json=checkedAt,proto3" json:"checked_at,omitempty"`
// Permissionship communicates whether or not the subject has the requested
// permission or has a relationship with the given resource, over the given
// relation.
//
// This value will be authzed.api.v1.PERMISSIONSHIP_HAS_PERMISSION if the
// requested subject is a member of the computed permission set or there
// exists a relationship with the requested relation from the given resource
// to the given subject.
Permissionship CheckPermissionResponse_Permissionship `protobuf:"varint,2,opt,name=permissionship,proto3,enum=authzed.api.v1.CheckPermissionResponse_Permissionship" json:"permissionship,omitempty"`
}
func (x *CheckPermissionResponse) Reset() {
*x = CheckPermissionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckPermissionResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckPermissionResponse) ProtoMessage() {}
func (x *CheckPermissionResponse) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CheckPermissionResponse.ProtoReflect.Descriptor instead.
func (*CheckPermissionResponse) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{11}
}
func (x *CheckPermissionResponse) GetCheckedAt() *ZedToken {
if x != nil {
return x.CheckedAt
}
return nil
}
func (x *CheckPermissionResponse) GetPermissionship() CheckPermissionResponse_Permissionship {
if x != nil {
return x.Permissionship
}
return CheckPermissionResponse_PERMISSIONSHIP_UNSPECIFIED
}
// ExpandPermissionTreeRequest returns a tree representing the expansion of all
// relationships found accessible from a permission or relation on a particular
// resource.
//
// ExpandPermissionTreeRequest is typically used to determine the full set of
// subjects with a permission, along with the relationships that grant said
// access.
type ExpandPermissionTreeRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Consistency *Consistency `protobuf:"bytes,1,opt,name=consistency,proto3" json:"consistency,omitempty"`
// resource is the resource over which to run the expansion.
Resource *ObjectReference `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
// permission is the name of the permission or relation over which to run the
// expansion for the resource.
Permission string `protobuf:"bytes,3,opt,name=permission,proto3" json:"permission,omitempty"`
}
func (x *ExpandPermissionTreeRequest) Reset() {
*x = ExpandPermissionTreeRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExpandPermissionTreeRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExpandPermissionTreeRequest) ProtoMessage() {}
func (x *ExpandPermissionTreeRequest) ProtoReflect() protoreflect.Message {
mi := &file_authzed_api_v1_permission_service_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExpandPermissionTreeRequest.ProtoReflect.Descriptor instead.
func (*ExpandPermissionTreeRequest) Descriptor() ([]byte, []int) {
return file_authzed_api_v1_permission_service_proto_rawDescGZIP(), []int{12}
}
func (x *ExpandPermissionTreeRequest) GetConsistency() *Consistency {
if x != nil {
return x.Consistency
}
return nil
}
func (x *ExpandPermissionTreeRequest) GetResource() *ObjectReference {
if x != nil {
return x.Resource
}
return nil
}
func (x *ExpandPermissionTreeRequest) GetPermission() string {
if x != nil {
return x.Permission
}
return ""
}
type ExpandPermissionTreeResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ExpandedAt *ZedToken `protobuf:"bytes,1,opt,name=expanded_at,json=expandedAt,proto3" json:"expanded_at,omitempty"`