2020-02-03 08:16:02 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package go.micro.auth;
|
|
|
|
|
|
|
|
service Auth {
|
2020-03-23 16:19:30 +00:00
|
|
|
rpc Generate(GenerateRequest) returns (GenerateResponse) {};
|
|
|
|
rpc Grant(GrantRequest) returns (GrantResponse) {};
|
|
|
|
rpc Revoke(RevokeRequest) returns (RevokeResponse) {};
|
|
|
|
rpc Inspect(InspectRequest) returns (InspectResponse) {};
|
|
|
|
rpc Refresh(RefreshRequest) returns (RefreshResponse) {};
|
2020-03-24 13:48:37 +00:00
|
|
|
rpc ListRules(ListRulesRequest) returns (ListRulesResponse) {};
|
|
|
|
}
|
|
|
|
|
|
|
|
message Rule {
|
|
|
|
string id = 1;
|
|
|
|
string role = 2;
|
|
|
|
Resource resource = 3;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
2020-03-23 16:19:30 +00:00
|
|
|
message Token {
|
|
|
|
string token = 1;
|
|
|
|
string type = 2;
|
2020-02-25 22:15:44 +00:00
|
|
|
int64 created = 3;
|
|
|
|
int64 expiry = 4;
|
2020-03-23 16:19:30 +00:00
|
|
|
string subject = 5;
|
|
|
|
repeated string roles = 6;
|
|
|
|
map<string, string> metadata = 7;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
2020-03-23 16:19:30 +00:00
|
|
|
message Account {
|
|
|
|
string id = 1;
|
|
|
|
Token secret = 2;
|
|
|
|
repeated string roles = 3;
|
|
|
|
map<string, string> metadata = 4;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Resource{
|
2020-02-25 22:15:44 +00:00
|
|
|
string name = 1;
|
|
|
|
string type = 2;
|
2020-03-23 16:19:30 +00:00
|
|
|
string endpoint = 3;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GenerateRequest {
|
2020-03-23 16:19:30 +00:00
|
|
|
string id = 1;
|
|
|
|
repeated string roles = 2;
|
|
|
|
map<string, string> metadata = 3;
|
|
|
|
int64 secret_expiry = 4;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GenerateResponse {
|
2020-02-25 22:15:44 +00:00
|
|
|
Account account = 1;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
2020-03-23 16:19:30 +00:00
|
|
|
message GrantRequest {
|
|
|
|
string role = 1;
|
|
|
|
Resource resource = 2;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
2020-03-23 16:19:30 +00:00
|
|
|
message GrantResponse {}
|
|
|
|
|
2020-02-03 08:16:02 +00:00
|
|
|
message RevokeRequest {
|
2020-03-23 16:19:30 +00:00
|
|
|
string role = 1;
|
|
|
|
Resource resource = 2;
|
2020-02-03 08:16:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message RevokeResponse {}
|
2020-03-23 16:19:30 +00:00
|
|
|
|
|
|
|
message InspectRequest {
|
|
|
|
string token = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message InspectResponse {
|
|
|
|
Account account = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RefreshRequest {
|
|
|
|
string secret = 1;
|
|
|
|
int64 token_expiry = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RefreshResponse {
|
|
|
|
Token token = 1;
|
2020-03-24 13:48:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ListRulesRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListRulesResponse {
|
|
|
|
repeated Rule rules = 1;
|
|
|
|
}
|