Short answer: keep every backup object private, let the Node.js admin panel authorize one immutable object version, and return a short-lived signed download URL so the media bytes travel directly from object storage to the operator. Record the authorization and the later restore result as separate audit events; a signed URL proves delegated access, not a successful or correct restore.

For a healthtech system restoring a large imaging file, the bill starts with retained byte-hours, replicated copies, retrieval, and egress. Request count is usually easy to see and easy to over-optimize. Retention is the lever that compounds: in a worked example, retaining a 32 GiB daily full copy for 90 days represents 2,880 GiB of logical stored data before replication or compression, while retaining seven daily full copies represents 224 GiB. Those are arithmetic assumptions, not a vendor quote or benchmark. The design change is to keep short-lived full copies plus longer-lived incremental or application-consistent recovery points, provided restore drills establish that the chain meets the recovery objective.

The cost of deleting old full copies is reduced forensic depth. If an integrity problem is discovered after the retained window, the discarded version cannot be inspected or restored. Compliance may also remove this choice entirely: a team subject to a government authorization boundary should map retention, access, logging, and media handling to its actual controls rather than treating a signed URL as a compliance result. FedRAMP is a US government risk and authorization program, not a generic certification shortcut.

Keep that limitation visible.

Node.js admin panel versus recovery worker for private backup download

Use a two-plane flow. The control plane authenticates the operator, checks tenant and object-version scope, creates an idempotent restore authorization, and asks a signing component for a narrowly scoped URL. The data plane is the direct transfer between the browser or recovery worker and private object storage. The application never proxies the 32 GiB payload, so its memory, connection pool, and deployment timeout do not become part of the transfer path. The same separation supports large media uploads: authorize a specific object key and content constraints, then let the client upload directly to storage.

Transfer target Access-control consequence Delivery consequence Prefer it when
Operator browser The operator temporarily holds the delegated URL and recovered bytes Few components; storage serves the payload directly Policy permits local handling and the restore is an inspected admin action
Controlled recovery worker Credentials and bytes remain inside a managed execution boundary A queue, worker capacity, quarantine storage, and result reporting become operational dependencies Endpoint controls, dual approval, inspection, or evidence preservation are required

Neither path should receive a general storage credential. The choice is where the narrowly delegated capability terminates — an authenticated operator endpoint or a controlled worker — and that choice should be recorded on the authorization itself so later reconciliation knows which completion evidence to expect.

A download sequence should be boring:

  1. The admin panel sends a restore request with an idempotency key, tenant ID, immutable backup version, and intended target.
  2. The control plane verifies role, tenant membership, case or ticket reference, and retention state.
  3. It inserts the authorization and audit record in one database transaction. A repeated idempotency key with the same canonical request returns the original authorization; the same key with different input returns 409 Conflict.
  4. A signer returns a URL limited to one object version, one method, and a brief expiry. The browser downloads from storage directly.
  5. The recovery worker verifies the expected byte length and digest before it changes application-visible state, then commits the restore and an outbox event atomically.

The separation matters because HTTP success has a narrow meaning. RFC 9110 defines HTTP semantics, but it does not make a successful download equivalent to a semantically valid medical-media restore. A 200 OK can still carry the wrong tenant's object if authorization was scoped incorrectly, and an interrupted transfer can leave a local file that must never be promoted. Authorization, transport completion, integrity verification, and domain activation are four different state transitions.

Don't issue a bucket-wide credential to make this easier.

How can a signed URL restore flow stay idempotent?

The following Go service is deliberately small enough to run, although the surrounding admin application may be Node.js. It models the boundary that matters: the admin panel calls POST /restore-authorizations, while the response points at an object host rather than streaming bytes through the service. Replace the in-memory repository and demonstration HMAC signer with adapters for the database and private object store selected by your organization; keep the request canonicalization and state transitions unchanged.

package main import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "encoding/json" "fmt" "log" "net/http" "net/url" "os" "strings" "sync" "time" ) type restoreRequest struct { TenantID string `json:"tenant_id"` ObjectKey string `json:"object_key"` ObjectVersion string `json:"object_version"` ExpectedSHA256 string `json:"expected_sha256"` Ticket string `json:"ticket"` } type savedAuthorization struct { Fingerprint string URL string ExpiresAt time.Time } type server struct { mu sync.Mutex saved map[string]savedAuthorization secret []byte objectScheme string objectHost string } func fingerprint(r restoreRequest) string { canonical := strings.Join([]string{r.TenantID, r.ObjectKey, r.ObjectVersion, r.ExpectedSHA256, r.Ticket}, "\n") sum := sha256.Sum256([]byte(canonical)) return hex.EncodeToString(sum[:]) } func (s *server) signedURL(r restoreRequest, expires time.Time) string { path := "/private/" + url.PathEscape(r.TenantID) + "/" + url.PathEscape(r.ObjectKey) values := url.Values{"version": {r.ObjectVersion}, "expires": {fmt.Sprint(expires.Unix())}} unsigned := path + "?" + values.Encode() mac := hmac.New(sha256.New, s.secret) mac.Write([]byte("GET\n" + unsigned)) values.Set("signature", hex.EncodeToString(mac.Sum(nil))) return s.objectScheme + "://" + s.objectHost + path + "?" + values.Encode() } func (s *server) authorize(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { http.Error(w, "method not allowed", http.StatusMethodNotAllowed) return } key := r.Header.Get("Idempotency-Key") operator := r.Header.Get("X-Authenticated-Operator") if key == "" || operator == "" { http.Error(w, "missing authorization context", http.StatusUnauthorized) return } var input restoreRequest dec := json.NewDecoder(http.MaxBytesReader(w, r.Body, 16<<10)) dec.DisallowUnknownFields() if err := dec.Decode(&input); err != nil { http.Error(w, "invalid request", http.StatusBadRequest) return } if input.TenantID == "" || input.ObjectKey == "" || input.ObjectVersion == "" || input.ExpectedSHA256 == "" || input.Ticket == "" { http.Error(w, "missing required field", http.StatusBadRequest) return } fp := fingerprint(input) s.mu.Lock() defer s.mu.Unlock() if prior, ok := s.saved[key]; ok { if prior.Fingerprint != fp { http.Error(w, "idempotency key reused with different input", http.StatusConflict) return } writeJSON(w, prior) return } expires := time.Now().UTC().Add(5 * time.Minute) saved := savedAuthorization{Fingerprint: fp, URL: s.signedURL(input, expires), ExpiresAt: expires} s.saved[key] = saved log.Printf("restore_authorized operator=%q tenant=%q object=%q version=%q ticket=%q", operator, input.TenantID, input.ObjectKey, input.ObjectVersion, input.Ticket) writeJSON(w, saved) } func writeJSON(w http.ResponseWriter, value any) { w.Header().Set("Content-Type", "application/json") if err := json.NewEncoder(w).Encode(value); err != nil { log.Printf("encode response: %v", err) } } func main() { secret := os.Getenv("SIGNING_SECRET") scheme := os.Getenv("OBJECT_SCHEME") host := os.Getenv("OBJECT_HOST") if secret == "" || scheme == "" || host == "" { log.Fatal("SIGNING_SECRET, OBJECT_SCHEME, and OBJECT_HOST are required") } s := &server{ saved: make(map[string]savedAuthorization), secret: []byte(secret), objectScheme: scheme, objectHost: host, } http.HandleFunc("/restore-authorizations", s.authorize) log.Fatal(http.ListenAndServe(":8080", nil)) } 

