micro/auth/service/proto/auth.proto

51 lines
789 B
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package go.micro.auth;
service Auth {
rpc Generate(GenerateRequest) returns (GenerateResponse) {};
rpc Verify(VerifyRequest) returns (VerifyResponse) {};
rpc Revoke(RevokeRequest) returns (RevokeResponse) {};
}
message Account{
string id = 1;
string token = 2;
int64 created = 3;
int64 expiry = 4;
repeated Role roles = 5;
map<string, string> metadata = 6;
}
message Role {
string name = 1;
Resource resource = 2;
}
message Resource{
string name = 1;
string type = 2;
}
message GenerateRequest {
Account account = 1;
}
message GenerateResponse {
Account account = 1;
}
message VerifyRequest {
string token = 1;
}
message VerifyResponse {
Account account = 1;
}
message RevokeRequest {
string token = 1;
}
message RevokeResponse {}