go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/server/quota/quotapb/update-accounts.proto (about)

     1  // Copyright 2022 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  import "google/protobuf/duration.proto";
     8  
     9  import "go.chromium.org/luci/server/quota/quotapb/op.proto";
    10  import "go.chromium.org/luci/server/quota/quotapb/ids.proto";
    11  
    12  option go_package = "go.chromium.org/luci/server/quota/quotapb";
    13  
    14  package go.chromium.org.luci.server.quota.quotapb;
    15  
    16  // UpdateAccountsInput is the message that the Go library will use to invoke
    17  // update-accounts.lua.
    18  //
    19  // See ApplyOpsRequest for `request_id` and `request_id_ttl` fields.
    20  //
    21  // Validation rules are omitted from this because lua doesn't use them, and Go
    22  // will never read this message.
    23  message UpdateAccountsInput {
    24    // request_key is a serialized RequestDedupKey.
    25    string request_key = 1;
    26    // Required if request_key is set.
    27    google.protobuf.Duration request_key_ttl = 2;
    28  
    29    // Version scheme indicates which algorithm was used to calculate `version`.
    30    //
    31    // The value `0` indicates that `version` was provided by the user.
    32    //
    33    // Currently the ONLY ops_hash_scheme supported is `1`.
    34    //
    35    // If, in the future, more hash schemes are added, because request
    36    // deduplication entries are transient, we do the following:
    37    // If a request comes in, and req.ops_hash_scheme != self.ops_hash_scheme,
    38    // return the cached response as if ops_hash matches.
    39    //
    40    // Note that the upshot of this is that requests with the same request_id, but
    41    // differing contents, will be incorrectly served with an OK response when
    42    // upgrading the hash_scheme.
    43    uint32 hash_scheme = 3;
    44  
    45    // A hash calculated by the Go library of the following fields in
    46    // a deterministic way, according to req_hash_scheme:
    47    //   * ops
    48    //
    49    // This is saved for the deduplication entry and expected to match.
    50    string hash = 4;
    51  
    52    repeated RawOp ops = 5;
    53  }
    54  
    55  message RawOp {
    56    string account_ref = 1;
    57    // policy_id of {"", ""} means "remove policy"
    58    PolicyRef policy_ref = 2;
    59    Op.RelativeTo relative_to = 3;
    60    int64 delta = 4;
    61    uint32 options = 5;
    62  }