2020-02-03 11:16:02 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package go.micro.auth;
|
|
|
|
|
|
|
|
service Auth {
|
|
|
|
rpc Generate(GenerateRequest) returns (GenerateResponse) {};
|
2020-02-26 01:15:44 +03:00
|
|
|
rpc Verify(VerifyRequest) returns (VerifyResponse) {};
|
2020-02-03 11:16:02 +03:00
|
|
|
rpc Revoke(RevokeRequest) returns (RevokeResponse) {};
|
|
|
|
}
|
|
|
|
|
|
|
|
message Account{
|
2020-02-26 01:15:44 +03:00
|
|
|
string id = 1;
|
|
|
|
string token = 2;
|
|
|
|
int64 created = 3;
|
|
|
|
int64 expiry = 4;
|
|
|
|
repeated Role roles = 5;
|
2020-02-03 11:16:02 +03:00
|
|
|
map<string, string> metadata = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Role {
|
2020-02-26 01:15:44 +03:00
|
|
|
string name = 1;
|
|
|
|
Resource resource = 2;
|
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-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message GenerateRequest {
|
2020-02-26 01:15:44 +03:00
|
|
|
Account account = 1;
|
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-02-26 01:15:44 +03:00
|
|
|
message VerifyRequest {
|
|
|
|
string token = 1;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
2020-02-26 01:15:44 +03:00
|
|
|
message VerifyResponse {
|
|
|
|
Account account = 1;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message RevokeRequest {
|
2020-02-26 01:15:44 +03:00
|
|
|
string token = 1;
|
2020-02-03 11:16:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message RevokeResponse {}
|