diff --git a/app/controlplane/api/controlplane/v1/cas_credentials.pb.go b/app/controlplane/api/controlplane/v1/cas_credentials.pb.go index 0dd0543c4..ce6ac84d2 100644 --- a/app/controlplane/api/controlplane/v1/cas_credentials.pb.go +++ b/app/controlplane/api/controlplane/v1/cas_credentials.pb.go @@ -1,5 +1,5 @@ // -// Copyright 2023 The Chainloop Authors. +// Copyright 2023-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -193,7 +193,8 @@ type CASCredentialsServiceGetResponse_Result struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Backend *CASBackendItem `protobuf:"bytes,3,opt,name=backend,proto3" json:"backend,omitempty"` } func (x *CASCredentialsServiceGetResponse_Result) Reset() { @@ -235,6 +236,13 @@ func (x *CASCredentialsServiceGetResponse_Result) GetToken() string { return "" } +func (x *CASCredentialsServiceGetResponse_Result) GetBackend() *CASBackendItem { + if x != nil { + return x.Backend + } + return nil +} + var File_controlplane_v1_cas_credentials_proto protoreflect.FileDescriptor var file_controlplane_v1_cas_credentials_proto_rawDesc = []byte{ @@ -243,44 +251,50 @@ var file_controlplane_v1_cas_credentials_proto_rawDesc = []byte{ 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x1f, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x0a, - 0xba, 0x48, 0x07, 0x82, 0x01, 0x04, 0x1a, 0x02, 0x01, 0x02, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x44, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, - 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x44, - 0x4f, 0x57, 0x4e, 0x4c, 0x4f, 0x41, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x52, - 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x45, 0x52, 0x10, 0x02, 0x22, 0x94, - 0x01, 0x0a, 0x20, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x1e, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x83, 0x01, 0x0a, 0x15, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x6a, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, - 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, + 0x01, 0x0a, 0x1f, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x55, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x82, 0x01, 0x04, 0x1a, + 0x02, 0x01, 0x02, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x22, 0x44, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, + 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x13, 0x0a, 0x0f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x4c, 0x4f, 0x41, 0x44, + 0x45, 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x50, 0x4c, + 0x4f, 0x41, 0x44, 0x45, 0x52, 0x10, 0x02, 0x22, 0xcf, 0x01, 0x0a, 0x20, 0x43, 0x41, 0x53, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x41, 0x53, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x59, + 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x39, + 0x0a, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x32, 0x83, 0x01, 0x0a, 0x15, 0x43, 0x41, + 0x53, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, + 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x41, 0x53, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -302,17 +316,19 @@ var file_controlplane_v1_cas_credentials_proto_goTypes = []interface{}{ (*CASCredentialsServiceGetRequest)(nil), // 1: controlplane.v1.CASCredentialsServiceGetRequest (*CASCredentialsServiceGetResponse)(nil), // 2: controlplane.v1.CASCredentialsServiceGetResponse (*CASCredentialsServiceGetResponse_Result)(nil), // 3: controlplane.v1.CASCredentialsServiceGetResponse.Result + (*CASBackendItem)(nil), // 4: controlplane.v1.CASBackendItem } var file_controlplane_v1_cas_credentials_proto_depIdxs = []int32{ 0, // 0: controlplane.v1.CASCredentialsServiceGetRequest.role:type_name -> controlplane.v1.CASCredentialsServiceGetRequest.Role 3, // 1: controlplane.v1.CASCredentialsServiceGetResponse.result:type_name -> controlplane.v1.CASCredentialsServiceGetResponse.Result - 1, // 2: controlplane.v1.CASCredentialsService.Get:input_type -> controlplane.v1.CASCredentialsServiceGetRequest - 2, // 3: controlplane.v1.CASCredentialsService.Get:output_type -> controlplane.v1.CASCredentialsServiceGetResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 2: controlplane.v1.CASCredentialsServiceGetResponse.Result.backend:type_name -> controlplane.v1.CASBackendItem + 1, // 3: controlplane.v1.CASCredentialsService.Get:input_type -> controlplane.v1.CASCredentialsServiceGetRequest + 2, // 4: controlplane.v1.CASCredentialsService.Get:output_type -> controlplane.v1.CASCredentialsServiceGetResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_controlplane_v1_cas_credentials_proto_init() } @@ -320,6 +336,7 @@ func file_controlplane_v1_cas_credentials_proto_init() { if File_controlplane_v1_cas_credentials_proto != nil { return } + file_controlplane_v1_response_messages_proto_init() if !protoimpl.UnsafeEnabled { file_controlplane_v1_cas_credentials_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CASCredentialsServiceGetRequest); i { diff --git a/app/controlplane/api/controlplane/v1/cas_credentials.proto b/app/controlplane/api/controlplane/v1/cas_credentials.proto index 29b7dbbbd..6ba0fa9b7 100644 --- a/app/controlplane/api/controlplane/v1/cas_credentials.proto +++ b/app/controlplane/api/controlplane/v1/cas_credentials.proto @@ -1,5 +1,5 @@ // -// Copyright 2023 The Chainloop Authors. +// Copyright 2023-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,29 +17,37 @@ syntax = "proto3"; package controlplane.v1; -option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1;v1"; import "buf/validate/validate.proto"; +import "controlplane/v1/response_messages.proto"; + +option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1;v1"; service CASCredentialsService { - rpc Get (CASCredentialsServiceGetRequest) returns (CASCredentialsServiceGetResponse); + rpc Get(CASCredentialsServiceGetRequest) returns (CASCredentialsServiceGetResponse); } message CASCredentialsServiceGetRequest { - Role role = 1 [(buf.validate.field).enum = {in: [1,2]}]; + Role role = 1 [(buf.validate.field).enum = { + in: [ + 1, + 2 + ] + }]; // during the download we need the digest to find the proper cas backend string digest = 2; enum Role { - ROLE_UNSPECIFIED = 0; - ROLE_DOWNLOADER = 1; - ROLE_UPLOADER = 2; - } + ROLE_UNSPECIFIED = 0; + ROLE_DOWNLOADER = 1; + ROLE_UPLOADER = 2; + } } message CASCredentialsServiceGetResponse { Result result = 1; - + message Result { string token = 2; + CASBackendItem backend = 3; } -} \ No newline at end of file +} diff --git a/app/controlplane/api/controlplane/v1/cas_credentials_grpc.pb.go b/app/controlplane/api/controlplane/v1/cas_credentials_grpc.pb.go index be25d1873..67a8eb7ea 100644 --- a/app/controlplane/api/controlplane/v1/cas_credentials_grpc.pb.go +++ b/app/controlplane/api/controlplane/v1/cas_credentials_grpc.pb.go @@ -1,5 +1,5 @@ // -// Copyright 2023 The Chainloop Authors. +// Copyright 2023-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/cas_credentials.ts b/app/controlplane/api/gen/frontend/controlplane/v1/cas_credentials.ts index 20bc9d56c..46cc1b0cc 100644 --- a/app/controlplane/api/gen/frontend/controlplane/v1/cas_credentials.ts +++ b/app/controlplane/api/gen/frontend/controlplane/v1/cas_credentials.ts @@ -2,6 +2,7 @@ import { grpc } from "@improbable-eng/grpc-web"; import { BrowserHeaders } from "browser-headers"; import _m0 from "protobufjs/minimal"; +import { CASBackendItem } from "./response_messages"; export const protobufPackage = "controlplane.v1"; @@ -56,6 +57,7 @@ export interface CASCredentialsServiceGetResponse { export interface CASCredentialsServiceGetResponse_Result { token: string; + backend?: CASBackendItem; } function createBaseCASCredentialsServiceGetRequest(): CASCredentialsServiceGetRequest { @@ -197,7 +199,7 @@ export const CASCredentialsServiceGetResponse = { }; function createBaseCASCredentialsServiceGetResponse_Result(): CASCredentialsServiceGetResponse_Result { - return { token: "" }; + return { token: "", backend: undefined }; } export const CASCredentialsServiceGetResponse_Result = { @@ -205,6 +207,9 @@ export const CASCredentialsServiceGetResponse_Result = { if (message.token !== "") { writer.uint32(18).string(message.token); } + if (message.backend !== undefined) { + CASBackendItem.encode(message.backend, writer.uint32(26).fork()).ldelim(); + } return writer; }, @@ -222,6 +227,13 @@ export const CASCredentialsServiceGetResponse_Result = { message.token = reader.string(); continue; + case 3: + if (tag !== 26) { + break; + } + + message.backend = CASBackendItem.decode(reader, reader.uint32()); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -232,12 +244,17 @@ export const CASCredentialsServiceGetResponse_Result = { }, fromJSON(object: any): CASCredentialsServiceGetResponse_Result { - return { token: isSet(object.token) ? String(object.token) : "" }; + return { + token: isSet(object.token) ? String(object.token) : "", + backend: isSet(object.backend) ? CASBackendItem.fromJSON(object.backend) : undefined, + }; }, toJSON(message: CASCredentialsServiceGetResponse_Result): unknown { const obj: any = {}; message.token !== undefined && (obj.token = message.token); + message.backend !== undefined && + (obj.backend = message.backend ? CASBackendItem.toJSON(message.backend) : undefined); return obj; }, @@ -252,6 +269,9 @@ export const CASCredentialsServiceGetResponse_Result = { ): CASCredentialsServiceGetResponse_Result { const message = createBaseCASCredentialsServiceGetResponse_Result(); message.token = object.token ?? ""; + message.backend = (object.backend !== undefined && object.backend !== null) + ? CASBackendItem.fromPartial(object.backend) + : undefined; return message; }, }; diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.jsonschema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.jsonschema.json index d367322e8..0bc5f285a 100644 --- a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.jsonschema.json +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.jsonschema.json @@ -3,6 +3,9 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { + "backend": { + "$ref": "controlplane.v1.CASBackendItem.jsonschema.json" + }, "token": { "type": "string" } diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.schema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.schema.json index ea796489a..6b5cb914c 100644 --- a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.schema.json +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASCredentialsServiceGetResponse.Result.schema.json @@ -3,6 +3,9 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { + "backend": { + "$ref": "controlplane.v1.CASBackendItem.schema.json" + }, "token": { "type": "string" } diff --git a/app/controlplane/internal/service/cascredential.go b/app/controlplane/internal/service/cascredential.go index 5dcf298b9..23e809b92 100644 --- a/app/controlplane/internal/service/cascredential.go +++ b/app/controlplane/internal/service/cascredential.go @@ -128,6 +128,6 @@ func (s *CASCredentialsService) Get(ctx context.Context, req *pb.CASCredentialsS } return &pb.CASCredentialsServiceGetResponse{ - Result: &pb.CASCredentialsServiceGetResponse_Result{Token: t}, + Result: &pb.CASCredentialsServiceGetResponse_Result{Token: t, Backend: bizCASBackendToPb(backend)}, }, nil }