refactor(backend): normalize naming convention to backend rather storage
no ambiguity with the backend rather storage
This commit is contained in:
@@ -510,7 +510,7 @@ impl KeyPair {
|
||||
/// SSH-style colon-hex fingerprint of the key material — 8 bytes
|
||||
/// of SHA-256 truncation rendered as `xx:yy:zz:...`. Same
|
||||
/// truncation as the v1 header's `<key_fp>` field and the
|
||||
/// `head_key_fp` reported by `storage_rotate` on completion, so
|
||||
/// `head_key_fp` reported by `backend_rotate` on completion, so
|
||||
/// operators can cross-reference the boot log against a rotate
|
||||
/// report or the CLI's `oxicloud --fingerprint <base64key>`
|
||||
/// output without any format conversion.
|
||||
@@ -725,7 +725,7 @@ pub fn parse_encryption_pair_list(entry_name: &str, raw: &str) -> Result<Vec<Key
|
||||
///
|
||||
/// Used by the `oxicloud --fingerprint <base64>` CLI subcommand so
|
||||
/// admins can identify which key in their `.env` corresponds to the
|
||||
/// `head_key_fp` a `storage_rotate` run reported on completion —
|
||||
/// `head_key_fp` a `backend_rotate` run reported on completion —
|
||||
/// see `docs/plan/storage-key-rotation.md`.
|
||||
///
|
||||
/// Errors on non-base64 input or on decoded length ≠ 32 bytes (the
|
||||
@@ -911,7 +911,7 @@ impl NamedStorageEntry {
|
||||
|
||||
/// The whole pair list, or an empty slice when the entry is
|
||||
/// unencrypted. Used by K2's read path to walk pairs and by
|
||||
/// `storage_rotate` to enumerate legacy pairs. Callers that only
|
||||
/// `backend_rotate` to enumerate legacy pairs. Callers that only
|
||||
/// need the write pair should prefer [`Self::head_key_material`].
|
||||
pub fn encryption_pairs(&self) -> &[KeyPair] {
|
||||
self.encryption.as_deref().unwrap_or(&[])
|
||||
@@ -3931,7 +3931,7 @@ mod tests {
|
||||
// K3.7: display fp switched from 12-char raw hex to
|
||||
// SSH-style 8-byte colon-hex (16 hex + 7 colons = 23 chars)
|
||||
// so operators can cross-reference against the v1 header's
|
||||
// `<key_fp>` field + `storage_rotate`'s `head_key_fp`
|
||||
// `<key_fp>` field + `backend_rotate`'s `head_key_fp`
|
||||
// output + the `oxicloud --fingerprint` CLI.
|
||||
let pairs =
|
||||
parse_encryption_pair_list("t", &format!("aes-256-gcm:{K1_B64},none:")).unwrap();
|
||||
|
||||
+9
-9
@@ -2245,7 +2245,7 @@ impl AppServiceFactory {
|
||||
dyn crate::infrastructure::scheduler::JobStoreProvider,
|
||||
> = app_state.core.job_store_provider.clone();
|
||||
let _ = Arc::new(
|
||||
crate::infrastructure::services::storage_migration_service::StorageMigrationService::new(
|
||||
crate::infrastructure::services::backend_migration_service::BackendMigrationService::new(
|
||||
app_state
|
||||
.maintenance_pool
|
||||
.clone()
|
||||
@@ -2262,13 +2262,13 @@ impl AppServiceFactory {
|
||||
.register_recoverable_job(&app_state.core.job_registry, &job_store_provider_dyn)
|
||||
.await;
|
||||
|
||||
// K3: `storage_rotate` recoverable-job tenant. Same
|
||||
// pattern as `storage_migration` but without the
|
||||
// K3: `backend_rotate` recoverable-job tenant. Same
|
||||
// pattern as `backend_migration` but without the
|
||||
// cutover/readonly plumbing — rotation writes in place on
|
||||
// whichever entry the trigger endpoint names. Target name
|
||||
// comes from `params.target_name` per run.
|
||||
let _ = Arc::new(
|
||||
crate::infrastructure::services::storage_rotate_service::StorageRotateService::new(
|
||||
crate::infrastructure::services::backend_rotate_service::BackendRotateService::new(
|
||||
app_state
|
||||
.maintenance_pool
|
||||
.clone()
|
||||
@@ -2477,7 +2477,7 @@ impl AppServiceFactory {
|
||||
// Migration-readonly boot-clear rule. See
|
||||
// `docs/plan/storage-multi-entry.md` §"Read-only mode".
|
||||
//
|
||||
// If the flag was set true at boot AND no storage_migration
|
||||
// If the flag was set true at boot AND no backend_migration
|
||||
// run is currently non-terminal AND active_backend_name
|
||||
// matches the entry the app actually booted onto — that means
|
||||
// the cutover completed on a prior boot (the run reached
|
||||
@@ -2495,11 +2495,11 @@ impl AppServiceFactory {
|
||||
.migration_readonly
|
||||
.load(std::sync::atomic::Ordering::Relaxed)
|
||||
{
|
||||
use crate::infrastructure::services::storage_migration_service::STORAGE_MIGRATION_JOB_NAME;
|
||||
use crate::infrastructure::services::backend_migration_service::BACKEND_MIGRATION_JOB_NAME;
|
||||
let has_in_flight = match app_state
|
||||
.core
|
||||
.job_store_provider
|
||||
.list_runs(STORAGE_MIGRATION_JOB_NAME, 5)
|
||||
.list_runs(BACKEND_MIGRATION_JOB_NAME, 5)
|
||||
.await
|
||||
{
|
||||
Ok(runs) => runs.iter().any(|r| {
|
||||
@@ -2515,7 +2515,7 @@ impl AppServiceFactory {
|
||||
target: "oxicloud::scheduler",
|
||||
event = "storage.migration_readonly.clear_check_failed",
|
||||
error = %e,
|
||||
"failed to list storage_migration runs during readonly-clear check; \
|
||||
"failed to list backend_migration runs during readonly-clear check; \
|
||||
leaving migration_readonly flag as-is"
|
||||
);
|
||||
// Play it safe: assume in-flight to avoid clearing prematurely.
|
||||
@@ -2816,7 +2816,7 @@ pub struct AppState {
|
||||
/// polling. See `MigrationProgress` for the field shape.
|
||||
pub migration_progress: Arc<std::sync::RwLock<Option<crate::common::migration_progress::MigrationProgress>>>,
|
||||
/// Live progress snapshot for the storage-rotate handler
|
||||
/// (`storage_rotate` — K3 of the storage-key-rotation plan).
|
||||
/// (`backend_rotate` — K3 of the storage-key-rotation plan).
|
||||
/// `Some(_)` while a rotation is running; `None` otherwise.
|
||||
/// Held separately from `migration_progress` so the
|
||||
/// server-status header can broadcast the two states
|
||||
|
||||
Reference in New Issue
Block a user