go.chromium.org/luci@v0.0.0-20250314024836-d9a61d0730e6/tokenserver/api/machine_token.pb.go (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  // Code generated by protoc-gen-go. DO NOT EDIT.
     6  // versions:
     7  // 	protoc-gen-go v1.36.5
     8  // 	protoc        v5.29.3
     9  // source: go.chromium.org/luci/tokenserver/api/machine_token.proto
    10  
    11  package tokenserver
    12  
    13  import (
    14  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    15  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    16  	reflect "reflect"
    17  	sync "sync"
    18  	unsafe "unsafe"
    19  )
    20  
    21  const (
    22  	// Verify that this generated code is sufficiently up-to-date.
    23  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    24  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    25  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    26  )
    27  
    28  // The kinds of machine tokens the token server can mint.
    29  //
    30  // Passed to MintMachineToken and InspectMachineToken.
    31  //
    32  // Reserved: 1.
    33  type MachineTokenType int32
    34  
    35  const (
    36  	MachineTokenType_UNKNOWN_TYPE       MachineTokenType = 0 // used if the field is not initialized
    37  	MachineTokenType_LUCI_MACHINE_TOKEN MachineTokenType = 2 // matches serialized MachineTokenEnvelope
    38  )
    39  
    40  // Enum value maps for MachineTokenType.
    41  var (
    42  	MachineTokenType_name = map[int32]string{
    43  		0: "UNKNOWN_TYPE",
    44  		2: "LUCI_MACHINE_TOKEN",
    45  	}
    46  	MachineTokenType_value = map[string]int32{
    47  		"UNKNOWN_TYPE":       0,
    48  		"LUCI_MACHINE_TOKEN": 2,
    49  	}
    50  )
    51  
    52  func (x MachineTokenType) Enum() *MachineTokenType {
    53  	p := new(MachineTokenType)
    54  	*p = x
    55  	return p
    56  }
    57  
    58  func (x MachineTokenType) String() string {
    59  	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
    60  }
    61  
    62  func (MachineTokenType) Descriptor() protoreflect.EnumDescriptor {
    63  	return file_go_chromium_org_luci_tokenserver_api_machine_token_proto_enumTypes[0].Descriptor()
    64  }
    65  
    66  func (MachineTokenType) Type() protoreflect.EnumType {
    67  	return &file_go_chromium_org_luci_tokenserver_api_machine_token_proto_enumTypes[0]
    68  }
    69  
    70  func (x MachineTokenType) Number() protoreflect.EnumNumber {
    71  	return protoreflect.EnumNumber(x)
    72  }
    73  
    74  // Deprecated: Use MachineTokenType.Descriptor instead.
    75  func (MachineTokenType) EnumDescriptor() ([]byte, []int) {
    76  	return file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescGZIP(), []int{0}
    77  }
    78  
    79  // MachineTokenBody describes internal structure of the machine token.
    80  //
    81  // The token will be put in HTTP headers and its body shouldn't be too large.
    82  // For that reason we use unix timestamps instead of google.protobuf.Timestamp
    83  // (no need for microsecond precision), and assume certificate serial numbers
    84  // are smallish uint64 integers (not random blobs).
    85  type MachineTokenBody struct {
    86  	state protoimpl.MessageState `protogen:"open.v1"`
    87  	// Machine identity this token conveys (machine FQDN).
    88  	//
    89  	// It is extracted from a Common Name of a certificate used as a basis for
    90  	// the token.
    91  	MachineFqdn string `protobuf:"bytes,1,opt,name=machine_fqdn,json=machineFqdn,proto3" json:"machine_fqdn,omitempty"`
    92  	// Service account email that signed this token.
    93  	//
    94  	// When verifying the token backends will check that the issuer is in
    95  	// "auth-token-servers" group.
    96  	IssuedBy string `protobuf:"bytes,2,opt,name=issued_by,json=issuedBy,proto3" json:"issued_by,omitempty"`
    97  	// Unix timestamp in seconds when this token was issued. Required.
    98  	IssuedAt uint64 `protobuf:"varint,3,opt,name=issued_at,json=issuedAt,proto3" json:"issued_at,omitempty"`
    99  	// Number of seconds the token is considered valid.
   100  	//
   101  	// Usually 3600. Set by the token server. Required.
   102  	Lifetime uint64 `protobuf:"varint,4,opt,name=lifetime,proto3" json:"lifetime,omitempty"`
   103  	// Id of a CA that issued machine certificate used to make this token.
   104  	//
   105  	// These IDs are defined in token server config (via unique_id field).
   106  	CaId int64 `protobuf:"varint,5,opt,name=ca_id,json=caId,proto3" json:"ca_id,omitempty"`
   107  	// Serial number of the machine certificate used to make this token.
   108  	//
   109  	// ca_id and cert_sn together uniquely identify the certificate, and can be
   110  	// used to check for certificate revocation (by asking token server whether
   111  	// the given certificate is in CRL). Revocation checks are optional, most
   112  	// callers can rely on expiration checks only.
   113  	CertSn        []byte `protobuf:"bytes,7,opt,name=cert_sn,json=certSn,proto3" json:"cert_sn,omitempty"`
   114  	unknownFields protoimpl.UnknownFields
   115  	sizeCache     protoimpl.SizeCache
   116  }
   117  
   118  func (x *MachineTokenBody) Reset() {
   119  	*x = MachineTokenBody{}
   120  	mi := &file_go_chromium_org_luci_tokenserver_api_machine_token_proto_msgTypes[0]
   121  	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   122  	ms.StoreMessageInfo(mi)
   123  }
   124  
   125  func (x *MachineTokenBody) String() string {
   126  	return protoimpl.X.MessageStringOf(x)
   127  }
   128  
   129  func (*MachineTokenBody) ProtoMessage() {}
   130  
   131  func (x *MachineTokenBody) ProtoReflect() protoreflect.Message {
   132  	mi := &file_go_chromium_org_luci_tokenserver_api_machine_token_proto_msgTypes[0]
   133  	if x != nil {
   134  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   135  		if ms.LoadMessageInfo() == nil {
   136  			ms.StoreMessageInfo(mi)
   137  		}
   138  		return ms
   139  	}
   140  	return mi.MessageOf(x)
   141  }
   142  
   143  // Deprecated: Use MachineTokenBody.ProtoReflect.Descriptor instead.
   144  func (*MachineTokenBody) Descriptor() ([]byte, []int) {
   145  	return file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescGZIP(), []int{0}
   146  }
   147  
   148  func (x *MachineTokenBody) GetMachineFqdn() string {
   149  	if x != nil {
   150  		return x.MachineFqdn
   151  	}
   152  	return ""
   153  }
   154  
   155  func (x *MachineTokenBody) GetIssuedBy() string {
   156  	if x != nil {
   157  		return x.IssuedBy
   158  	}
   159  	return ""
   160  }
   161  
   162  func (x *MachineTokenBody) GetIssuedAt() uint64 {
   163  	if x != nil {
   164  		return x.IssuedAt
   165  	}
   166  	return 0
   167  }
   168  
   169  func (x *MachineTokenBody) GetLifetime() uint64 {
   170  	if x != nil {
   171  		return x.Lifetime
   172  	}
   173  	return 0
   174  }
   175  
   176  func (x *MachineTokenBody) GetCaId() int64 {
   177  	if x != nil {
   178  		return x.CaId
   179  	}
   180  	return 0
   181  }
   182  
   183  func (x *MachineTokenBody) GetCertSn() []byte {
   184  	if x != nil {
   185  		return x.CertSn
   186  	}
   187  	return nil
   188  }
   189  
   190  // MachineTokenEnvelope is what is actually being serialized and represented
   191  // as a machine token (after being encoded using base64 standard raw encoding).
   192  //
   193  // Resulting token (including base64 encoding) is usually ~500 bytes long.
   194  type MachineTokenEnvelope struct {
   195  	state         protoimpl.MessageState `protogen:"open.v1"`
   196  	TokenBody     []byte                 `protobuf:"bytes,1,opt,name=token_body,json=tokenBody,proto3" json:"token_body,omitempty"` // serialized MachineTokenBody
   197  	KeyId         string                 `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`             // id of a token server private key used for signing
   198  	RsaSha256     []byte                 `protobuf:"bytes,3,opt,name=rsa_sha256,json=rsaSha256,proto3" json:"rsa_sha256,omitempty"` // signature of 'token_body'
   199  	unknownFields protoimpl.UnknownFields
   200  	sizeCache     protoimpl.SizeCache
   201  }
   202  
   203  func (x *MachineTokenEnvelope) Reset() {
   204  	*x = MachineTokenEnvelope{}
   205  	mi := &file_go_chromium_org_luci_tokenserver_api_machine_token_proto_msgTypes[1]
   206  	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   207  	ms.StoreMessageInfo(mi)
   208  }
   209  
   210  func (x *MachineTokenEnvelope) String() string {
   211  	return protoimpl.X.MessageStringOf(x)
   212  }
   213  
   214  func (*MachineTokenEnvelope) ProtoMessage() {}
   215  
   216  func (x *MachineTokenEnvelope) ProtoReflect() protoreflect.Message {
   217  	mi := &file_go_chromium_org_luci_tokenserver_api_machine_token_proto_msgTypes[1]
   218  	if x != nil {
   219  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   220  		if ms.LoadMessageInfo() == nil {
   221  			ms.StoreMessageInfo(mi)
   222  		}
   223  		return ms
   224  	}
   225  	return mi.MessageOf(x)
   226  }
   227  
   228  // Deprecated: Use MachineTokenEnvelope.ProtoReflect.Descriptor instead.
   229  func (*MachineTokenEnvelope) Descriptor() ([]byte, []int) {
   230  	return file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescGZIP(), []int{1}
   231  }
   232  
   233  func (x *MachineTokenEnvelope) GetTokenBody() []byte {
   234  	if x != nil {
   235  		return x.TokenBody
   236  	}
   237  	return nil
   238  }
   239  
   240  func (x *MachineTokenEnvelope) GetKeyId() string {
   241  	if x != nil {
   242  		return x.KeyId
   243  	}
   244  	return ""
   245  }
   246  
   247  func (x *MachineTokenEnvelope) GetRsaSha256() []byte {
   248  	if x != nil {
   249  		return x.RsaSha256
   250  	}
   251  	return nil
   252  }
   253  
   254  var File_go_chromium_org_luci_tokenserver_api_machine_token_proto protoreflect.FileDescriptor
   255  
   256  var file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDesc = string([]byte{
   257  	0x0a, 0x38, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72,
   258  	0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x65, 0x72, 0x76,
   259  	0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x74,
   260  	0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x74, 0x6f, 0x6b, 0x65,
   261  	0x6e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0xbf, 0x01, 0x0a, 0x10, 0x4d, 0x61, 0x63, 0x68,
   262  	0x69, 0x6e, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c,
   263  	0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x66, 0x71, 0x64, 0x6e, 0x18, 0x01, 0x20, 0x01,
   264  	0x28, 0x09, 0x52, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x46, 0x71, 0x64, 0x6e, 0x12,
   265  	0x1b, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x02, 0x20, 0x01,
   266  	0x28, 0x09, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1b, 0x0a, 0x09,
   267  	0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52,
   268  	0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x69, 0x66,
   269  	0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x69, 0x66,
   270  	0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x63, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x05,
   271  	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x61, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x65,
   272  	0x72, 0x74, 0x5f, 0x73, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x65, 0x72,
   273  	0x74, 0x53, 0x6e, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0x6b, 0x0a, 0x14, 0x4d, 0x61, 0x63,
   274  	0x68, 0x69, 0x6e, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70,
   275  	0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18,
   276  	0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x6f, 0x64, 0x79,
   277  	0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
   278  	0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x73, 0x61, 0x5f, 0x73,
   279  	0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x73, 0x61,
   280  	0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x2a, 0x3c, 0x0a, 0x10, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
   281  	0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e,
   282  	0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12,
   283  	0x4c, 0x55, 0x43, 0x49, 0x5f, 0x4d, 0x41, 0x43, 0x48, 0x49, 0x4e, 0x45, 0x5f, 0x54, 0x4f, 0x4b,
   284  	0x45, 0x4e, 0x10, 0x02, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d,
   285  	0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x74, 0x6f, 0x6b,
   286  	0x65, 0x6e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x74, 0x6f, 0x6b,
   287  	0x65, 0x6e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   288  })
   289  
   290  var (
   291  	file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescOnce sync.Once
   292  	file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescData []byte
   293  )
   294  
   295  func file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescGZIP() []byte {
   296  	file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescOnce.Do(func() {
   297  		file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDesc), len(file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDesc)))
   298  	})
   299  	return file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDescData
   300  }
   301  
   302  var file_go_chromium_org_luci_tokenserver_api_machine_token_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
   303  var file_go_chromium_org_luci_tokenserver_api_machine_token_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
   304  var file_go_chromium_org_luci_tokenserver_api_machine_token_proto_goTypes = []any{
   305  	(MachineTokenType)(0),        // 0: tokenserver.MachineTokenType
   306  	(*MachineTokenBody)(nil),     // 1: tokenserver.MachineTokenBody
   307  	(*MachineTokenEnvelope)(nil), // 2: tokenserver.MachineTokenEnvelope
   308  }
   309  var file_go_chromium_org_luci_tokenserver_api_machine_token_proto_depIdxs = []int32{
   310  	0, // [0:0] is the sub-list for method output_type
   311  	0, // [0:0] is the sub-list for method input_type
   312  	0, // [0:0] is the sub-list for extension type_name
   313  	0, // [0:0] is the sub-list for extension extendee
   314  	0, // [0:0] is the sub-list for field type_name
   315  }
   316  
   317  func init() { file_go_chromium_org_luci_tokenserver_api_machine_token_proto_init() }
   318  func file_go_chromium_org_luci_tokenserver_api_machine_token_proto_init() {
   319  	if File_go_chromium_org_luci_tokenserver_api_machine_token_proto != nil {
   320  		return
   321  	}
   322  	type x struct{}
   323  	out := protoimpl.TypeBuilder{
   324  		File: protoimpl.DescBuilder{
   325  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   326  			RawDescriptor: unsafe.Slice(unsafe.StringData(file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDesc), len(file_go_chromium_org_luci_tokenserver_api_machine_token_proto_rawDesc)),
   327  			NumEnums:      1,
   328  			NumMessages:   2,
   329  			NumExtensions: 0,
   330  			NumServices:   0,
   331  		},
   332  		GoTypes:           file_go_chromium_org_luci_tokenserver_api_machine_token_proto_goTypes,
   333  		DependencyIndexes: file_go_chromium_org_luci_tokenserver_api_machine_token_proto_depIdxs,
   334  		EnumInfos:         file_go_chromium_org_luci_tokenserver_api_machine_token_proto_enumTypes,
   335  		MessageInfos:      file_go_chromium_org_luci_tokenserver_api_machine_token_proto_msgTypes,
   336  	}.Build()
   337  	File_go_chromium_org_luci_tokenserver_api_machine_token_proto = out.File
   338  	file_go_chromium_org_luci_tokenserver_api_machine_token_proto_goTypes = nil
   339  	file_go_chromium_org_luci_tokenserver_api_machine_token_proto_depIdxs = nil
   340  }