Run the example locally, then have the Node.js panel call it as an internal control-plane service. The environment variables must identify a development object endpoint; production configuration must supply the private object store's signer and host. This is a clean adapter boundary, not a fallback proxy.

SIGNING_SECRET=development-only OBJECT_SCHEME=http OBJECT_HOST=127.0.0.1:9000 go run main.go 

A production repository also needs a unique constraint on (tenant_id, idempotency_key) and a stored hash of the canonical request. In-memory deduplication disappears on restart and cannot coordinate replicas. The audit record should capture the operator subject, tenant, immutable object version, purpose or ticket, request fingerprint, authorization time, expiry, and outcome; it should not contain the signed query string because that string is a temporary bearer credential.

Exactly-once delivery is not available across a browser, object storage, a database, and a worker as one atomic transaction. The useful exactly-once mindset is narrower: make every externally repeated command converge on one durable state transition, reject semantic key reuse, and reconcile incomplete transitions. A transactional outbox can couple restore_verified with the database commit, while a periodic reconciler finds authorizations that expired without a verified result.

Verify before making restored media visible

Download into a quarantine path. Compute the digest while streaming, compare it with the digest stored in backup metadata, verify the byte count, parse only within resource limits, and then move or reference the object through an atomic application-level state change. If verification fails, preserve the prior active version and record a terminal integrity_failed result; don't retry a deterministic digest mismatch under the same object version.

This is where access control and delivery simplicity pull in opposite directions. A direct signed URL minimizes application involvement, yet any holder can use it until it expires, subject to the restrictions enforced by the storage service. Very sensitive restores may instead use a recovery worker in a controlled network, accepting more operational machinery in exchange for keeping the delegated URL and recovered bytes away from an operator's browser. Public clinical delivery, mutable object keys, and URLs with long expiries are not suitable for this design.

There is another catch: digest verification detects changed bytes, not a backup taken from an inconsistent application state. The backup producer must coordinate database and media references, assign immutable versions, and retain a manifest that binds tenant, object key, version, size, digest, and creation context. I'm not sure which retention period or authorization framework applies to your deployment; jurisdiction, data classification, contracts, and the system's authorization boundary determine that answer, and counsel plus the responsible security team must resolve it.

One bad assumption is enough.

Operate the recovery path as a ledger

Model the workflow as append-only facts with a derived current state: requested, authorized, download_started if observable, verified, activated, expired, or rejected. Do not overwrite the authorization row into a vague done flag. An auditor and an on-call engineer need to distinguish a URL that was issued from bytes that were verified and from a record that became active. Store timestamps in UTC, actor identifiers from the authentication layer, immutable object versions, and request fingerprints; avoid logging health content, signed credentials, or raw tokens.

Test retries on both sides of every boundary. Send the same idempotency key concurrently, reuse it with altered input and expect 409, expire a URL before use, truncate a download, change one byte, replay a completion event, and attempt a cross-tenant object version. Then run a restore drill that starts from the retained manifest and ends with domain validation, because a backup that has never been restored is an assertion rather than evidence. Measure authorization latency separately from storage transfer time, and alert on age of the oldest nonterminal authorization rather than treating every slow 32 GiB transfer as a control-plane incident.

Deployment should keep signing authority out of the public Node.js process where possible, rotate signing material through the platform's secret-management mechanism, and constrain the signer to the backup namespace. The simplest browser flow may be wrong when policy requires managed endpoints, malware inspection before access, dual authorization, or an evidence-preservation hold. In those cases, keep the same authorization ledger but route the transfer to a controlled recovery worker. You give up delivery simplicity, and you gain a narrower data path.

The final retention rule should name what is deliberately discarded: expired signed URLs, superseded temporary downloads, and backup versions beyond the approved schedule. It should also name the consequence. After deletion, later investigation and point-in-time recovery outside that window are impossible, so retention must be an explicit risk decision backed by legal requirements, recovery objectives, and tested restore evidence.

References