-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathauthorization.proto
67 lines (54 loc) · 1.93 KB
/
authorization.proto
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
syntax = "proto3";
package runtime.iam.v1;
option go_package = "github.com/metal-toolbox/iam-runtime/pkg/runtime/authorization";
service Authorization {
rpc CheckAccess(CheckAccessRequest)
returns (CheckAccessResponse) {}
rpc CreateRelationships(CreateRelationshipsRequest)
returns (CreateRelationshipsResponse) {}
rpc DeleteRelationships(DeleteRelationshipsRequest)
returns (DeleteRelationshipsResponse) {}
}
message Relationship {
// relation is the name of the relationship between two resources.
string relation = 1;
// subject_id is the ID of the subject (i.e., "other end") of the relationship.
string subject_id = 2;
}
message AccessRequestAction {
// action is the name of the action the subject is attempting to perform an action on.
string action = 1;
// resource_id is the ID of the resource the subject is attempting to perform an action on.
string resource_id = 2;
}
message CheckAccessRequest {
// credential is the literal credential for a subject (such as a bearer token) passed to the
// application with no transformations applied.
string credential = 1;
// actions is the set of all actions to check access for. All of these must be allowed for the
// request itself to be allowed.
repeated AccessRequestAction actions = 2;
}
message CheckAccessResponse {
enum Result {
RESULT_ALLOWED = 0;
RESULT_DENIED = 1;
}
Result result = 1;
}
message CreateRelationshipsRequest {
// resource_id is the ID of the resource to create relationships for.
string resource_id = 1;
// relationships is the set of relationships to create.
repeated Relationship relationships = 2;
}
message CreateRelationshipsResponse {
}
message DeleteRelationshipsRequest {
// resource_id is the ID of the resource to delete relationships for.
string resource_id = 1;
// relationships is the set of relationships to delete.
repeated Relationship relationships = 2;
}
message DeleteRelationshipsResponse {
}