| // Copyright 2022 The LUCI Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| syntax = "proto3"; |
| |
| package buildbucket.v2; |
| |
| option go_package = "go.chromium.org/luci/buildbucket/proto;buildbucketpb"; |
| |
| // TokenBody describes internal structure of the token. |
| message TokenBody { |
| // Id of the build this token is generated for. |
| int64 build_id = 1; |
| |
| // Possible purposes of the token. |
| enum Purpose { |
| // The default value. This value is used if purpose is omitted. |
| PURPOSE_UNSPECIFIED = 0; |
| // The token is a build token. |
| BUILD = 1; |
| } |
| |
| // Purpose of the token. |
| Purpose purpose = 2; |
| |
| // An additional random byte slice to be used to generate the token. |
| bytes state = 3; |
| } |
| |
| // TokenEnvelope is what is actually being serialized and represented |
| // as a token (after being encoded using base64 standard raw encoding). |
| message TokenEnvelope { |
| |
| // Possible version of the token. |
| enum Version { |
| // The default value. This value is used if version is omitted. |
| VERSION_UNSPECIFIED = 0; |
| |
| // The token is saved in model.Build like a password. |
| UNENCRYPTED_PASSWORD_LIKE = 1; |
| } |
| // Version of the token. |
| Version version = 1; |
| |
| // Serialized and potentially encrypted TokenBody. |
| bytes payload = 2; |
| } |