authzed 0.5.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: authzed/api/v1/permission_service.proto
3
4
 
@@ -8,132 +9,33 @@ require 'google/api/annotations_pb'
8
9
  require 'validate/validate_pb'
9
10
  require 'authzed/api/v1/core_pb'
10
11
 
11
- Google::Protobuf::DescriptorPool.generated_pool.build do
12
- add_file("authzed/api/v1/permission_service.proto", :syntax => :proto3) do
13
- add_message "authzed.api.v1.Consistency" do
14
- oneof :requirement do
15
- optional :minimize_latency, :bool, 1, json_name: "minimizeLatency"
16
- optional :at_least_as_fresh, :message, 2, "authzed.api.v1.ZedToken", json_name: "atLeastAsFresh"
17
- optional :at_exact_snapshot, :message, 3, "authzed.api.v1.ZedToken", json_name: "atExactSnapshot"
18
- optional :fully_consistent, :bool, 4, json_name: "fullyConsistent"
19
- end
20
- end
21
- add_message "authzed.api.v1.RelationshipFilter" do
22
- optional :resource_type, :string, 1, json_name: "resourceType"
23
- optional :optional_resource_id, :string, 2, json_name: "optionalResourceId"
24
- optional :optional_relation, :string, 3, json_name: "optionalRelation"
25
- optional :optional_subject_filter, :message, 4, "authzed.api.v1.SubjectFilter", json_name: "optionalSubjectFilter"
26
- end
27
- add_message "authzed.api.v1.SubjectFilter" do
28
- optional :subject_type, :string, 1, json_name: "subjectType"
29
- optional :optional_subject_id, :string, 2, json_name: "optionalSubjectId"
30
- optional :optional_relation, :message, 3, "authzed.api.v1.SubjectFilter.RelationFilter", json_name: "optionalRelation"
31
- end
32
- add_message "authzed.api.v1.SubjectFilter.RelationFilter" do
33
- optional :relation, :string, 1, json_name: "relation"
34
- end
35
- add_message "authzed.api.v1.ReadRelationshipsRequest" do
36
- optional :consistency, :message, 1, "authzed.api.v1.Consistency", json_name: "consistency"
37
- optional :relationship_filter, :message, 2, "authzed.api.v1.RelationshipFilter", json_name: "relationshipFilter"
38
- end
39
- add_message "authzed.api.v1.ReadRelationshipsResponse" do
40
- optional :read_at, :message, 1, "authzed.api.v1.ZedToken", json_name: "readAt"
41
- optional :relationship, :message, 2, "authzed.api.v1.Relationship", json_name: "relationship"
42
- end
43
- add_message "authzed.api.v1.Precondition" do
44
- optional :operation, :enum, 1, "authzed.api.v1.Precondition.Operation", json_name: "operation"
45
- optional :filter, :message, 2, "authzed.api.v1.RelationshipFilter", json_name: "filter"
46
- end
47
- add_enum "authzed.api.v1.Precondition.Operation" do
48
- value :OPERATION_UNSPECIFIED, 0
49
- value :OPERATION_MUST_NOT_MATCH, 1
50
- value :OPERATION_MUST_MATCH, 2
51
- end
52
- add_message "authzed.api.v1.WriteRelationshipsRequest" do
53
- repeated :updates, :message, 1, "authzed.api.v1.RelationshipUpdate", json_name: "updates"
54
- repeated :optional_preconditions, :message, 2, "authzed.api.v1.Precondition", json_name: "optionalPreconditions"
55
- end
56
- add_message "authzed.api.v1.WriteRelationshipsResponse" do
57
- optional :written_at, :message, 1, "authzed.api.v1.ZedToken", json_name: "writtenAt"
58
- end
59
- add_message "authzed.api.v1.DeleteRelationshipsRequest" do
60
- optional :relationship_filter, :message, 1, "authzed.api.v1.RelationshipFilter", json_name: "relationshipFilter"
61
- repeated :optional_preconditions, :message, 2, "authzed.api.v1.Precondition", json_name: "optionalPreconditions"
62
- end
63
- add_message "authzed.api.v1.DeleteRelationshipsResponse" do
64
- optional :deleted_at, :message, 1, "authzed.api.v1.ZedToken", json_name: "deletedAt"
65
- end
66
- add_message "authzed.api.v1.CheckPermissionRequest" do
67
- optional :consistency, :message, 1, "authzed.api.v1.Consistency", json_name: "consistency"
68
- optional :resource, :message, 2, "authzed.api.v1.ObjectReference", json_name: "resource"
69
- optional :permission, :string, 3, json_name: "permission"
70
- optional :subject, :message, 4, "authzed.api.v1.SubjectReference", json_name: "subject"
71
- optional :context, :message, 5, "google.protobuf.Struct", json_name: "context"
72
- end
73
- add_message "authzed.api.v1.PartialCaveatInfo" do
74
- repeated :missing_required_context, :string, 1, json_name: "missingRequiredContext"
75
- end
76
- add_message "authzed.api.v1.CheckPermissionResponse" do
77
- optional :checked_at, :message, 1, "authzed.api.v1.ZedToken", json_name: "checkedAt"
78
- optional :permissionship, :enum, 2, "authzed.api.v1.CheckPermissionResponse.Permissionship", json_name: "permissionship"
79
- optional :partial_caveat_info, :message, 3, "authzed.api.v1.PartialCaveatInfo", json_name: "partialCaveatInfo"
80
- end
81
- add_enum "authzed.api.v1.CheckPermissionResponse.Permissionship" do
82
- value :PERMISSIONSHIP_UNSPECIFIED, 0
83
- value :PERMISSIONSHIP_NO_PERMISSION, 1
84
- value :PERMISSIONSHIP_HAS_PERMISSION, 2
85
- value :PERMISSIONSHIP_CONDITIONAL_PERMISSION, 3
86
- end
87
- add_message "authzed.api.v1.ExpandPermissionTreeRequest" do
88
- optional :consistency, :message, 1, "authzed.api.v1.Consistency", json_name: "consistency"
89
- optional :resource, :message, 2, "authzed.api.v1.ObjectReference", json_name: "resource"
90
- optional :permission, :string, 3, json_name: "permission"
91
- end
92
- add_message "authzed.api.v1.ExpandPermissionTreeResponse" do
93
- optional :expanded_at, :message, 1, "authzed.api.v1.ZedToken", json_name: "expandedAt"
94
- optional :tree_root, :message, 2, "authzed.api.v1.PermissionRelationshipTree", json_name: "treeRoot"
95
- end
96
- add_message "authzed.api.v1.LookupResourcesRequest" do
97
- optional :consistency, :message, 1, "authzed.api.v1.Consistency", json_name: "consistency"
98
- optional :resource_object_type, :string, 2, json_name: "resourceObjectType"
99
- optional :permission, :string, 3, json_name: "permission"
100
- optional :subject, :message, 4, "authzed.api.v1.SubjectReference", json_name: "subject"
101
- optional :context, :message, 5, "google.protobuf.Struct", json_name: "context"
102
- end
103
- add_message "authzed.api.v1.LookupResourcesResponse" do
104
- optional :looked_up_at, :message, 1, "authzed.api.v1.ZedToken", json_name: "lookedUpAt"
105
- optional :resource_object_id, :string, 2, json_name: "resourceObjectId"
106
- optional :permissionship, :enum, 3, "authzed.api.v1.LookupPermissionship", json_name: "permissionship"
107
- optional :partial_caveat_info, :message, 4, "authzed.api.v1.PartialCaveatInfo", json_name: "partialCaveatInfo"
108
- end
109
- add_message "authzed.api.v1.LookupSubjectsRequest" do
110
- optional :consistency, :message, 1, "authzed.api.v1.Consistency", json_name: "consistency"
111
- optional :resource, :message, 2, "authzed.api.v1.ObjectReference", json_name: "resource"
112
- optional :permission, :string, 3, json_name: "permission"
113
- optional :subject_object_type, :string, 4, json_name: "subjectObjectType"
114
- optional :optional_subject_relation, :string, 5, json_name: "optionalSubjectRelation"
115
- optional :context, :message, 6, "google.protobuf.Struct", json_name: "context"
116
- end
117
- add_message "authzed.api.v1.LookupSubjectsResponse" do
118
- optional :looked_up_at, :message, 1, "authzed.api.v1.ZedToken", json_name: "lookedUpAt"
119
- optional :subject_object_id, :string, 2, json_name: "subjectObjectId"
120
- repeated :excluded_subject_ids, :string, 3, json_name: "excludedSubjectIds"
121
- optional :permissionship, :enum, 4, "authzed.api.v1.LookupPermissionship", json_name: "permissionship"
122
- optional :partial_caveat_info, :message, 5, "authzed.api.v1.PartialCaveatInfo", json_name: "partialCaveatInfo"
123
- optional :subject, :message, 6, "authzed.api.v1.ResolvedSubject", json_name: "subject"
124
- repeated :excluded_subjects, :message, 7, "authzed.api.v1.ResolvedSubject", json_name: "excludedSubjects"
125
- end
126
- add_message "authzed.api.v1.ResolvedSubject" do
127
- optional :subject_object_id, :string, 1, json_name: "subjectObjectId"
128
- optional :permissionship, :enum, 2, "authzed.api.v1.LookupPermissionship", json_name: "permissionship"
129
- optional :partial_caveat_info, :message, 3, "authzed.api.v1.PartialCaveatInfo", json_name: "partialCaveatInfo"
130
- end
131
- add_enum "authzed.api.v1.LookupPermissionship" do
132
- value :LOOKUP_PERMISSIONSHIP_UNSPECIFIED, 0
133
- value :LOOKUP_PERMISSIONSHIP_HAS_PERMISSION, 1
134
- value :LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION, 2
12
+
13
+ descriptor_data = "\n\'authzed/api/v1/permission_service.proto\x12\x0e\x61uthzed.api.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17validate/validate.proto\x1a\x19\x61uthzed/api/v1/core.proto\"\x9c\x02\n\x0b\x43onsistency\x12\x34\n\x10minimize_latency\x18\x01 \x01(\x08\x42\x07\xfa\x42\x04j\x02\x08\x01H\x00R\x0fminimizeLatency\x12\x45\n\x11\x61t_least_as_fresh\x18\x02 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenH\x00R\x0e\x61tLeastAsFresh\x12\x46\n\x11\x61t_exact_snapshot\x18\x03 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenH\x00R\x0f\x61tExactSnapshot\x12\x34\n\x10\x66ully_consistent\x18\x04 \x01(\x08\x42\x07\xfa\x42\x04j\x02\x08\x01H\x00R\x0f\x66ullyConsistentB\x12\n\x0brequirement\x12\x03\xf8\x42\x01\"\x8c\x03\n\x12RelationshipFilter\x12m\n\rresource_type\x18\x01 \x01(\tBH\xfa\x42\x45rC(\x80\x01\x32>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$R\x0cresourceType\x12W\n\x14optional_resource_id\x18\x02 \x01(\tB%\xfa\x42\"r (\x80\x08\x32\x1b^([a-zA-Z0-9/_|\\-=+]{1,})?$R\x12optionalResourceId\x12W\n\x11optional_relation\x18\x03 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\x10optionalRelation\x12U\n\x17optional_subject_filter\x18\x04 \x01(\x0b\x32\x1d.authzed.api.v1.SubjectFilterR\x15optionalSubjectFilter\"\x8d\x03\n\rSubjectFilter\x12k\n\x0csubject_type\x18\x01 \x01(\tBH\xfa\x42\x45rC(\x80\x01\x32>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$R\x0bsubjectType\x12Z\n\x13optional_subject_id\x18\x02 \x01(\tB*\xfa\x42\'r%(\x80\x08\x32 ^(([a-zA-Z0-9/_|\\-=+]{1,})|\\*)?$R\x11optionalSubjectId\x12Y\n\x11optional_relation\x18\x03 \x01(\x0b\x32,.authzed.api.v1.SubjectFilter.RelationFilterR\x10optionalRelation\x1aX\n\x0eRelationFilter\x12\x46\n\x08relation\x18\x01 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\x08relation\"\xac\x02\n\x18ReadRelationshipsRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12]\n\x13relationship_filter\x18\x02 \x01(\x0b\x32\".authzed.api.v1.RelationshipFilterB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x12relationshipFilter\x12\x31\n\x0eoptional_limit\x18\x03 \x01(\rB\n\xfa\x42\x07*\x05\x18\xe8\x07(\x00R\roptionalLimit\x12?\n\x0foptional_cursor\x18\x04 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x0eoptionalCursor\"\xec\x01\n\x19ReadRelationshipsResponse\x12;\n\x07read_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06readAt\x12J\n\x0crelationship\x18\x02 \x01(\x0b\x32\x1c.authzed.api.v1.RelationshipB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x0crelationship\x12\x46\n\x13\x61\x66ter_result_cursor\x18\x03 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x11\x61\x66terResultCursor\"\x86\x02\n\x0cPrecondition\x12P\n\toperation\x18\x01 \x01(\x0e\x32&.authzed.api.v1.Precondition.OperationB\n\xfa\x42\x07\x82\x01\x04\x10\x01 \x00R\toperation\x12\x44\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\".authzed.api.v1.RelationshipFilterB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06\x66ilter\"^\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x1c\n\x18OPERATION_MUST_NOT_MATCH\x10\x01\x12\x18\n\x14OPERATION_MUST_MATCH\x10\x02\"\xcc\x01\n\x19WriteRelationshipsRequest\x12K\n\x07updates\x18\x01 \x03(\x0b\x32\".authzed.api.v1.RelationshipUpdateB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x07updates\x12\x62\n\x16optional_preconditions\x18\x02 \x03(\x0b\x32\x1c.authzed.api.v1.PreconditionB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x15optionalPreconditions\"U\n\x1aWriteRelationshipsResponse\x12\x37\n\nwritten_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenR\twrittenAt\"\xdb\x02\n\x1a\x44\x65leteRelationshipsRequest\x12]\n\x13relationship_filter\x18\x01 \x01(\x0b\x32\".authzed.api.v1.RelationshipFilterB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x12relationshipFilter\x12\x62\n\x16optional_preconditions\x18\x02 \x03(\x0b\x32\x1c.authzed.api.v1.PreconditionB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x15optionalPreconditions\x12\x31\n\x0eoptional_limit\x18\x03 \x01(\rB\n\xfa\x42\x07*\x05\x18\xe8\x07(\x00R\roptionalLimit\x12G\n optional_allow_partial_deletions\x18\x04 \x01(\x08R\x1doptionalAllowPartialDeletions\"\xb7\x02\n\x1b\x44\x65leteRelationshipsResponse\x12\x37\n\ndeleted_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenR\tdeletedAt\x12i\n\x11\x64\x65letion_progress\x18\x02 \x01(\x0e\x32<.authzed.api.v1.DeleteRelationshipsResponse.DeletionProgressR\x10\x64\x65letionProgress\"t\n\x10\x44\x65letionProgress\x12!\n\x1d\x44\x45LETION_PROGRESS_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x44\x45LETION_PROGRESS_COMPLETE\x10\x01\x12\x1d\n\x19\x44\x45LETION_PROGRESS_PARTIAL\x10\x02\"\xed\x02\n\x16\x43heckPermissionRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12\x45\n\x08resource\x18\x02 \x01(\x0b\x32\x1f.authzed.api.v1.ObjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08resource\x12J\n\npermission\x18\x03 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\npermission\x12\x44\n\x07subject\x18\x04 \x01(\x0b\x32 .authzed.api.v1.SubjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x07subject\x12;\n\x07\x63ontext\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x07\x63ontext\"\xc8\x03\n\x17\x43heckPermissionResponse\x12\x41\n\nchecked_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\tcheckedAt\x12j\n\x0epermissionship\x18\x02 \x01(\x0e\x32\x36.authzed.api.v1.CheckPermissionResponse.PermissionshipB\n\xfa\x42\x07\x82\x01\x04\x10\x01 \x00R\x0epermissionship\x12[\n\x13partial_caveat_info\x18\x03 \x01(\x0b\x32!.authzed.api.v1.PartialCaveatInfoB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x11partialCaveatInfo\"\xa0\x01\n\x0ePermissionship\x12\x1e\n\x1aPERMISSIONSHIP_UNSPECIFIED\x10\x00\x12 \n\x1cPERMISSIONSHIP_NO_PERMISSION\x10\x01\x12!\n\x1dPERMISSIONSHIP_HAS_PERMISSION\x10\x02\x12)\n%PERMISSIONSHIP_CONDITIONAL_PERMISSION\x10\x03\"\xef\x01\n\x1b\x45xpandPermissionTreeRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12\x45\n\x08resource\x18\x02 \x01(\x0b\x32\x1f.authzed.api.v1.ObjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08resource\x12J\n\npermission\x18\x03 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\npermission\"\xa2\x01\n\x1c\x45xpandPermissionTreeResponse\x12\x39\n\x0b\x65xpanded_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenR\nexpandedAt\x12G\n\ttree_root\x18\x02 \x01(\x0b\x32*.authzed.api.v1.PermissionRelationshipTreeR\x08treeRoot\"\x93\x04\n\x16LookupResourcesRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12z\n\x14resource_object_type\x18\x02 \x01(\tBH\xfa\x42\x45rC(\x80\x01\x32>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$R\x12resourceObjectType\x12G\n\npermission\x18\x03 \x01(\tB\'\xfa\x42$r\"(@2\x1e^[a-z][a-z0-9_]{1,62}[a-z0-9]$R\npermission\x12\x44\n\x07subject\x18\x04 \x01(\x0b\x32 .authzed.api.v1.SubjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x07subject\x12;\n\x07\x63ontext\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x07\x63ontext\x12\x31\n\x0eoptional_limit\x18\x06 \x01(\rB\n\xfa\x42\x07*\x05\x18\xe8\x07(\x00R\roptionalLimit\x12?\n\x0foptional_cursor\x18\x07 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x0eoptionalCursor\"\x82\x03\n\x17LookupResourcesResponse\x12:\n\x0clooked_up_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenR\nlookedUpAt\x12,\n\x12resource_object_id\x18\x02 \x01(\tR\x10resourceObjectId\x12X\n\x0epermissionship\x18\x03 \x01(\x0e\x32$.authzed.api.v1.LookupPermissionshipB\n\xfa\x42\x07\x82\x01\x04\x10\x01 \x00R\x0epermissionship\x12[\n\x13partial_caveat_info\x18\x04 \x01(\x0b\x32!.authzed.api.v1.PartialCaveatInfoB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x11partialCaveatInfo\x12\x46\n\x13\x61\x66ter_result_cursor\x18\x05 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x11\x61\x66terResultCursor\"\xed\x06\n\x15LookupSubjectsRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12\x45\n\x08resource\x18\x02 \x01(\x0b\x32\x1f.authzed.api.v1.ObjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08resource\x12J\n\npermission\x18\x03 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\npermission\x12x\n\x13subject_object_type\x18\x04 \x01(\tBH\xfa\x42\x45rC(\x80\x01\x32>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$R\x11subjectObjectType\x12\x66\n\x19optional_subject_relation\x18\x05 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\x17optionalSubjectRelation\x12;\n\x07\x63ontext\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x07\x63ontext\x12\x42\n\x17optional_concrete_limit\x18\x07 \x01(\rB\n\xfa\x42\x07*\x05\x18\xe8\x07(\x00R\x15optionalConcreteLimit\x12?\n\x0foptional_cursor\x18\x08 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x0eoptionalCursor\x12]\n\x0fwildcard_option\x18\t \x01(\x0e\x32\x34.authzed.api.v1.LookupSubjectsRequest.WildcardOptionR\x0ewildcardOption\"\x7f\n\x0eWildcardOption\x12\x1f\n\x1bWILDCARD_OPTION_UNSPECIFIED\x10\x00\x12%\n!WILDCARD_OPTION_INCLUDE_WILDCARDS\x10\x01\x12%\n!WILDCARD_OPTION_EXCLUDE_WILDCARDS\x10\x02\"\xc6\x04\n\x16LookupSubjectsResponse\x12:\n\x0clooked_up_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenR\nlookedUpAt\x12.\n\x11subject_object_id\x18\x02 \x01(\tB\x02\x18\x01R\x0fsubjectObjectId\x12\x34\n\x14\x65xcluded_subject_ids\x18\x03 \x03(\tB\x02\x18\x01R\x12\x65xcludedSubjectIds\x12Z\n\x0epermissionship\x18\x04 \x01(\x0e\x32$.authzed.api.v1.LookupPermissionshipB\x0c\x18\x01\xfa\x42\x07\x82\x01\x04\x10\x01 \x00R\x0epermissionship\x12]\n\x13partial_caveat_info\x18\x05 \x01(\x0b\x32!.authzed.api.v1.PartialCaveatInfoB\n\x18\x01\xfa\x42\x05\x8a\x01\x02\x10\x00R\x11partialCaveatInfo\x12\x39\n\x07subject\x18\x06 \x01(\x0b\x32\x1f.authzed.api.v1.ResolvedSubjectR\x07subject\x12L\n\x11\x65xcluded_subjects\x18\x07 \x03(\x0b\x32\x1f.authzed.api.v1.ResolvedSubjectR\x10\x65xcludedSubjects\x12\x46\n\x13\x61\x66ter_result_cursor\x18\x08 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x11\x61\x66terResultCursor\"\xf4\x01\n\x0fResolvedSubject\x12*\n\x11subject_object_id\x18\x01 \x01(\tR\x0fsubjectObjectId\x12X\n\x0epermissionship\x18\x02 \x01(\x0e\x32$.authzed.api.v1.LookupPermissionshipB\n\xfa\x42\x07\x82\x01\x04\x10\x01 \x00R\x0epermissionship\x12[\n\x13partial_caveat_info\x18\x03 \x01(\x0b\x32!.authzed.api.v1.PartialCaveatInfoB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x11partialCaveatInfo*\x99\x01\n\x14LookupPermissionship\x12%\n!LOOKUP_PERMISSIONSHIP_UNSPECIFIED\x10\x00\x12(\n$LOOKUP_PERMISSIONSHIP_HAS_PERMISSION\x10\x01\x12\x30\n,LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION\x10\x02\x32\x80\x08\n\x12PermissionsService\x12\x8d\x01\n\x11ReadRelationships\x12(.authzed.api.v1.ReadRelationshipsRequest\x1a).authzed.api.v1.ReadRelationshipsResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/v1/relationships/read:\x01*0\x01\x12\x8f\x01\n\x12WriteRelationships\x12).authzed.api.v1.WriteRelationshipsRequest\x1a*.authzed.api.v1.WriteRelationshipsResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/v1/relationships/write:\x01*\x12\x93\x01\n\x13\x44\x65leteRelationships\x12*.authzed.api.v1.DeleteRelationshipsRequest\x1a+.authzed.api.v1.DeleteRelationshipsResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/v1/relationships/delete:\x01*\x12\x84\x01\n\x0f\x43heckPermission\x12&.authzed.api.v1.CheckPermissionRequest\x1a\'.authzed.api.v1.CheckPermissionResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/v1/permissions/check:\x01*\x12\x94\x01\n\x14\x45xpandPermissionTree\x12+.authzed.api.v1.ExpandPermissionTreeRequest\x1a,.authzed.api.v1.ExpandPermissionTreeResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/v1/permissions/expand:\x01*\x12\x8a\x01\n\x0fLookupResources\x12&.authzed.api.v1.LookupResourcesRequest\x1a\'.authzed.api.v1.LookupResourcesResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/v1/permissions/resources:\x01*0\x01\x12\x86\x01\n\x0eLookupSubjects\x12%.authzed.api.v1.LookupSubjectsRequest\x1a&.authzed.api.v1.LookupSubjectsResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/v1/permissions/subjects:\x01*0\x01\x42H\n\x12\x63om.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3"
14
+
15
+ pool = Google::Protobuf::DescriptorPool.generated_pool
16
+
17
+ begin
18
+ pool.add_serialized_file(descriptor_data)
19
+ rescue TypeError
20
+ # Compatibility code: will be removed in the next major version.
21
+ require 'google/protobuf/descriptor_pb'
22
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
23
+ parsed.clear_dependency
24
+ serialized = parsed.class.encode(parsed)
25
+ file = pool.add_serialized_file(serialized)
26
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
27
+ imports = [
28
+ ["authzed.api.v1.ZedToken", "authzed/api/v1/core.proto"],
29
+ ["google.protobuf.Struct", "google/protobuf/struct.proto"],
30
+ ]
31
+ imports.each do |type_name, expected_filename|
32
+ import_file = pool.lookup(type_name).file_descriptor
33
+ if import_file.name != expected_filename
34
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
135
35
  end
