feat(target): add proxy certificate repos and protos (#1577)

This commit is contained in:
Irena Rindos authored and irenarindos committed 2025-09-02 15:13:39 -04:00
1 parent bcd2a62890
commit 6afb42e334
13 files changed
+1489 -24

No files matched your search

+367 -22
View File
@@ -649,6 +649,308 @@ func (x *CredentialSourceView) GetType() string {
return ""
}
type TargetProxyCertificate struct {
state protoimpl.MessageState `protogen:"open.v1"`
// public_id is used to identify the target proxy key
// @inject_tag: `gorm:"primary_key"`
PublicId string `protobuf:"bytes,10,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty" gorm:"primary_key"`
// target_id is used to access the proxy target this key is for
// @inject_tag: `gorm:"not_null"`
TargetId string `protobuf:"bytes,20,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty" gorm:"not_null"`
// public_key is the public key associated with this certificate
// @inject_tag: `gorm:"not_null"`
PublicKey []byte `protobuf:"bytes,30,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" gorm:"not_null"`
// private_key is the plaintext key. this is not stored in the db
// @inject_tag: `gorm:"-" wrapping:"pt,private_key"`
PrivateKey []byte `protobuf:"bytes,40,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty" gorm:"-" wrapping:"pt,private_key"`
// private_key_encrypted is the encrypted PEM encoded private key
// @inject_tag: `gorm:"not_null" wrapping:"ct,private_key"`
PrivateKeyEncrypted []byte `protobuf:"bytes,50,opt,name=private_key_encrypted,json=privateKeyEncrypted,proto3" json:"private_key_encrypted,omitempty" gorm:"not_null" wrapping:"ct,private_key"`
// key_id is the kms private id used to encrypt this entry's private key
// @inject_tag: `gorm:"not_null"`
KeyId string `protobuf:"bytes,60,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty" gorm:"not_null"`
// certificate is the PEM encoded certificate
// @inject_tag: `gorm:"not_null"`
Certificate []byte `protobuf:"bytes,70,opt,name=certificate,proto3" json:"certificate,omitempty" gorm:"not_null"`
// not_valid_after is the timestamp at which this certificate's validity period ends
// @inject_tag: `gorm:"not_null"`
NotValidAfter *timestamp.Timestamp `protobuf:"bytes,80,opt,name=not_valid_after,json=notValidAfter,proto3" json:"not_valid_after,omitempty" gorm:"not_null"`
// version allows optimistic locking during modification
// @inject_tag: `gorm:"default:null"`
Version uint32 `protobuf:"varint,90,opt,name=version,proto3" json:"version,omitempty" gorm:"default:null"`
// create_time from the RDBMS
// @inject_tag: `gorm:"default:current_timestamp"`
CreateTime *timestamp.Timestamp `protobuf:"bytes,100,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" gorm:"default:current_timestamp"`
// update_time from the RDBMS
// @inject_tag: `gorm:"default:current_timestamp"`
UpdateTime *timestamp.Timestamp `protobuf:"bytes,110,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty" gorm:"default:current_timestamp"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TargetProxyCertificate) Reset() {
*x = TargetProxyCertificate{}
mi := &file_controller_storage_target_store_v1_target_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TargetProxyCertificate) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TargetProxyCertificate) ProtoMessage() {}
func (x *TargetProxyCertificate) ProtoReflect() protoreflect.Message {
mi := &file_controller_storage_target_store_v1_target_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TargetProxyCertificate.ProtoReflect.Descriptor instead.
func (*TargetProxyCertificate) Descriptor() ([]byte, []int) {
return file_controller_storage_target_store_v1_target_proto_rawDescGZIP(), []int{7}
}
func (x *TargetProxyCertificate) GetPublicId() string {
if x != nil {
return x.PublicId
}
return ""
}
func (x *TargetProxyCertificate) GetTargetId() string {
if x != nil {
return x.TargetId
}
return ""
}
func (x *TargetProxyCertificate) GetPublicKey() []byte {
if x != nil {
return x.PublicKey
}
return nil
}
func (x *TargetProxyCertificate) GetPrivateKey() []byte {
if x != nil {
return x.PrivateKey
}
return nil
}
func (x *TargetProxyCertificate) GetPrivateKeyEncrypted() []byte {
if x != nil {
return x.PrivateKeyEncrypted
}
return nil
}
func (x *TargetProxyCertificate) GetKeyId() string {
if x != nil {
return x.KeyId
}
return ""
}
func (x *TargetProxyCertificate) GetCertificate() []byte {
if x != nil {
return x.Certificate
}
return nil
}
func (x *TargetProxyCertificate) GetNotValidAfter() *timestamp.Timestamp {
if x != nil {
return x.NotValidAfter
}
return nil
}
func (x *TargetProxyCertificate) GetVersion() uint32 {
if x != nil {
return x.Version
}
return 0
}
func (x *TargetProxyCertificate) GetCreateTime() *timestamp.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *TargetProxyCertificate) GetUpdateTime() *timestamp.Timestamp {
if x != nil {
return x.UpdateTime
}
return nil
}
type TargetAliasProxyCertificate struct {
state protoimpl.MessageState `protogen:"open.v1"`
// public_id is used to identify the target proxy key
// @inject_tag: `gorm:"primary_key"`
PublicId string `protobuf:"bytes,10,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty" gorm:"primary_key"`
// target_id is used to access the proxy target this key is for
// @inject_tag: `gorm:"not_null"`
TargetId string `protobuf:"bytes,20,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty" gorm:"not_null"`
// public_key is the public key associated with this certificate
// @inject_tag: `gorm:"not_null"`
PublicKey []byte `protobuf:"bytes,30,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" gorm:"not_null"`
// private_key is the plaintext key. this is not stored in the db
// @inject_tag: `gorm:"-" wrapping:"pt,private_key"`
PrivateKey []byte `protobuf:"bytes,40,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty" gorm:"-" wrapping:"pt,private_key"`
// private_key_encrypted is the encrypted PEM encoded private key
// @inject_tag: `gorm:"not_null" wrapping:"ct,private_key"`
PrivateKeyEncrypted []byte `protobuf:"bytes,50,opt,name=private_key_encrypted,json=privateKeyEncrypted,proto3" json:"private_key_encrypted,omitempty" gorm:"not_null" wrapping:"ct,private_key"`
// key_id is the kms private id used to encrypt this entry's private key
// @inject_tag: `gorm:"not_null"`
KeyId string `protobuf:"bytes,60,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty" gorm:"not_null"`
// alias_id is the public id of the alias target
// @inject_tag: `gorm:"not_null"`
AliasId string `protobuf:"bytes,70,opt,name=alias_id,json=aliasId,proto3" json:"alias_id,omitempty" gorm:"not_null"`
// certificate is the PEM encoded certificate
// @inject_tag: `gorm:"not_null"`
Certificate []byte `protobuf:"bytes,80,opt,name=certificate,proto3" json:"certificate,omitempty" gorm:"not_null"`
// not_valid_after is the timestamp at which this certificate's validity period ends
// @inject_tag: `gorm:"not_null"`
NotValidAfter *timestamp.Timestamp `protobuf:"bytes,90,opt,name=not_valid_after,json=notValidAfter,proto3" json:"not_valid_after,omitempty" gorm:"not_null"`
// version allows optimistic locking during modification
// @inject_tag: `gorm:"default:null"`
Version uint32 `protobuf:"varint,100,opt,name=version,proto3" json:"version,omitempty" gorm:"default:null"`
// create_time from the RDBMS
// @inject_tag: `gorm:"default:current_timestamp"`
CreateTime *timestamp.Timestamp `protobuf:"bytes,110,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" gorm:"default:current_timestamp"`
// update_time from the RDBMS
// @inject_tag: `gorm:"default:current_timestamp"`
UpdateTime *timestamp.Timestamp `protobuf:"bytes,120,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty" gorm:"default:current_timestamp"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TargetAliasProxyCertificate) Reset() {
*x = TargetAliasProxyCertificate{}
mi := &file_controller_storage_target_store_v1_target_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TargetAliasProxyCertificate) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TargetAliasProxyCertificate) ProtoMessage() {}
func (x *TargetAliasProxyCertificate) ProtoReflect() protoreflect.Message {
mi := &file_controller_storage_target_store_v1_target_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TargetAliasProxyCertificate.ProtoReflect.Descriptor instead.
func (*TargetAliasProxyCertificate) Descriptor() ([]byte, []int) {
return file_controller_storage_target_store_v1_target_proto_rawDescGZIP(), []int{8}
}
func (x *TargetAliasProxyCertificate) GetPublicId() string {
if x != nil {
return x.PublicId
}
return ""
}
func (x *TargetAliasProxyCertificate) GetTargetId() string {
if x != nil {
return x.TargetId
}
return ""
}
func (x *TargetAliasProxyCertificate) GetPublicKey() []byte {
if x != nil {
return x.PublicKey
}
return nil
}
func (x *TargetAliasProxyCertificate) GetPrivateKey() []byte {
if x != nil {
return x.PrivateKey
}
return nil
}
func (x *TargetAliasProxyCertificate) GetPrivateKeyEncrypted() []byte {
if x != nil {
return x.PrivateKeyEncrypted
}
return nil
}
func (x *TargetAliasProxyCertificate) GetKeyId() string {
if x != nil {
return x.KeyId
}
return ""
}
func (x *TargetAliasProxyCertificate) GetAliasId() string {
if x != nil {
return x.AliasId
}
return ""
}
func (x *TargetAliasProxyCertificate) GetCertificate() []byte {
if x != nil {
return x.Certificate
}
return nil
}
func (x *TargetAliasProxyCertificate) GetNotValidAfter() *timestamp.Timestamp {
if x != nil {
return x.NotValidAfter
}
return nil
}
func (x *TargetAliasProxyCertificate) GetVersion() uint32 {
if x != nil {
return x.Version
}
return 0
}
func (x *TargetAliasProxyCertificate) GetCreateTime() *timestamp.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *TargetAliasProxyCertificate) GetUpdateTime() *timestamp.Timestamp {
if x != nil {
return x.UpdateTime
}
return nil
}
var File_controller_storage_target_store_v1_target_proto protoreflect.FileDescriptor
const file_controller_storage_target_store_v1_target_proto_rawDesc = "" +
@@ -713,7 +1015,42 @@ const file_controller_storage_target_store_v1_target_proto_rawDesc = "" +
"\x14CredentialSourceView\x12\x1b\n" +
"\tpublic_id\x18\n" +
" \x01(\tR\bpublicId\x12\x12\n" +
"\x04type\x18\x14 \x01(\tR\x04typeB;Z9github.com/hashicorp/boundary/internal/target/store;storeb\x06proto3"
"\x04type\x18\x14 \x01(\tR\x04type\"\x87\x04\n" +
"\x16TargetProxyCertificate\x12\x1b\n" +
"\tpublic_id\x18\n" +
" \x01(\tR\bpublicId\x12\x1b\n" +
"\ttarget_id\x18\x14 \x01(\tR\btargetId\x12\x1d\n" +
"\n" +
"public_key\x18\x1e \x01(\fR\tpublicKey\x12\x1f\n" +
"\vprivate_key\x18( \x01(\fR\n" +
"privateKey\x122\n" +
"\x15private_key_encrypted\x182 \x01(\fR\x13privateKeyEncrypted\x12\x15\n" +
"\x06key_id\x18< \x01(\tR\x05keyId\x12 \n" +
"\vcertificate\x18F \x01(\fR\vcertificate\x12R\n" +
"\x0fnot_valid_after\x18P \x01(\v2*.controller.storage.timestamp.v1.TimestampR\rnotValidAfter\x12\x18\n" +
"\aversion\x18Z \x01(\rR\aversion\x12K\n" +
"\vcreate_time\x18d \x01(\v2*.controller.storage.timestamp.v1.TimestampR\n" +
"createTime\x12K\n" +
"\vupdate_time\x18n \x01(\v2*.controller.storage.timestamp.v1.TimestampR\n" +
"updateTime\"\xa7\x04\n" +
"\x1bTargetAliasProxyCertificate\x12\x1b\n" +
"\tpublic_id\x18\n" +
" \x01(\tR\bpublicId\x12\x1b\n" +
"\ttarget_id\x18\x14 \x01(\tR\btargetId\x12\x1d\n" +
"\n" +
"public_key\x18\x1e \x01(\fR\tpublicKey\x12\x1f\n" +
"\vprivate_key\x18( \x01(\fR\n" +
"privateKey\x122\n" +
"\x15private_key_encrypted\x182 \x01(\fR\x13privateKeyEncrypted\x12\x15\n" +
"\x06key_id\x18< \x01(\tR\x05keyId\x12\x19\n" +
"\balias_id\x18F \x01(\tR\aaliasId\x12 \n" +
"\vcertificate\x18P \x01(\fR\vcertificate\x12R\n" +
"\x0fnot_valid_after\x18Z \x01(\v2*.controller.storage.timestamp.v1.TimestampR\rnotValidAfter\x12\x18\n" +
"\aversion\x18d \x01(\rR\aversion\x12K\n" +
"\vcreate_time\x18n \x01(\v2*.controller.storage.timestamp.v1.TimestampR\n" +
"createTime\x12K\n" +
"\vupdate_time\x18x \x01(\v2*.controller.storage.timestamp.v1.TimestampR\n" +
"updateTimeB;Z9github.com/hashicorp/boundary/internal/target/store;storeb\x06proto3"
var (
file_controller_storage_target_store_v1_target_proto_rawDescOnce sync.Once
@@ -727,29 +1064,37 @@ func file_controller_storage_target_store_v1_target_proto_rawDescGZIP() []byte {
return file_controller_storage_target_store_v1_target_proto_rawDescData
}
var file_controller_storage_target_store_v1_target_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_controller_storage_target_store_v1_target_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_controller_storage_target_store_v1_target_proto_goTypes = []any{
(*TargetView)(nil), // 0: controller.storage.target.store.v1.TargetView
(*TargetHostSet)(nil), // 1: controller.storage.target.store.v1.TargetHostSet
(*TargetAddress)(nil), // 2: controller.storage.target.store.v1.TargetAddress
(*CredentialLibrary)(nil), // 3: controller.storage.target.store.v1.CredentialLibrary
(*StaticCredential)(nil), // 4: controller.storage.target.store.v1.StaticCredential
(*CredentialSource)(nil), // 5: controller.storage.target.store.v1.CredentialSource
(*CredentialSourceView)(nil), // 6: controller.storage.target.store.v1.CredentialSourceView
(*timestamp.Timestamp)(nil), // 7: controller.storage.timestamp.v1.Timestamp
(*TargetView)(nil), // 0: controller.storage.target.store.v1.TargetView
(*TargetHostSet)(nil), // 1: controller.storage.target.store.v1.TargetHostSet
(*TargetAddress)(nil), // 2: controller.storage.target.store.v1.TargetAddress
(*CredentialLibrary)(nil), // 3: controller.storage.target.store.v1.CredentialLibrary
(*StaticCredential)(nil), // 4: controller.storage.target.store.v1.StaticCredential
(*CredentialSource)(nil), // 5: controller.storage.target.store.v1.CredentialSource
(*CredentialSourceView)(nil), // 6: controller.storage.target.store.v1.CredentialSourceView
(*TargetProxyCertificate)(nil), // 7: controller.storage.target.store.v1.TargetProxyCertificate
(*TargetAliasProxyCertificate)(nil), // 8: controller.storage.target.store.v1.TargetAliasProxyCertificate
(*timestamp.Timestamp)(nil), // 9: controller.storage.timestamp.v1.Timestamp
}
var file_controller_storage_target_store_v1_target_proto_depIdxs = []int32{
7, // 0: controller.storage.target.store.v1.TargetView.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
7, // 1: controller.storage.target.store.v1.TargetView.update_time:type_name -> controller.storage.timestamp.v1.Timestamp
7, // 2: controller.storage.target.store.v1.TargetHostSet.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
7, // 3: controller.storage.target.store.v1.CredentialLibrary.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
7, // 4: controller.storage.target.store.v1.StaticCredential.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
7, // 5: controller.storage.target.store.v1.CredentialSource.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
9, // 0: controller.storage.target.store.v1.TargetView.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 1: controller.storage.target.store.v1.TargetView.update_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 2: controller.storage.target.store.v1.TargetHostSet.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 3: controller.storage.target.store.v1.CredentialLibrary.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 4: controller.storage.target.store.v1.StaticCredential.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 5: controller.storage.target.store.v1.CredentialSource.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 6: controller.storage.target.store.v1.TargetProxyCertificate.not_valid_after:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 7: controller.storage.target.store.v1.TargetProxyCertificate.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 8: controller.storage.target.store.v1.TargetProxyCertificate.update_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 9: controller.storage.target.store.v1.TargetAliasProxyCertificate.not_valid_after:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 10: controller.storage.target.store.v1.TargetAliasProxyCertificate.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
9, // 11: controller.storage.target.store.v1.TargetAliasProxyCertificate.update_time:type_name -> controller.storage.timestamp.v1.Timestamp
12, // [12:12] is the sub-list for method output_type
12, // [12:12] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_controller_storage_target_store_v1_target_proto_init() }
@@ -763,7 +1108,7 @@ func file_controller_storage_target_store_v1_target_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_controller_storage_target_store_v1_target_proto_rawDesc), len(file_controller_storage_target_store_v1_target_proto_rawDesc)),
NumEnums: 0,
NumMessages: 7,
NumMessages: 9,
NumExtensions: 0,
NumServices: 0,
},