github.com/emcfarlane/larking@v0.0.0-20220605172417-1704b45ee6c3/apipb/controlpb/control.proto (about) 1 // Copyright 2022 Edward McFarlane. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 syntax = "proto3"; 6 7 package larking.api.control; 8 9 import "google/api/annotations.proto"; 10 import "google/rpc/status.proto"; 11 12 option go_package = "github.com/emcfarlane/larking/apipb/controlpb;controlpb"; 13 14 // Based on google APIs Service Control: 15 // https://github.com/googleapis/googleapis/blob/master/google/api/servicecontrol/v1/service_controller.proto 16 17 message Credentials { 18 // The resource name. 19 string name = 1; 20 21 // BearerToken is a credential type. 22 // Include the access token as metadata in all requests. 23 message BearerToken { 24 // The access token. 25 string access_token = 2; 26 // The public key, optional. 27 string public_key = 3; 28 } 29 30 // Basic is a credential type. 31 // Include the username and password in all requests. 32 message BasicAuth { 33 // The username. 34 string username = 1; 35 // The password. 36 string password = 2; 37 // The public key, optional. 38 string public_key = 3; 39 } 40 41 oneof type { 42 bool insecure = 2; 43 BearerToken bearer = 3; 44 BasicAuth basic = 4; 45 } 46 } 47 48 message Values { repeated string values = 1; } 49 50 message Operation { 51 // The operation name. 52 string name = 1; 53 // The operation credentials if user initiated. 54 Credentials credentials = 2; 55 } 56 57 // Request message for the Check method. 58 message CheckRequest { 59 // The resource name. 60 string name = 1; 61 62 // The operation to be checked. 63 Operation operation = 2; 64 } 65 66 message CheckResponse { google.rpc.Status status = 1; } 67 68 service Control { 69 rpc Check(CheckRequest) returns (CheckResponse) { 70 option (google.api.http) = { 71 post : "/v1/{name=**}:check" 72 body : "*" 73 }; 74 } 75 }