136
36
  end
37
+ warn "Each proto file must use a consistent fully-qualified name."
38
+ warn "This will become an error in the next major version."
137
39
  end
138
40
 
139
41
  module Authzed
@@ -151,8 +53,8 @@ module Authzed
151
53
  WriteRelationshipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.WriteRelationshipsResponse").msgclass
152
54
  DeleteRelationshipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.DeleteRelationshipsRequest").msgclass
153
55
  DeleteRelationshipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.DeleteRelationshipsResponse").msgclass
56
+ DeleteRelationshipsResponse::DeletionProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.DeleteRelationshipsResponse.DeletionProgress").enummodule
154
57
  CheckPermissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.CheckPermissionRequest").msgclass
155
- PartialCaveatInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.PartialCaveatInfo").msgclass
156
58
  CheckPermissionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.CheckPermissionResponse").msgclass
157
59
  CheckPermissionResponse::Permissionship = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.CheckPermissionResponse.Permissionship").enummodule
158
60
  ExpandPermissionTreeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.ExpandPermissionTreeRequest").msgclass
@@ -160,6 +62,7 @@ module Authzed
160
62
  LookupResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.LookupResourcesRequest").msgclass
161
63
  LookupResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.LookupResourcesResponse").msgclass
162
64
  LookupSubjectsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.LookupSubjectsRequest").msgclass
