Auth - Swap Refresh to Token and change secrets to be strings, not tokens (#1444)

* Refresh => Token

* Secret is no longer a token

Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
ben-toogood
2020-03-31 10:06:13 +01:00
committed by GitHub
parent c706ebe3fb
commit 76ade7efd9
7 changed files with 144 additions and 166 deletions

View File

@@ -6,8 +6,8 @@ option go_package = "auth;auth";
service Auth {
rpc Generate(GenerateRequest) returns (GenerateResponse) {};
rpc Inspect(InspectRequest) returns (InspectResponse) {};
rpc Refresh(RefreshRequest) returns (RefreshResponse) {};
rpc Inspect(InspectRequest) returns (InspectResponse) {};
rpc Token(TokenRequest) returns (TokenResponse) {};
}
message Token {
@@ -23,7 +23,7 @@ message Token {
message Account {
string id = 1;
Token secret = 2;
string secret = 2;
repeated string roles = 3;
map<string, string> metadata = 4;
string namespace = 5;
@@ -39,8 +39,7 @@ message GenerateRequest {
string id = 1;
repeated string roles = 2;
map<string, string> metadata = 3;
int64 secret_expiry = 4;
string namespace = 5;
string namespace = 4;
}
message GenerateResponse {
@@ -69,11 +68,12 @@ message InspectResponse {
Account account = 1;
}
message RefreshRequest {
string secret = 1;
int64 token_expiry = 2;
message TokenRequest {
string id = 1;
string secret = 2;
int64 token_expiry = 3;
}
message RefreshResponse {
message TokenResponse {
Token token = 1;
}