blob: 9a4b97d1a869e258bb0999e1c02216d2cf580f44 (
plain)
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
|
syntax = "proto3";
package authzed.api.v0;
option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v0";
option java_package = "com.authzed.api.v0";
import "authzed/api/v0/core.proto";
service DeveloperService {
rpc EditCheck(EditCheckRequest) returns (EditCheckResponse) {}
rpc Validate(ValidateRequest) returns (ValidateResponse) {}
rpc Share(ShareRequest) returns (ShareResponse) {}
rpc LookupShared(LookupShareRequest) returns (LookupShareResponse) {}
rpc UpgradeSchema(UpgradeSchemaRequest) returns (UpgradeSchemaResponse) {}
rpc FormatSchema(FormatSchemaRequest) returns (FormatSchemaResponse) {}
}
message FormatSchemaRequest {
string schema = 1;
}
message FormatSchemaResponse {
DeveloperError error = 1;
string formatted_schema = 2;
}
message UpgradeSchemaRequest {
repeated string namespace_configs = 1;
}
message UpgradeSchemaResponse {
DeveloperError error = 1;
string upgraded_schema = 2;
}
message ShareRequest {
string schema = 1;
string relationships_yaml = 2;
string validation_yaml = 3;
string assertions_yaml = 4;
}
message ShareResponse {
string share_reference = 1;
}
message LookupShareRequest {
string share_reference = 1;
}
message LookupShareResponse {
enum LookupStatus {
UNKNOWN_REFERENCE = 0;
FAILED_TO_LOOKUP = 1;
VALID_REFERENCE = 2;
UPGRADED_REFERENCE = 3;
}
LookupStatus status = 1;
string schema = 2;
string relationships_yaml = 3;
string validation_yaml = 4;
string assertions_yaml = 5;
}
message RequestContext {
string schema = 1;
repeated RelationTuple relationships = 2;
reserved 3; // Was legacy_ns_configs
}
message EditCheckRequest {
RequestContext context = 1;
repeated RelationTuple check_relationships = 2;
}
message EditCheckResult {
RelationTuple relationship = 1;
bool is_member = 2;
DeveloperError error = 3;
}
message EditCheckResponse {
repeated DeveloperError request_errors = 1;
repeated EditCheckResult check_results = 2;
}
message ValidateRequest {
RequestContext context = 1;
string validation_yaml = 3;
bool update_validation_yaml = 4;
string assertions_yaml = 5;
}
message ValidateResponse {
repeated DeveloperError request_errors = 1;
repeated DeveloperError validation_errors = 2;
string updated_validation_yaml = 3;
}
message DeveloperError {
enum Source {
UNKNOWN_SOURCE = 0;
SCHEMA = 1;
RELATIONSHIP = 2;
VALIDATION_YAML = 3;
CHECK_WATCH = 4;
ASSERTION = 5;
}
enum ErrorKind {
UNKNOWN_KIND = 0;
PARSE_ERROR = 1;
SCHEMA_ISSUE = 2;
DUPLICATE_RELATIONSHIP = 3;
MISSING_EXPECTED_RELATIONSHIP = 4;
EXTRA_RELATIONSHIP_FOUND = 5;
UNKNOWN_OBJECT_TYPE = 6;
UNKNOWN_RELATION = 7;
MAXIMUM_RECURSION = 8;
ASSERTION_FAILED = 9;
}
string message = 1;
uint32 line = 2;
uint32 column = 3;
Source source = 4;
ErrorKind kind = 5;
repeated string path = 6;
// context holds the context for the error. For schema issues, this will be the
// name of the object type. For relationship issues, the full relationship string.
string context = 7;
}
|