feat(proto): define storage bucket state in worker status

This commit is contained in:
Damian Debkowski authored and Elim Tsiagbey committed 2024-07-17 14:23:11 -04:00
1 parent dc21e714a5
commit 88c67e4eea
12 files changed
+1133 -216

No files matched your search

@@ -96,6 +96,9 @@ message StorageBucket {
}
]; // @gotags: `class:"public"`
// Internal use only. The storage bucket credential id for this storage bucket.
string storage_bucket_credential_id = 160; // @gotags: `class:"public"`
// Output only. The available actions on this resource for this user.
repeated string authorized_actions = 300 [json_name = "authorized_actions"]; // @gotags: `class:"public"`
}
@@ -5,6 +5,8 @@ syntax = "proto3";
package controller.servers.v1;
import "plugin/v1/storage_plugin_service.proto";
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/servers;servers";
// TagPair matches a key to a value.
@@ -48,4 +50,8 @@ message ServerWorkerStatus {
// - not configured: The worker does not have a local storage path configured
// - unknown: The default local storage state of a worker. Used when the local storage state of a worker is not yet known
string local_storage_state = 80 [json_name = "local_storage_state"]; // @gotags: `class:"public" eventstream:"observation"
// StorageBucketCredentialStates is a map where the key is a storage bucket id
// and the value contains the current state of the storage bucket.
map<string, plugin.v1.StorageBucketCredentialState> storage_bucket_credential_states = 90; // @gotags: `class:"public" eventstream:"observation"`
}
@@ -97,3 +97,30 @@ message WorkerTag {
// @inject_tag: `gorm:"primary_key"`
string source = 40;
}
// WorkerStorageBucketCredentialState is a state for a storage bucket credential for a worker.
// The primary key is comprised of the worker_id, storage_bucket_credential_id, permission_type.
message WorkerStorageBucketCredentialState {
// worker_id is the public key of the worker.
// @inject_tag: `gorm:"primary_key"`
string worker_id = 10;
// storage_bucket_credential_id is the public key of the storage bucket credential.
// @inject_tag: `gorm:"primary_key"`
string storage_bucket_credential_id = 20;
// permission_type is a enum that defines the permission type.
// @inject_tag: `gorm:"primary_key"`
string permission_type = 30;
// state is a enum that defines the permission state.
// @inject_tag: `gorm:"not_null"`
string state = 40;
// error_details is the error message returned from the external object store service.
string error_details = 50;
// checked_at is the utc timestamp of when the permission was tested.
// @inject_tag: `gorm:"not_null"`
timestamp.v1.Timestamp checked_at = 60;
}
@@ -71,6 +71,10 @@ message StorageBucket {
// secrets_hmac is a sha256-hmac of the unencrypted secrets stored in the db.
// @inject_tag: `gorm:"default:null"`
bytes secrets_hmac = 13;
// storage_bucket_credential_id is the private key of the storage bucket credential.
// @inject_tag: `gorm:"default:null"`
string storage_bucket_credential_id = 14;
}
message StorageBucketSecret {
@@ -92,3 +96,47 @@ message StorageBucketSecret {
// @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"`
string private_id = 1;
// storage_bucket_id is the public id of the storage bucket.
// @inject_tag: `gorm:"not_null"`
string storage_bucket_id = 2;
}
message StorageBucketCredentialEnvironmental {
// private_id is a surrogate key suitable for use in a public API.
// @inject_tag: `gorm:"primary_key"`
string private_id = 1;
// storage_bucket_id is the public id of the storage bucket.
// @inject_tag: `gorm:"not_null"`
string storage_bucket_id = 2;
}
message StorageBucketCredentialManagedSecret {
// private_id is a surrogate key suitable for use via API.
// @inject_tag: `gorm:"primary_key"`
string private_id = 1;
// storage_bucket_id is the public id of the storage bucket.
// @inject_tag: `gorm:"not_null"`
string storage_bucket_id = 2;
// 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 = 3;
// 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 = 4;
// 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 = 5;
}