2020-02-03 11:16:02 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package go.micro.auth;
|
|
|
|
|
2020-03-31 00:35:11 +03:00
|
|
|
option go_package = "auth;auth";
|
|
|
|
|
2020-02-03 11:16:02 +03:00
|
|
|
service Auth {
|
2020-03-23 19:19:30 +03:00
|
|
|
rpc Generate(GenerateRequest) returns (GenerateResponse) {};
|
2020-03-31 12:06:13 +03:00
|
|
|
rpc Inspect(InspectRequest) returns (InspectResponse) {};
|
|
|
|
rpc Token(TokenRequest) returns (TokenResponse) {};
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
2020-03-23 19:19:30 +03:00
|
|
|
message Token {
|
|
|
|
string token = 1;
|
|
|
|
string type = 2;
|
2020-02-26 01:15:44 +03:00
|
|
|
int64 created = 3;
|
|
|
|
int64 expiry = 4;
|
2020-03-23 19:19:30 +03:00
|
|
|
string subject = 5;
|
|
|
|
repeated string roles = 6;
|
|
|
|
map<string, string> metadata = 7;
|
2020-03-30 11:51:37 +03:00
|
|
|
string namespace = 8;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
2020-03-23 19:19:30 +03:00
|
|
|
message Account {
|
|
|
|
string id = 1;
|
2020-03-31 12:06:13 +03:00
|
|
|
string secret = 2;
|
2020-03-23 19:19:30 +03:00
|
|
|
repeated string roles = 3;
|
|
|
|
map<string, string> metadata = 4;
|
2020-03-30 11:51:37 +03:00
|
|
|
string namespace = 5;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message Resource{
|
2020-02-26 01:15:44 +03:00
|
|
|
string name = 1;
|
|
|
|
string type = 2;
|
2020-03-23 19:19:30 +03:00
|
|
|
string endpoint = 3;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message GenerateRequest {
|
2020-03-23 19:19:30 +03:00
|
|
|
string id = 1;
|
|
|
|
repeated string roles = 2;
|
|
|
|
map<string, string> metadata = 3;
|
2020-03-31 12:06:13 +03:00
|
|
|
string namespace = 4;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message GenerateResponse {
|
2020-02-26 01:15:44 +03:00
|
|
|
Account account = 1;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
2020-03-23 19:19:30 +03:00
|
|
|
message GrantRequest {
|
|
|
|
string role = 1;
|
|
|
|
Resource resource = 2;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
2020-03-23 19:19:30 +03:00
|
|
|
message GrantResponse {}
|
|
|
|
|
2020-02-03 11:16:02 +03:00
|
|
|
message RevokeRequest {
|
2020-03-23 19:19:30 +03:00
|
|
|
string role = 1;
|
|
|
|
Resource resource = 2;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message RevokeResponse {}
|
2020-03-23 19:19:30 +03:00
|
|
|
|
|
|
|
message InspectRequest {
|
|
|
|
string token = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message InspectResponse {
|
|
|
|
Account account = 1;
|
|
|
|
}
|
|
|
|
|
2020-03-31 12:06:13 +03:00
|
|
|
message TokenRequest {
|
|
|
|
string id = 1;
|
|
|
|
string secret = 2;
|
|
|
|
int64 token_expiry = 3;
|
2020-03-23 19:19:30 +03:00
|
|
|
}
|
|
|
|
|
2020-03-31 12:06:13 +03:00
|
|
|
message TokenResponse {
|
2020-03-23 19:19:30 +03:00
|
|
|
Token token = 1;
|
2020-03-31 00:35:11 +03:00
|
|
|
}
|