65
+ LookupSubjectsRequest::WildcardOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.LookupSubjectsRequest.WildcardOption").enummodule
163
66
  LookupSubjectsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.LookupSubjectsResponse").msgclass
164
67
  ResolvedSubject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.ResolvedSubject").msgclass
165
68
  LookupPermissionship = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v1.LookupPermissionship").enummodule
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: authzed/api/v1/schema_service.proto
3
4
 
@@ -5,20 +6,34 @@ require 'google/protobuf'
5
6
 
6
7
  require 'google/api/annotations_pb'
7
8
  require 'validate/validate_pb'
9
+ require 'authzed/api/v1/core_pb'
8
10
 
9
- Google::Protobuf::DescriptorPool.generated_pool.build do
10
- add_file("authzed/api/v1/schema_service.proto", :syntax => :proto3) do
11
- add_message "authzed.api.v1.ReadSchemaRequest" do
12
- end
13
- add_message "authzed.api.v1.ReadSchemaResponse" do
14
- optional :schema_text, :string, 1, json_name: "schemaText"
15
- end
16
- add_message "authzed.api.v1.WriteSchemaRequest" do
17
- optional :schema, :string, 1, json_name: "schema"
18
- end
19
- add_message "authzed.api.v1.WriteSchemaResponse" do
11
+
12
+ descriptor_data = "\n#authzed/api/v1/schema_service.proto\x12\x0e\x61uthzed.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17validate/validate.proto\x1a\x19\x61uthzed/api/v1/core.proto\"\x13\n\x11ReadSchemaRequest\"r\n\x12ReadSchemaResponse\x12\x1f\n\x0bschema_text\x18\x01 \x01(\tR\nschemaText\x12;\n\x07read_at\x18\x02 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06readAt\"7\n\x12WriteSchemaRequest\x12!\n\x06schema\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04(\x80\x80\x10R\x06schema\"X\n\x13WriteSchemaResponse\x12\x41\n\nwritten_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\twrittenAt2\xf5\x01\n\rSchemaService\x12o\n\nReadSchema\x12!.authzed.api.v1.ReadSchemaRequest\x1a\".authzed.api.v1.ReadSchemaResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/v1/schema/read:\x01*\x12s\n\x0bWriteSchema\x12\".authzed.api.v1.WriteSchemaRequest\x1a#.authzed.api.v1.WriteSchemaResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v1/schema/write:\x01*BH\n\x12\x63om.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3"
13
+
14
+ pool = Google::Protobuf::DescriptorPool.generated_pool
15
+
16
+ begin
17
+ pool.add_serialized_file(descriptor_data)
18
+ rescue TypeError
19
+ # Compatibility code: will be removed in the next major version.
20
+ require 'google/protobuf/descriptor_pb'
21
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
22
+ parsed.clear_dependency
23
+ serialized = parsed.class.encode(parsed)
24
+ file = pool.add_serialized_file(serialized)
25
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
26
+ imports = [
27
+ ["authzed.api.v1.ZedToken", "authzed/api/v1/core.proto"],
28
+ ]
29
+ imports.each do |type_name, expected_filename|
30
+ import_file = pool.lookup(type_name).file_descriptor
31
+ if import_file.name != expected_filename
32
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
20
33
  end
