blob: f12c434c3442541526ead0bf40dcf49d78dcac9a [file] [log] [blame]
// 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 token for updating a build.
BUILD = 1;
// The token is a token for updating a backend task. DO NOT USE. DEPRECATED.
TASK = 2 [deprecated = true];
// The token is a token for starting a build.
START_BUILD = 3;
// The token is a token for starting and registering a backend task with the
// build it runs.
START_BUILD_TASK = 4;
}
// 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;
// The token is encrypted using go.chromium.org/luci/server/secrets.
ENCRYPTED = 2;
}
// Version of the token.
Version version = 1;
// Serialized and potentially encrypted TokenBody.
bytes payload = 2;
}