Files
onepanel/api/auth.proto
2020-08-19 11:00:40 -07:00

50 lines
979 B
Protocol Buffer

syntax = "proto3";
package api;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
service AuthService {
rpc IsValidToken(IsValidTokenRequest) returns (IsValidTokenResponse) {
option (google.api.http) = {
post: "/apis/v1beta1/auth/token"
body: "token"
};
}
rpc IsAuthorized(IsAuthorizedRequest) returns (IsAuthorizedResponse) {
option (google.api.http) = {
post: "/apis/v1beta1/auth"
body: "isAuthorized"
};
}
}
message IsAuthorized {
string namespace = 1;
string verb = 2;
string group = 3;
string resource = 4;
string resourceName = 5;
}
message IsAuthorizedRequest {
IsAuthorized isAuthorized = 1;
}
message IsAuthorizedResponse {
bool authorized = 1;
}
message TokenWrapper {
string token = 1;
}
message IsValidTokenRequest {
TokenWrapper token = 1;
}
message IsValidTokenResponse {
string domain = 1;
}