mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-11-02 01:32:34 +08:00
52 lines
1.1 KiB
Protocol Buffer
52 lines
1.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package api;
|
|
|
|
import "google/api/annotations.proto";
|
|
import "protoc-gen-swagger/options/annotations.proto";
|
|
service AuthService {
|
|
rpc GetAccessToken(GetAccessTokenRequest) returns (GetAccessTokenResponse) {
|
|
option (google.api.http) = {
|
|
post: "/apis/v1beta1/auth/get_access_token"
|
|
body: "*"
|
|
};
|
|
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
|
security: {
|
|
}
|
|
};
|
|
}
|
|
|
|
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 GetAccessTokenRequest {
|
|
string username = 1;
|
|
string token = 2;
|
|
}
|
|
|
|
message GetAccessTokenResponse {
|
|
string domain = 1;
|
|
string accessToken = 2;
|
|
string username = 3;
|
|
} |