mirror of
				https://github.com/onepanelio/onepanel.git
				synced 2025-10-31 16:56:19 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			50 lines
		
	
	
		
			980 B
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			980 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;
 | |
| } | 