21
34
  end
35
+ warn "Each proto file must use a consistent fully-qualified name."
36
+ warn "This will become an error in the next major version."
22
37
  end
23
38
 
24
39
  module Authzed
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: authzed/api/v1/watch_service.proto
3
4
 
@@ -7,17 +8,32 @@ require 'google/api/annotations_pb'
7
8
  require 'validate/validate_pb'
8
9
  require 'authzed/api/v1/core_pb'
9
10
 
10
- Google::Protobuf::DescriptorPool.generated_pool.build do
11
- add_file("authzed/api/v1/watch_service.proto", :syntax => :proto3) do
12
- add_message "authzed.api.v1.WatchRequest" do
13
- repeated :optional_object_types, :string, 1, json_name: "optionalObjectTypes"
14
- optional :optional_start_cursor, :message, 2, "authzed.api.v1.ZedToken", json_name: "optionalStartCursor"
15
- end
16
- add_message "authzed.api.v1.WatchResponse" do
17
- repeated :updates, :message, 1, "authzed.api.v1.RelationshipUpdate", json_name: "updates"
18
- optional :changes_through, :message, 2, "authzed.api.v1.ZedToken", json_name: "changesThrough"
11
+
12
+ descriptor_data = "\n\"authzed/api/v1/watch_service.proto\x12\x0e\x61uthzed.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17validate/validate.proto\x1a\x19\x61uthzed/api/v1/core.proto\"\xe2\x01\n\x0cWatchRequest\x12\x83\x01\n\x15optional_object_types\x18\x01 \x03(\tBO\xfa\x42L\x92\x01I\x08\x00\"ErC(\x80\x01\x32>^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$R\x13optionalObjectTypes\x12L\n\x15optional_start_cursor\x18\x02 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenR\x13optionalStartCursor\"\x90\x01\n\rWatchResponse\x12<\n\x07updates\x18\x01 \x03(\x0b\x32\".authzed.api.v1.RelationshipUpdateR\x07updates\x12\x41\n\x0f\x63hanges_through\x18\x02 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenR\x0e\x63hangesThrough2l\n\x0cWatchService\x12\\\n\x05Watch\x12\x1c.authzed.api.v1.WatchRequest\x1a\x1d.authzed.api.v1.WatchResponse\"\x14\x82\xd3\xe4\x93\x02\x0e\"\t/v1/watch:\x01*0\x01\x42H\n\x12\x63om.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3"
13
+
14
+ pool = Google::Protobuf::DescriptorPool.generated_pool
15
+
16
+ begin
17
+ pool.add_serialized_file(descriptor_data)
18
+ rescue TypeError
19
+ # Compatibility code: will be removed in the next major version.
20
+ require 'google/protobuf/descriptor_pb'
21
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
22
+ parsed.clear_dependency
23
+ serialized = parsed.class.encode(parsed)
24
+ file = pool.add_serialized_file(serialized)
25
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
26
+ imports = [
27
+ ["authzed.api.v1.ZedToken", "authzed/api/v1/core.proto"],
28
+ ]
29
+ imports.each do |type_name, expected_filename|
30
+ import_file = pool.lookup(type_name).file_descriptor
31
+ if import_file.name != expected_filename
32
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
19
33
  end
