go.chromium.org/luci@v0.0.0-20250314024836-d9a61d0730e6/tokenserver/api/token_file.proto (about)

     1  // Copyright 2016 The LUCI Authors. All rights reserved.
     2  // Use of this source code is governed under the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  syntax = "proto3";
     6  
     7  package tokenserver;
     8  
     9  option go_package = "go.chromium.org/luci/tokenserver/api;tokenserver";
    10  
    11  
    12  // TokenFile is representation of a token file on disk (serialized as JSON).
    13  //
    14  // The token file is consumed by whoever wishes to use machine tokens. It is
    15  // intentionally made as simple as possible (e.g. uses unix timestamps instead
    16  // of fancy protobuf ones).
    17  message TokenFile {
    18    // Google OAuth2 access token of a machine service account.
    19    string access_token = 1 [json_name="access_token"];
    20  
    21    // OAuth2 access token type, usually "Bearer".
    22    string token_type = 2 [json_name="token_type"];
    23  
    24    // Machine token understood by LUCI backends (alternative to access_token).
    25    string luci_machine_token = 3 [json_name="luci_machine_token"];
    26  
    27    // Unix timestamp (in seconds) when this token expires.
    28    //
    29    // The token file is expected to be updated before the token expires, see
    30    // 'next_update' for next expected update time.
    31    int64 expiry = 4 [json_name="expiry"];
    32  
    33    // Unix timestamp of when this file was updated the last time.
    34    int64 last_update = 5 [json_name="last_update"];
    35  
    36    // Unix timestamp of when this file is expected to be updated next time.
    37    int64 next_update = 6 [json_name="next_update"];
    38  
    39    // Email of the associated service account.
    40    string service_account_email = 7 [json_name="service_account_email"];
    41  
    42    // Unique stable ID of the associated service account.
    43    string service_account_unique_id = 8 [json_name="service_account_unique_id"];
    44  
    45    // Any information tokend daemon wishes to associate with the token.
    46    //
    47    // Consumers of the token file should ignore this field. It is used
    48    // exclusively by tokend daemon.
    49    bytes tokend_state = 50 [json_name="tokend_state"];
    50  }