ManagedBackupDownloadTrait
Shared guarded-download plumbing for managed (platform-recorded) backups.
Used by both the Platform Admin controllers and the tenant self-service Backups controller so archive/recovery-key downloads behave identically regardless of who requests them.
Table of Contents
Methods
- assertUsableBackup() : void
- Validate completed encrypted backup metadata before a guarded action.
- exportTenantBackupRecoveryKey() : array{filename: string, content: string}
- Export a tenant backup recovery-key package.
- recoveryKeyDownloadResponse() : Response
- Return a recovery-key attachment that browsers and intermediary caches must not retain.
- stageBackupDownload() : array{path: string, filename: string}
- Stage and verify a backup for a streaming file response.
Methods
assertUsableBackup()
Validate completed encrypted backup metadata before a guarded action.
protected
assertUsableBackup(array<string, mixed> $backup[, array<int, string> $allowedTypes = [TenantBackupService::BACKUP_TYPE, 'pg_dump'] ]) : void
Parameters
- $backup : array<string, mixed>
- $allowedTypes : array<int, string> = [TenantBackupService::BACKUP_TYPE, 'pg_dump']
exportTenantBackupRecoveryKey()
Export a tenant backup recovery-key package.
protected
exportTenantBackupRecoveryKey(array<string, mixed> $backup, array<string, mixed> $tenant) : array{filename: string, content: string}
Parameters
- $backup : array<string, mixed>
-
Backup metadata row
- $tenant : array<string, mixed>
-
Tenant metadata row
Return values
array{filename: string, content: string}recoveryKeyDownloadResponse()
Return a recovery-key attachment that browsers and intermediary caches must not retain.
protected
recoveryKeyDownloadResponse(array{filename: string, content: string} $export) : Response
Parameters
- $export : array{filename: string, content: string}
-
Recovery-key export
Return values
ResponsestageBackupDownload()
Stage and verify a backup for a streaming file response.
protected
stageBackupDownload(array<string, mixed> $backup, BackupArchiveStorageInterface $storage, string $filenamePrefix) : array{path: string, filename: string}
Parameters
- $backup : array<string, mixed>
- $storage : BackupArchiveStorageInterface
- $filenamePrefix : string