authzed 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authzed/api/v1/client.rb +8 -1
- data/lib/authzed/api/v1/core_pb.rb +27 -53
- data/lib/authzed/api/v1/debug_pb.rb +31 -29
- data/lib/authzed/api/v1/error_reason_pb.rb +24 -17
- data/lib/authzed/api/v1/experimental_service_pb.rb +61 -0
- data/lib/authzed/api/v1/experimental_service_services_pb.rb +43 -0
- data/lib/authzed/api/v1/openapi_pb.rb +25 -2
- data/lib/authzed/api/v1/permission_service_pb.rb +28 -125
- data/lib/authzed/api/v1/schema_service_pb.rb +26 -11
- data/lib/authzed/api/v1/watch_service_pb.rb +25 -9
- data/lib/authzed.rb +2 -1
- metadata +8 -15
- data/lib/authzed/api/v0/client.rb +0 -61
- data/lib/authzed/api/v0/core_pb.rb +0 -40
- data/lib/authzed/api/v0/developer_pb.rb +0 -132
- data/lib/authzed/api/v0/developer_services_pb.rb +0 -31
- data/lib/authzed/api/v1alpha1/client.rb +0 -25
- data/lib/authzed/api/v1alpha1/schema_pb.rb +0 -37
- data/lib/authzed/api/v1alpha1/schema_services_pb.rb +0 -36
- data/lib/authzed/api/v1alpha1/watchresources_service_pb.rb +0 -46
- data/lib/authzed/api/v1alpha1/watchresources_service_services_pb.rb +0 -30
@@ -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
|
-
|
12
|
-
add_file("authzed/api/v1/permission_service.proto", :syntax => :proto3) do
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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:\x01*\"\x16/v1/relationships/read0\x01\x12\x8f\x01\n\x12WriteRelationships\x12).authzed.api.v1.WriteRelationshipsRequest\x1a*.authzed.api.v1.WriteRelationshipsResponse\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/v1/relationships/write\x12\x93\x01\n\x13\x44\x65leteRelationships\x12*.authzed.api.v1.DeleteRelationshipsRequest\x1a+.authzed.api.v1.DeleteRelationshipsResponse\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/relationships/delete\x12\x84\x01\n\x0f\x43heckPermission\x12&.authzed.api.v1.CheckPermissionRequest\x1a\'.authzed.api.v1.CheckPermissionResponse\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/v1/permissions/check\x12\x94\x01\n\x14\x45xpandPermissionTree\x12+.authzed.api.v1.ExpandPermissionTreeRequest\x1a,.authzed.api.v1.ExpandPermissionTreeResponse\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/v1/permissions/expand\x12\x8a\x01\n\x0fLookupResources\x12&.authzed.api.v1.LookupResourcesRequest\x1a\'.authzed.api.v1.LookupResourcesResponse\"$\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v1/permissions/resources0\x01\x12\x86\x01\n\x0eLookupSubjects\x12%.authzed.api.v1.LookupSubjectsRequest\x1a&.authzed.api.v1.LookupSubjectsResponse\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/permissions/subjects0\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 => e
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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:\x01*\"\x0f/v1/schema/read\x12s\n\x0bWriteSchema\x12\".authzed.api.v1.WriteSchemaRequest\x1a#.authzed.api.v1.WriteSchemaResponse\"\x1b\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/v1/schema/writeBH\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 => e
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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:\x01*\"\t/v1/watch0\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 => e
|
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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authzed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Authzed
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|
@@ -62,14 +62,12 @@ files:
|
|
62
62
|
- LICENSE
|
63
63
|
- README.md
|
64
64
|
- lib/authzed.rb
|
65
|
-
- lib/authzed/api/v0/client.rb
|
66
|
-
- lib/authzed/api/v0/core_pb.rb
|
67
|
-
- lib/authzed/api/v0/developer_pb.rb
|
68
|
-
- lib/authzed/api/v0/developer_services_pb.rb
|
69
65
|
- lib/authzed/api/v1/client.rb
|
70
66
|
- lib/authzed/api/v1/core_pb.rb
|
71
67
|
- lib/authzed/api/v1/debug_pb.rb
|
72
68
|
- lib/authzed/api/v1/error_reason_pb.rb
|
69
|
+
- lib/authzed/api/v1/experimental_service_pb.rb
|
70
|
+
- lib/authzed/api/v1/experimental_service_services_pb.rb
|
73
71
|
- lib/authzed/api/v1/openapi_pb.rb
|
74
72
|
- lib/authzed/api/v1/permission_service_pb.rb
|
75
73
|
- lib/authzed/api/v1/permission_service_services_pb.rb
|
@@ -77,11 +75,6 @@ files:
|
|
77
75
|
- lib/authzed/api/v1/schema_service_services_pb.rb
|
78
76
|
- lib/authzed/api/v1/watch_service_pb.rb
|
79
77
|
- lib/authzed/api/v1/watch_service_services_pb.rb
|
80
|
-
- lib/authzed/api/v1alpha1/client.rb
|
81
|
-
- lib/authzed/api/v1alpha1/schema_pb.rb
|
82
|
-
- lib/authzed/api/v1alpha1/schema_services_pb.rb
|
83
|
-
- lib/authzed/api/v1alpha1/watchresources_service_pb.rb
|
84
|
-
- lib/authzed/api/v1alpha1/watchresources_service_services_pb.rb
|
85
78
|
- lib/grpcutil/bearer_token.rb
|
86
79
|
- lib/validate/validate_pb.rb
|
87
80
|
homepage: https://authzed.com
|
@@ -92,7 +85,7 @@ metadata:
|
|
92
85
|
github_repo: ssh://github.com/authzed/authzed-rb
|
93
86
|
homepage_uri: https://authzed.com
|
94
87
|
source_code_uri: https://github.com/authzed/authzed-rb
|
95
|
-
post_install_message:
|
88
|
+
post_install_message:
|
96
89
|
rdoc_options: []
|
97
90
|
require_paths:
|
98
91
|
- lib
|
@@ -107,8 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
100
|
- !ruby/object:Gem::Version
|
108
101
|
version: '0'
|
109
102
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
111
|
-
signing_key:
|
103
|
+
rubygems_version: 3.0.1
|
104
|
+
signing_key:
|
112
105
|
specification_version: 4
|
113
106
|
summary: Ruby bindings for Authzed API
|
114
107
|
test_files: []
|
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'grpc'
|
2
|
-
|
3
|
-
module Authzed
|
4
|
-
module Api
|
5
|
-
module V0
|
6
|
-
class Client
|
7
|
-
attr_reader :acl_service, :developer_service, :namespace_service, :watch_service
|
8
|
-
|
9
|
-
def initialize(target:, credentials: nil, interceptors: [], options: {}, timeout: nil)
|
10
|
-
creds = credentials || GRPC::Core::ChannelCredentials.new
|
11
|
-
|
12
|
-
@acl_service = ACLService::Stub.new(
|
13
|
-
target,
|
14
|
-
creds,
|
15
|
-
timeout: timeout,
|
16
|
-
interceptors: interceptors,
|
17
|
-
channel_args: options,
|
18
|
-
)
|
19
|
-
@developer_service = DeveloperService::Stub.new(
|
20
|
-
target,
|
21
|
-
creds,
|
22
|
-
timeout: timeout,
|
23
|
-
interceptors: interceptors,
|
24
|
-
channel_args: options,
|
25
|
-
)
|
26
|
-
@namespace_service = NamespaceService::Stub.new(
|
27
|
-
target,
|
28
|
-
creds,
|
29
|
-
timeout: timeout,
|
30
|
-
interceptors: interceptors,
|
31
|
-
channel_args: options,
|
32
|
-
)
|
33
|
-
@watch_service = WatchService::Stub.new(
|
34
|
-
target,
|
35
|
-
creds,
|
36
|
-
timeout: timeout,
|
37
|
-
interceptors: interceptors,
|
38
|
-
channel_args: options,
|
39
|
-
)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# Utility method for creating usersets
|
44
|
-
module UserPatch
|
45
|
-
def self.included(base)
|
46
|
-
def base.for(namespace:, object_id:)
|
47
|
-
Authzed::Api::V0::User.new(
|
48
|
-
userset: Authzed::Api::V0::ObjectAndRelation.new(
|
49
|
-
namespace: namespace,
|
50
|
-
object_id: object_id,
|
51
|
-
relation: '...',
|
52
|
-
)
|
53
|
-
)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
User.include(UserPatch)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: authzed/api/v0/core.proto
|
3
|
-
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
|
-
require 'validate/validate_pb'
|
7
|
-
|
8
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
-
add_file("authzed/api/v0/core.proto", :syntax => :proto3) do
|
10
|
-
add_message "authzed.api.v0.RelationTuple" do
|
11
|
-
optional :object_and_relation, :message, 1, "authzed.api.v0.ObjectAndRelation", json_name: "objectAndRelation"
|
12
|
-
optional :user, :message, 2, "authzed.api.v0.User", json_name: "user"
|
13
|
-
end
|
14
|
-
add_message "authzed.api.v0.ObjectAndRelation" do
|
15
|
-
optional :namespace, :string, 1, json_name: "namespace"
|
16
|
-
optional :object_id, :string, 2, json_name: "objectId"
|
17
|
-
optional :relation, :string, 3, json_name: "relation"
|
18
|
-
end
|
19
|
-
add_message "authzed.api.v0.RelationReference" do
|
20
|
-
optional :namespace, :string, 1, json_name: "namespace"
|
21
|
-
optional :relation, :string, 3, json_name: "relation"
|
22
|
-
end
|
23
|
-
add_message "authzed.api.v0.User" do
|
24
|
-
oneof :user_oneof do
|
25
|
-
optional :userset, :message, 2, "authzed.api.v0.ObjectAndRelation", json_name: "userset"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
module Authzed
|
32
|
-
module Api
|
33
|
-
module V0
|
34
|
-
RelationTuple = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.RelationTuple").msgclass
|
35
|
-
ObjectAndRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.ObjectAndRelation").msgclass
|
36
|
-
RelationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.RelationReference").msgclass
|
37
|
-
User = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.User").msgclass
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,132 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: authzed/api/v0/developer.proto
|
3
|
-
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
|
-
require 'authzed/api/v0/core_pb'
|
7
|
-
|
8
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
-
add_file("authzed/api/v0/developer.proto", :syntax => :proto3) do
|
10
|
-
add_message "authzed.api.v0.FormatSchemaRequest" do
|
11
|
-
optional :schema, :string, 1, json_name: "schema"
|
12
|
-
end
|
13
|
-
add_message "authzed.api.v0.FormatSchemaResponse" do
|
14
|
-
optional :error, :message, 1, "authzed.api.v0.DeveloperError", json_name: "error"
|
15
|
-
optional :formatted_schema, :string, 2, json_name: "formattedSchema"
|
16
|
-
end
|
17
|
-
add_message "authzed.api.v0.UpgradeSchemaRequest" do
|
18
|
-
repeated :namespace_configs, :string, 1, json_name: "namespaceConfigs"
|
19
|
-
end
|
20
|
-
add_message "authzed.api.v0.UpgradeSchemaResponse" do
|
21
|
-
optional :error, :message, 1, "authzed.api.v0.DeveloperError", json_name: "error"
|
22
|
-
optional :upgraded_schema, :string, 2, json_name: "upgradedSchema"
|
23
|
-
end
|
24
|
-
add_message "authzed.api.v0.ShareRequest" do
|
25
|
-
optional :schema, :string, 1, json_name: "schema"
|
26
|
-
optional :relationships_yaml, :string, 2, json_name: "relationshipsYaml"
|
27
|
-
optional :validation_yaml, :string, 3, json_name: "validationYaml"
|
28
|
-
optional :assertions_yaml, :string, 4, json_name: "assertionsYaml"
|
29
|
-
end
|
30
|
-
add_message "authzed.api.v0.ShareResponse" do
|
31
|
-
optional :share_reference, :string, 1, json_name: "shareReference"
|
32
|
-
end
|
33
|
-
add_message "authzed.api.v0.LookupShareRequest" do
|
34
|
-
optional :share_reference, :string, 1, json_name: "shareReference"
|
35
|
-
end
|
36
|
-
add_message "authzed.api.v0.LookupShareResponse" do
|
37
|
-
optional :status, :enum, 1, "authzed.api.v0.LookupShareResponse.LookupStatus", json_name: "status"
|
38
|
-
optional :schema, :string, 2, json_name: "schema"
|
39
|
-
optional :relationships_yaml, :string, 3, json_name: "relationshipsYaml"
|
40
|
-
optional :validation_yaml, :string, 4, json_name: "validationYaml"
|
41
|
-
optional :assertions_yaml, :string, 5, json_name: "assertionsYaml"
|
42
|
-
end
|
43
|
-
add_enum "authzed.api.v0.LookupShareResponse.LookupStatus" do
|
44
|
-
value :UNKNOWN_REFERENCE, 0
|
45
|
-
value :FAILED_TO_LOOKUP, 1
|
46
|
-
value :VALID_REFERENCE, 2
|
47
|
-
value :UPGRADED_REFERENCE, 3
|
48
|
-
end
|
49
|
-
add_message "authzed.api.v0.RequestContext" do
|
50
|
-
optional :schema, :string, 1, json_name: "schema"
|
51
|
-
repeated :relationships, :message, 2, "authzed.api.v0.RelationTuple", json_name: "relationships"
|
52
|
-
end
|
53
|
-
add_message "authzed.api.v0.EditCheckRequest" do
|
54
|
-
optional :context, :message, 1, "authzed.api.v0.RequestContext", json_name: "context"
|
55
|
-
repeated :check_relationships, :message, 2, "authzed.api.v0.RelationTuple", json_name: "checkRelationships"
|
56
|
-
end
|
57
|
-
add_message "authzed.api.v0.EditCheckResult" do
|
58
|
-
optional :relationship, :message, 1, "authzed.api.v0.RelationTuple", json_name: "relationship"
|
59
|
-
optional :is_member, :bool, 2, json_name: "isMember"
|
60
|
-
optional :error, :message, 3, "authzed.api.v0.DeveloperError", json_name: "error"
|
61
|
-
end
|
62
|
-
add_message "authzed.api.v0.EditCheckResponse" do
|
63
|
-
repeated :request_errors, :message, 1, "authzed.api.v0.DeveloperError", json_name: "requestErrors"
|
64
|
-
repeated :check_results, :message, 2, "authzed.api.v0.EditCheckResult", json_name: "checkResults"
|
65
|
-
end
|
66
|
-
add_message "authzed.api.v0.ValidateRequest" do
|
67
|
-
optional :context, :message, 1, "authzed.api.v0.RequestContext", json_name: "context"
|
68
|
-
optional :validation_yaml, :string, 3, json_name: "validationYaml"
|
69
|
-
optional :update_validation_yaml, :bool, 4, json_name: "updateValidationYaml"
|
70
|
-
optional :assertions_yaml, :string, 5, json_name: "assertionsYaml"
|
71
|
-
end
|
72
|
-
add_message "authzed.api.v0.ValidateResponse" do
|
73
|
-
repeated :request_errors, :message, 1, "authzed.api.v0.DeveloperError", json_name: "requestErrors"
|
74
|
-
repeated :validation_errors, :message, 2, "authzed.api.v0.DeveloperError", json_name: "validationErrors"
|
75
|
-
optional :updated_validation_yaml, :string, 3, json_name: "updatedValidationYaml"
|
76
|
-
end
|
77
|
-
add_message "authzed.api.v0.DeveloperError" do
|
78
|
-
optional :message, :string, 1, json_name: "message"
|
79
|
-
optional :line, :uint32, 2, json_name: "line"
|
80
|
-
optional :column, :uint32, 3, json_name: "column"
|
81
|
-
optional :source, :enum, 4, "authzed.api.v0.DeveloperError.Source", json_name: "source"
|
82
|
-
optional :kind, :enum, 5, "authzed.api.v0.DeveloperError.ErrorKind", json_name: "kind"
|
83
|
-
repeated :path, :string, 6, json_name: "path"
|
84
|
-
optional :context, :string, 7, json_name: "context"
|
85
|
-
end
|
86
|
-
add_enum "authzed.api.v0.DeveloperError.Source" do
|
87
|
-
value :UNKNOWN_SOURCE, 0
|
88
|
-
value :SCHEMA, 1
|
89
|
-
value :RELATIONSHIP, 2
|
90
|
-
value :VALIDATION_YAML, 3
|
91
|
-
value :CHECK_WATCH, 4
|
92
|
-
value :ASSERTION, 5
|
93
|
-
end
|
94
|
-
add_enum "authzed.api.v0.DeveloperError.ErrorKind" do
|
95
|
-
value :UNKNOWN_KIND, 0
|
96
|
-
value :PARSE_ERROR, 1
|
97
|
-
value :SCHEMA_ISSUE, 2
|
98
|
-
value :DUPLICATE_RELATIONSHIP, 3
|
99
|
-
value :MISSING_EXPECTED_RELATIONSHIP, 4
|
100
|
-
value :EXTRA_RELATIONSHIP_FOUND, 5
|
101
|
-
value :UNKNOWN_OBJECT_TYPE, 6
|
102
|
-
value :UNKNOWN_RELATION, 7
|
103
|
-
value :MAXIMUM_RECURSION, 8
|
104
|
-
value :ASSERTION_FAILED, 9
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
module Authzed
|
110
|
-
module Api
|
111
|
-
module V0
|
112
|
-
FormatSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.FormatSchemaRequest").msgclass
|
113
|
-
FormatSchemaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.FormatSchemaResponse").msgclass
|
114
|
-
UpgradeSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.UpgradeSchemaRequest").msgclass
|
115
|
-
UpgradeSchemaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.UpgradeSchemaResponse").msgclass
|
116
|
-
ShareRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.ShareRequest").msgclass
|
117
|
-
ShareResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.ShareResponse").msgclass
|
118
|
-
LookupShareRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.LookupShareRequest").msgclass
|
119
|
-
LookupShareResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.LookupShareResponse").msgclass
|
120
|
-
LookupShareResponse::LookupStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.LookupShareResponse.LookupStatus").enummodule
|
121
|
-
RequestContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.RequestContext").msgclass
|
122
|
-
EditCheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.EditCheckRequest").msgclass
|
123
|
-
EditCheckResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.EditCheckResult").msgclass
|
124
|
-
EditCheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.EditCheckResponse").msgclass
|
125
|
-
ValidateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.ValidateRequest").msgclass
|
126
|
-
ValidateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.ValidateResponse").msgclass
|
127
|
-
DeveloperError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.DeveloperError").msgclass
|
128
|
-
DeveloperError::Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.DeveloperError.Source").enummodule
|
129
|
-
DeveloperError::ErrorKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authzed.api.v0.DeveloperError.ErrorKind").enummodule
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|