feat: Update StorageBucketSecret to StorageBucketCredentialManagedSecret
Update domain code to replace references of `StorageBucketSecret` to `StorageBucketCredentialManagedSecret`
This commit is contained in:
1 parent
88c67e4eea
commit
012ec400f0
5 files changed
+90
-213
No files matched your search
@@ -77,26 +77,6 @@ message StorageBucket {
|
||||
string storage_bucket_credential_id = 14;
|
||||
}
|
||||
|
||||
message StorageBucketSecret {
|
||||
// storage_bucket_id is the public id of the storage bucket using this secret.
|
||||
// @inject_tag: `gorm:"primary_key"`
|
||||
string storage_bucket_id = 1;
|
||||
|
||||
// secrets is the plain-text of the secret data. We are not storing this plain-text
|
||||
// value in the database.
|
||||
// @inject_tag: `gorm:"-" wrapping:"pt,secrets_data"`
|
||||
bytes secrets = 2;
|
||||
|
||||
// ct_secrets is the ciphertext of the secret data stored in the db.
|
||||
// @inject_tag: `gorm:"column:secrets_encrypted;not_null" wrapping:"ct,secrets_data"`
|
||||
bytes ct_secrets = 3;
|
||||
|
||||
// The key_id of the kms database key used for encrypting this entry.
|
||||
// It must be set.
|
||||
// @inject_tag: `gorm:"not_null"`
|
||||
string key_id = 4;
|
||||
}
|
||||
|
||||
message StorageBucketCredential {
|
||||
// private_id is a surrogate key suitable for use via API.
|
||||
// @inject_tag: `gorm:"primary_key"`
|
||||
|
||||
@@ -13,15 +13,15 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
storageBucketSecretTablename = "storage_plugin_storage_bucket_secret"
|
||||
storageBucketCredentialManagedSecretTablename = "storage_bucket_credential_managed_secret"
|
||||
)
|
||||
|
||||
func init() {
|
||||
kms.RegisterTableRewrapFn(storageBucketSecretTablename, storageBucketSecretRewrapFn)
|
||||
kms.RegisterTableRewrapFn(storageBucketCredentialManagedSecretTablename, storageBucketCredentialManagedSecretRewrapFn)
|
||||
}
|
||||
|
||||
// storageBucketRewrapFn provides a kms.Rewrapfn for the StorageBucketSecret type
|
||||
func storageBucketSecretRewrapFn(ctx context.Context, dataKeyVersionId, scopeId string, reader db.Reader, writer db.Writer, kmsRepo kms.GetWrapperer) error {
|
||||
// storageBucketRewrapFn provides a kms.Rewrapfn for the StorageBucketCredentialManagedSecret type
|
||||
func storageBucketCredentialManagedSecretRewrapFn(ctx context.Context, dataKeyVersionId, scopeId string, reader db.Reader, writer db.Writer, kmsRepo kms.GetWrapperer) error {
|
||||
const op = "storage.storageBucketRewrapFn"
|
||||
switch {
|
||||
case dataKeyVersionId == "":
|
||||
@@ -35,17 +35,17 @@ func storageBucketSecretRewrapFn(ctx context.Context, dataKeyVersionId, scopeId
|
||||
case kmsRepo == nil:
|
||||
return errors.New(ctx, errors.InvalidParameter, op, "missing kms repository")
|
||||
}
|
||||
var secrets []*StorageBucketSecret
|
||||
var sbcms []*StorageBucketCredentialManagedSecret
|
||||
// The only index on this table is on the primary key (storage bucket id) and we can't find it that way.
|
||||
// This is the fastest query we can use without creating a new index on key_id.
|
||||
if err := reader.SearchWhere(ctx, &secrets, "key_id=?", []any{dataKeyVersionId}, db.WithLimit(-1)); err != nil {
|
||||
if err := reader.SearchWhere(ctx, &sbcms, "key_id=?", []any{dataKeyVersionId}, db.WithLimit(-1)); err != nil {
|
||||
return errors.Wrap(ctx, err, op, errors.WithMsg("failed to query sql for rows that need rewrapping"))
|
||||
}
|
||||
wrapper, err := kmsRepo.GetWrapper(ctx, scopeId, kms.KeyPurposeDatabase)
|
||||
if err != nil {
|
||||
return errors.Wrap(ctx, err, op, errors.WithMsg("failed to fetch kms wrapper for rewrapping"))
|
||||
}
|
||||
for _, secret := range secrets {
|
||||
for _, secret := range sbcms {
|
||||
if err := secret.decrypt(ctx, wrapper); err != nil {
|
||||
return errors.Wrap(ctx, err, op, errors.WithMsg("failed to decrypt storage bucket secret"))
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
)
|
||||
|
||||
func TestRewrap_storageBucketSecretRewrapFn(t *testing.T) {
|
||||
func TestRewrap_storageBucketCredentialManagedSecretRewrapFn(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
t.Run("errors-on-query-error", func(t *testing.T) {
|
||||
conn, mock := db.TestSetupWithMock(t)
|
||||
@@ -38,7 +38,7 @@ func TestRewrap_storageBucketSecretRewrapFn(t *testing.T) {
|
||||
mock.ExpectQuery(
|
||||
`SELECT \* FROM "storage_plugin_storage_bucket_secret" WHERE key_id=\$1`,
|
||||
).WillReturnError(errors.New("Query error"))
|
||||
err := storageBucketSecretRewrapFn(ctx, "some_id", "some_scope", rw, rw, kmsCache)
|
||||
err := storageBucketCredentialManagedSecretRewrapFn(ctx, "some_id", "some_scope", rw, rw, kmsCache)
|
||||
require.Error(t, err)
|
||||
})
|
||||
t.Run("success", func(t *testing.T) {
|
||||
@@ -78,7 +78,7 @@ func TestRewrap_storageBucketSecretRewrapFn(t *testing.T) {
|
||||
require.NoError(rw.Create(ctx, sb))
|
||||
|
||||
// now store secret
|
||||
cred, err := newStorageBucketSecret(ctx, sb.PublicId, sb.Secrets)
|
||||
cred, err := newStorageBucketCredentialManagedSecret(ctx, sb.PublicId, sb.Secrets)
|
||||
require.NoError(err)
|
||||
kmsWrapper1, err := kmsCache.GetWrapper(context.Background(), org.GetPublicId(), 1)
|
||||
require.NoError(err)
|
||||
@@ -88,11 +88,11 @@ func TestRewrap_storageBucketSecretRewrapFn(t *testing.T) {
|
||||
|
||||
// now things are stored in the db, we can rotate and rewrap
|
||||
require.NoError(kmsCache.RotateKeys(ctx, org.Scope.GetPublicId()))
|
||||
require.NoError(storageBucketSecretRewrapFn(ctx, cred.KeyId, org.Scope.GetPublicId(), rw, rw, kmsCache))
|
||||
require.NoError(storageBucketCredentialManagedSecretRewrapFn(ctx, cred.KeyId, org.Scope.GetPublicId(), rw, rw, kmsCache))
|
||||
|
||||
// now we pull the config back from the db, decrypt it with the new key, and ensure things match
|
||||
got := &StorageBucketSecret{
|
||||
StorageBucketSecret: &store.StorageBucketSecret{
|
||||
got := &StorageBucketCredentialManagedSecret{
|
||||
StorageBucketCredentialManagedSecret: &store.StorageBucketCredentialManagedSecret{
|
||||
StorageBucketId: sb.PublicId,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -83,23 +83,23 @@ func (s *StorageBucket) oplog(op oplog.OpType) oplog.Metadata {
|
||||
return metadata
|
||||
}
|
||||
|
||||
type StorageBucketSecret struct {
|
||||
*store.StorageBucketSecret
|
||||
type StorageBucketCredentialManagedSecret struct {
|
||||
*store.StorageBucketCredentialManagedSecret
|
||||
tableName string `gorm:"-"`
|
||||
}
|
||||
|
||||
func allocStorageBucketSecret() *StorageBucketSecret {
|
||||
return &StorageBucketSecret{
|
||||
StorageBucketSecret: &store.StorageBucketSecret{},
|
||||
func allocStorageBucketCredentialManagedSecret() *StorageBucketCredentialManagedSecret {
|
||||
return &StorageBucketCredentialManagedSecret{
|
||||
StorageBucketCredentialManagedSecret: &store.StorageBucketCredentialManagedSecret{},
|
||||
}
|
||||
}
|
||||
|
||||
// newStorageBucketSecret creates an in memory storage bucket secret from a json
|
||||
// newStorageBucketCredentialManagedSecret creates an in memory storage bucket secret from a json
|
||||
// formatted generic struct.
|
||||
func newStorageBucketSecret(ctx context.Context, storageBucketId string, secret *structpb.Struct) (*StorageBucketSecret, error) {
|
||||
const op = "plugin.newStorageBucketSecret"
|
||||
s := &StorageBucketSecret{
|
||||
StorageBucketSecret: &store.StorageBucketSecret{
|
||||
func newStorageBucketCredentialManagedSecret(ctx context.Context, storageBucketId string, secret *structpb.Struct) (*StorageBucketCredentialManagedSecret, error) {
|
||||
const op = "plugin.newStorageBucketCredentialManagedSecret"
|
||||
s := &StorageBucketCredentialManagedSecret{
|
||||
StorageBucketCredentialManagedSecret: &store.StorageBucketCredentialManagedSecret{
|
||||
StorageBucketId: storageBucketId,
|
||||
},
|
||||
}
|
||||
@@ -114,23 +114,23 @@ func newStorageBucketSecret(ctx context.Context, storageBucketId string, secret
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func (sbs *StorageBucketSecret) clone() *StorageBucketSecret {
|
||||
cp := proto.Clone(sbs.StorageBucketSecret)
|
||||
return &StorageBucketSecret{
|
||||
StorageBucketSecret: cp.(*store.StorageBucketSecret),
|
||||
func (sbs *StorageBucketCredentialManagedSecret) clone() *StorageBucketCredentialManagedSecret {
|
||||
cp := proto.Clone(sbs.StorageBucketCredentialManagedSecret)
|
||||
return &StorageBucketCredentialManagedSecret{
|
||||
StorageBucketCredentialManagedSecret: cp.(*store.StorageBucketCredentialManagedSecret),
|
||||
}
|
||||
}
|
||||
|
||||
// TableName returns the table name for the storage bucket secrets.
|
||||
func (sbs *StorageBucketSecret) TableName() string {
|
||||
func (sbs *StorageBucketCredentialManagedSecret) TableName() string {
|
||||
if sbs.tableName != "" {
|
||||
return sbs.tableName
|
||||
}
|
||||
return "storage_plugin_storage_bucket_secret"
|
||||
return "storage_bucket_credential_managed_secret"
|
||||
}
|
||||
|
||||
// SetTableName sets the table name.
|
||||
func (sbs *StorageBucketSecret) SetTableName(n string) {
|
||||
func (sbs *StorageBucketCredentialManagedSecret) SetTableName(n string) {
|
||||
sbs.tableName = n
|
||||
}
|
||||
|
||||
@@ -146,8 +146,8 @@ func hmacField(ctx context.Context, cipher wrapping.Wrapper, field []byte, publi
|
||||
|
||||
// only hmac's the secret's value. does not modify the underlying secret
|
||||
// returns nil on failure
|
||||
func (sbs *StorageBucketSecret) hmacSecrets(ctx context.Context, cipher wrapping.Wrapper) ([]byte, error) {
|
||||
const op = "plugin.(StorageBucketSecret).hmacSecrets"
|
||||
func (sbs *StorageBucketCredentialManagedSecret) hmacSecrets(ctx context.Context, cipher wrapping.Wrapper) ([]byte, error) {
|
||||
const op = "plugin.(StorageBucketCredentialManagedSecret).hmacSecrets"
|
||||
if cipher == nil {
|
||||
return nil, errors.New(ctx, errors.InvalidParameter, op, "missing cipher")
|
||||
}
|
||||
@@ -164,12 +164,12 @@ func (sbs *StorageBucketSecret) hmacSecrets(ctx context.Context, cipher wrapping
|
||||
}
|
||||
|
||||
// encrypt the bind credential before writing it to the database
|
||||
func (sbs *StorageBucketSecret) encrypt(ctx context.Context, cipher wrapping.Wrapper) error {
|
||||
const op = "plugin.(StorageBucketSecret).encrypt"
|
||||
func (sbs *StorageBucketCredentialManagedSecret) encrypt(ctx context.Context, cipher wrapping.Wrapper) error {
|
||||
const op = "plugin.(StorageBucketCredentialManagedSecret).encrypt"
|
||||
if util.IsNil(cipher) {
|
||||
return errors.New(ctx, errors.InvalidParameter, op, "missing cipher")
|
||||
}
|
||||
if err := structwrapping.WrapStruct(ctx, cipher, sbs.StorageBucketSecret); err != nil {
|
||||
if err := structwrapping.WrapStruct(ctx, cipher, sbs.StorageBucketCredentialManagedSecret); err != nil {
|
||||
return errors.Wrap(ctx, err, op, errors.WithCode(errors.Encrypt))
|
||||
}
|
||||
var err error
|
||||
@@ -180,20 +180,20 @@ func (sbs *StorageBucketSecret) encrypt(ctx context.Context, cipher wrapping.Wra
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sbs *StorageBucketSecret) decrypt(ctx context.Context, cipher wrapping.Wrapper) error {
|
||||
const op = "plugin.(StorageBucketSecret).decrypt"
|
||||
func (sbs *StorageBucketCredentialManagedSecret) decrypt(ctx context.Context, cipher wrapping.Wrapper) error {
|
||||
const op = "plugin.(StorageBucketCredentialManagedSecret).decrypt"
|
||||
if util.IsNil(cipher) {
|
||||
return errors.New(ctx, errors.InvalidParameter, op, "missing cipher")
|
||||
}
|
||||
if err := structwrapping.UnwrapStruct(ctx, cipher, sbs.StorageBucketSecret, nil); err != nil {
|
||||
if err := structwrapping.UnwrapStruct(ctx, cipher, sbs.StorageBucketCredentialManagedSecret, nil); err != nil {
|
||||
return errors.Wrap(ctx, err, op, errors.WithCode(errors.Decrypt))
|
||||
}
|
||||
sbs.CtSecrets = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sbs *StorageBucketSecret) toPersisted(ctx context.Context) (*storagebuckets.StorageBucketPersisted, error) {
|
||||
const op = "plugin.(StorageBucketSecret).toPersisted"
|
||||
func (sbs *StorageBucketCredentialManagedSecret) toPersisted(ctx context.Context) (*storagebuckets.StorageBucketPersisted, error) {
|
||||
const op = "plugin.(StorageBucketCredentialManagedSecret).toPersisted"
|
||||
if sbs.Secrets == nil {
|
||||
return nil, errors.New(ctx, errors.InvalidParameter, op, "secret data not populated")
|
||||
}
|
||||
@@ -233,7 +233,7 @@ func (sba *storageBucketAgg) GetPublicId() string {
|
||||
return sba.PublicId
|
||||
}
|
||||
|
||||
func (sba *storageBucketAgg) toStorageBucketAndSecret() (*StorageBucket, *StorageBucketSecret) {
|
||||
func (sba *storageBucketAgg) toStorageBucketAndSecret() (*StorageBucket, *StorageBucketCredentialManagedSecret) {
|
||||
sb := allocStorageBucket()
|
||||
sb.PublicId = sba.PublicId
|
||||
sb.ScopeId = sba.ScopeId
|
||||
@@ -249,9 +249,9 @@ func (sba *storageBucketAgg) toStorageBucketAndSecret() (*StorageBucket, *Storag
|
||||
sb.Attributes = sba.Attributes
|
||||
sb.SecretsHmac = sba.SecretsHmac
|
||||
|
||||
var sbs *StorageBucketSecret
|
||||
var sbs *StorageBucketCredentialManagedSecret
|
||||
if len(sba.SecretsEncrypted) > 0 {
|
||||
sbs = allocStorageBucketSecret()
|
||||
sbs = allocStorageBucketCredentialManagedSecret()
|
||||
sbs.StorageBucketId = sba.PublicId
|
||||
sbs.CtSecrets = sba.SecretsEncrypted
|
||||
sbs.KeyId = sba.KeyId
|
||||
|
||||
@@ -205,87 +205,6 @@ func (x *StorageBucket) GetStorageBucketCredentialId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type StorageBucketSecret struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// storage_bucket_id is the public id of the storage bucket using this secret.
|
||||
// @inject_tag: `gorm:"primary_key"`
|
||||
StorageBucketId string `protobuf:"bytes,1,opt,name=storage_bucket_id,json=storageBucketId,proto3" json:"storage_bucket_id,omitempty" gorm:"primary_key"`
|
||||
// secrets is the plain-text of the secret data. We are not storing this plain-text
|
||||
// value in the database.
|
||||
// @inject_tag: `gorm:"-" wrapping:"pt,secrets_data"`
|
||||
Secrets []byte `protobuf:"bytes,2,opt,name=secrets,proto3" json:"secrets,omitempty" gorm:"-" wrapping:"pt,secrets_data"`
|
||||
// ct_secrets is the ciphertext of the secret data stored in the db.
|
||||
// @inject_tag: `gorm:"column:secrets_encrypted;not_null" wrapping:"ct,secrets_data"`
|
||||
CtSecrets []byte `protobuf:"bytes,3,opt,name=ct_secrets,json=ctSecrets,proto3" json:"ct_secrets,omitempty" gorm:"column:secrets_encrypted;not_null" wrapping:"ct,secrets_data"`
|
||||
// The key_id of the kms database key used for encrypting this entry.
|
||||
// It must be set.
|
||||
// @inject_tag: `gorm:"not_null"`
|
||||
KeyId string `protobuf:"bytes,4,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty" gorm:"not_null"`
|
||||
}
|
||||
|
||||
func (x *StorageBucketSecret) Reset() {
|
||||
*x = StorageBucketSecret{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *StorageBucketSecret) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StorageBucketSecret) ProtoMessage() {}
|
||||
|
||||
func (x *StorageBucketSecret) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StorageBucketSecret.ProtoReflect.Descriptor instead.
|
||||
func (*StorageBucketSecret) Descriptor() ([]byte, []int) {
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *StorageBucketSecret) GetStorageBucketId() string {
|
||||
if x != nil {
|
||||
return x.StorageBucketId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StorageBucketSecret) GetSecrets() []byte {
|
||||
if x != nil {
|
||||
return x.Secrets
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StorageBucketSecret) GetCtSecrets() []byte {
|
||||
if x != nil {
|
||||
return x.CtSecrets
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StorageBucketSecret) GetKeyId() string {
|
||||
if x != nil {
|
||||
return x.KeyId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type StorageBucketCredential struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -302,7 +221,7 @@ type StorageBucketCredential struct {
|
||||
func (x *StorageBucketCredential) Reset() {
|
||||
*x = StorageBucketCredential{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[2]
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -315,7 +234,7 @@ func (x *StorageBucketCredential) String() string {
|
||||
func (*StorageBucketCredential) ProtoMessage() {}
|
||||
|
||||
func (x *StorageBucketCredential) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[2]
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -328,7 +247,7 @@ func (x *StorageBucketCredential) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use StorageBucketCredential.ProtoReflect.Descriptor instead.
|
||||
func (*StorageBucketCredential) Descriptor() ([]byte, []int) {
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP(), []int{2}
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *StorageBucketCredential) GetPrivateId() string {
|
||||
@@ -361,7 +280,7 @@ type StorageBucketCredentialEnvironmental struct {
|
||||
func (x *StorageBucketCredentialEnvironmental) Reset() {
|
||||
*x = StorageBucketCredentialEnvironmental{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[3]
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -374,7 +293,7 @@ func (x *StorageBucketCredentialEnvironmental) String() string {
|
||||
func (*StorageBucketCredentialEnvironmental) ProtoMessage() {}
|
||||
|
||||
func (x *StorageBucketCredentialEnvironmental) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[3]
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -387,7 +306,7 @@ func (x *StorageBucketCredentialEnvironmental) ProtoReflect() protoreflect.Messa
|
||||
|
||||
// Deprecated: Use StorageBucketCredentialEnvironmental.ProtoReflect.Descriptor instead.
|
||||
func (*StorageBucketCredentialEnvironmental) Descriptor() ([]byte, []int) {
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP(), []int{3}
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *StorageBucketCredentialEnvironmental) GetPrivateId() string {
|
||||
@@ -431,7 +350,7 @@ type StorageBucketCredentialManagedSecret struct {
|
||||
func (x *StorageBucketCredentialManagedSecret) Reset() {
|
||||
*x = StorageBucketCredentialManagedSecret{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[4]
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -444,7 +363,7 @@ func (x *StorageBucketCredentialManagedSecret) String() string {
|
||||
func (*StorageBucketCredentialManagedSecret) ProtoMessage() {}
|
||||
|
||||
func (x *StorageBucketCredentialManagedSecret) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[4]
|
||||
mi := &file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -457,7 +376,7 @@ func (x *StorageBucketCredentialManagedSecret) ProtoReflect() protoreflect.Messa
|
||||
|
||||
// Deprecated: Use StorageBucketCredentialManagedSecret.ProtoReflect.Descriptor instead.
|
||||
func (*StorageBucketCredentialManagedSecret) Descriptor() ([]byte, []int) {
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP(), []int{4}
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *StorageBucketCredentialManagedSecret) GetPrivateId() string {
|
||||
@@ -551,47 +470,38 @@ var file_controller_storage_storage_plugin_store_v1_storage_proto_rawDesc = []by
|
||||
0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e,
|
||||
0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x73,
|
||||
0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64,
|
||||
0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x6f,
|
||||
0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74,
|
||||
0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b,
|
||||
0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x6f,
|
||||
0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73,
|
||||
0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x63,
|
||||
0x72, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x74, 0x53, 0x65,
|
||||
0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x22, 0x64, 0x0a, 0x17,
|
||||
0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x72, 0x65,
|
||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61,
|
||||
0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69,
|
||||
0x76, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67,
|
||||
0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74,
|
||||
0x49, 0x64, 0x22, 0x71, 0x0a, 0x24, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63,
|
||||
0x6b, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x45, 0x6e, 0x76,
|
||||
0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72,
|
||||
0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x64, 0x0a, 0x17, 0x53, 0x74, 0x6f, 0x72,
|
||||
0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74,
|
||||
0x69, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65,
|
||||
0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75,
|
||||
0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73,
|
||||
0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x22, 0x71,
|
||||
0x0a, 0x24, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43,
|
||||
0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74,
|
||||
0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76,
|
||||
0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
|
||||
0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49,
|
||||
0x64, 0x22, 0xc1, 0x01, 0x0a, 0x24, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63,
|
||||
0x6b, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x6e,
|
||||
0x61, 0x67, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72,
|
||||
0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
||||
0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x6f,
|
||||
0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x75, 0x63,
|
||||
0x6b, 0x65, 0x74, 0x49, 0x64, 0x22, 0xc1, 0x01, 0x0a, 0x24, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67,
|
||||
0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61,
|
||||
0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1d,
|
||||
0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a,
|
||||
0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f,
|
||||
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67,
|
||||
0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63,
|
||||
0x72, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72,
|
||||
0x65, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
|
||||
0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65,
|
||||
0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72,
|
||||
0x70, 0x2f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72,
|
||||
0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6c, 0x75, 0x67,
|
||||
0x69, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12,
|
||||
0x1d, 0x0a, 0x0a, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x15,
|
||||
0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||
0x6b, 0x65, 0x79, 0x49, 0x64, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x62, 0x6f,
|
||||
0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
|
||||
0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x73,
|
||||
0x74, 0x6f, 0x72, 0x65, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -606,18 +516,17 @@ func file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescGZIP()
|
||||
return file_controller_storage_storage_plugin_store_v1_storage_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_controller_storage_storage_plugin_store_v1_storage_proto_goTypes = []interface{}{
|
||||
(*StorageBucket)(nil), // 0: controller.storage.storage.plugin.store.v1.StorageBucket
|
||||
(*StorageBucketSecret)(nil), // 1: controller.storage.storage.plugin.store.v1.StorageBucketSecret
|
||||
(*StorageBucketCredential)(nil), // 2: controller.storage.storage.plugin.store.v1.StorageBucketCredential
|
||||
(*StorageBucketCredentialEnvironmental)(nil), // 3: controller.storage.storage.plugin.store.v1.StorageBucketCredentialEnvironmental
|
||||
(*StorageBucketCredentialManagedSecret)(nil), // 4: controller.storage.storage.plugin.store.v1.StorageBucketCredentialManagedSecret
|
||||
(*timestamp.Timestamp)(nil), // 5: controller.storage.timestamp.v1.Timestamp
|
||||
(*StorageBucketCredential)(nil), // 1: controller.storage.storage.plugin.store.v1.StorageBucketCredential
|
||||
(*StorageBucketCredentialEnvironmental)(nil), // 2: controller.storage.storage.plugin.store.v1.StorageBucketCredentialEnvironmental
|
||||
(*StorageBucketCredentialManagedSecret)(nil), // 3: controller.storage.storage.plugin.store.v1.StorageBucketCredentialManagedSecret
|
||||
(*timestamp.Timestamp)(nil), // 4: controller.storage.timestamp.v1.Timestamp
|
||||
}
|
||||
var file_controller_storage_storage_plugin_store_v1_storage_proto_depIdxs = []int32{
|
||||
5, // 0: controller.storage.storage.plugin.store.v1.StorageBucket.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
5, // 1: controller.storage.storage.plugin.store.v1.StorageBucket.update_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
4, // 0: controller.storage.storage.plugin.store.v1.StorageBucket.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
4, // 1: controller.storage.storage.plugin.store.v1.StorageBucket.update_time:type_name -> controller.storage.timestamp.v1.Timestamp
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
@@ -644,18 +553,6 @@ func file_controller_storage_storage_plugin_store_v1_storage_proto_init() {
|
||||
}
|
||||
}
|
||||
file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StorageBucketSecret); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StorageBucketCredential); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -667,7 +564,7 @@ func file_controller_storage_storage_plugin_store_v1_storage_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StorageBucketCredentialEnvironmental); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -679,7 +576,7 @@ func file_controller_storage_storage_plugin_store_v1_storage_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_controller_storage_storage_plugin_store_v1_storage_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StorageBucketCredentialManagedSecret); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -698,7 +595,7 @@ func file_controller_storage_storage_plugin_store_v1_storage_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_controller_storage_storage_plugin_store_v1_storage_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user