github.com/google/cloudprober@v0.11.3/common/oauth/proto/config.proto (about)

     1  syntax = "proto2";
     2  
     3  package cloudprober.oauth;
     4  
     5  option go_package = "github.com/google/cloudprober/common/oauth/proto";
     6  
     7  message Config {
     8    oneof type {
     9      BearerToken bearer_token = 1;
    10      GoogleCredentials google_credentials = 2;
    11    }
    12  }
    13  
    14  // Bearer token is added to the HTTP request through an HTTP header:
    15  // "Authorization: Bearer <access_token>"
    16  message BearerToken {
    17    oneof source {
    18      // Path to token file.
    19      string file = 1;
    20  
    21      // Run a comand to obtain the token, e.g.
    22      // cat /var/lib/myapp/token, or
    23      // /var/lib/run/get_token.sh
    24      string cmd = 2;
    25  
    26      // GCE metadata token
    27      string gce_service_account = 3;
    28    }
    29  
    30    // How often to refresh token. As OAuth token usually expire, we need to
    31    // refresh them on a regular interval. If set to 0, caching is disabled.
    32    optional float refresh_interval_sec = 90 [default = 60];
    33  }
    34  
    35  // Google credentials in JSON format. We simply use oauth2/google package to
    36  // use these credentials.
    37  message GoogleCredentials {
    38    optional string json_file = 1;
    39    repeated string scope = 2;
    40  
    41    // Use encoded JWT directly as access token, instead of implementing the whole
    42    // OAuth2.0 flow.
    43    optional bool jwt_as_access_token = 4;
    44  
    45    // Audience works only if jwt_as_access_token is true.
    46    optional string audience = 3;
    47  }