20
34
  end
35
+ warn "Each proto file must use a consistent fully-qualified name."
36
+ warn "This will become an error in the next major version."
21
37
  end
22
38
 
23
39
  module Authzed
data/lib/authzed.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require 'authzed/api/v1/schema_service_services_pb'
2
2
  require 'authzed/api/v1/watch_service_services_pb'
3
3
  require 'authzed/api/v1/permission_service_services_pb'
4
+ require 'authzed/api/v1/experimental_service_services_pb'
4
5
  require 'authzed/api/v1/client'
5
6
  require 'grpcutil/bearer_token'
6
7
 
7
8
  module Authzed
8
- end
9
+ end
@@ -0,0 +1,31 @@
1
+ # Generated protoc-gen-validate descriptors
2
+
3
+ Changes introduced after Ruby protoc changes described in https://protobuf.dev/news/2023-04-20/
4
+
5
+ The blog post reads
6
+
7
+ > add_serialized_file verifies that all dependencies listed in the descriptor were previously added with add_serialized_file. Generally that should be fine, because the generated code will contain Ruby require statements for all dependencies, and the descriptor will fail to load anyway if the types depended on were not previously defined in the DescriptorPool.
8
+
9
+ `protoc-gen-validate` does not offer ruby templates for protoc, so for `authzed-rb` the workaround has been to
10
+ generate an empty stub to satisfy the import.
11
+
12
+ The new Ruby code expects all type descriptors to be loaded, so a warning emerges when a dependency hasn't been loaded:
13
+
14
+ ```
15
+ #<Google::Protobuf::TypeError: Unable to build file to DescriptorPool: Depends on file 'validate/validate.proto', but it has not been loaded>
16
+
17
+ Warning: Protobuf detected an import path issue while loading generated file /usr/local/rvm/gems/ruby-3.1.4/gems/authzed-0.7.0/lib/authzed/api/v1/core_pb.rb
18
+ Each proto file must use a consistent fully-qualified name.
19
+ This will become an error in the next major version.
20
+ ```
21
+
22
+ This folder vendors the `validate.proto` file and generates Ruby code out of it using buf.
23
+
24
+ ## How to generate
25
+
26
+ ```bash
27
+ # run from /lib folder
28
+ ./validate/buf.gen.yaml
29
+ ```
30
+
31
+ Note: It's important to run this from /lib, to make sure the generated descriptor name matches `validate/validate.proto`
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env -S buf generate --template
2
+ version: "v1"
3
+ plugins:
4
+ - name: "ruby"
5
+ out: "."
@@ -0,0 +1,2 @@
1
+ # Generated by buf. DO NOT EDIT.
2
+ version: v1
@@ -0,0 +1,3 @@
1
+ ---
2
+ version: "v1"
3
+ name: "buf.build/envoyproxy/protoc-gen-validate"