76ade7efd9
* Refresh => Token * Secret is no longer a token Co-authored-by: Ben Toogood <ben@micro.mu>
80 lines
1.3 KiB
Protocol Buffer
80 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package go.micro.auth;
|
|
|
|
option go_package = "auth;auth";
|
|
|
|
service Auth {
|
|
rpc Generate(GenerateRequest) returns (GenerateResponse) {};
|
|
rpc Inspect(InspectRequest) returns (InspectResponse) {};
|
|
rpc Token(TokenRequest) returns (TokenResponse) {};
|
|
}
|
|
|
|
message Token {
|
|
string token = 1;
|
|
string type = 2;
|
|
int64 created = 3;
|
|
int64 expiry = 4;
|
|
string subject = 5;
|
|
repeated string roles = 6;
|
|
map<string, string> metadata = 7;
|
|
string namespace = 8;
|
|
}
|
|
|
|
message Account {
|
|
string id = 1;
|
|
string secret = 2;
|
|
repeated string roles = 3;
|
|
map<string, string> metadata = 4;
|
|
string namespace = 5;
|
|
}
|
|
|
|
message Resource{
|
|
string name = 1;
|
|
string type = 2;
|
|
string endpoint = 3;
|
|
}
|
|
|
|
message GenerateRequest {
|
|
string id = 1;
|
|
repeated string roles = 2;
|
|
map<string, string> metadata = 3;
|
|
string namespace = 4;
|
|
}
|
|
|
|
message GenerateResponse {
|
|
Account account = 1;
|
|
}
|
|
|
|
message GrantRequest {
|
|
string role = 1;
|
|
Resource resource = 2;
|
|
}
|
|
|
|
message GrantResponse {}
|
|
|
|
message RevokeRequest {
|
|
string role = 1;
|
|
Resource resource = 2;
|
|
}
|
|
|
|
message RevokeResponse {}
|
|
|
|
message InspectRequest {
|
|
string token = 1;
|
|
}
|
|
|
|
message InspectResponse {
|
|
Account account = 1;
|
|
}
|
|
|
|
message TokenRequest {
|
|
string id = 1;
|
|
string secret = 2;
|
|
int64 token_expiry = 3;
|
|
}
|
|
|
|
message TokenResponse {
|
|
Token token = 1;
|
|
}
|