chore: use JWTs for signed download URLs instead of bespoke signatures

This commit is contained in:
Gareth
2025-12-21 14:14:22 -08:00
parent 2ca200a845
commit 99dc2c8297
13 changed files with 306 additions and 182 deletions
+1 -1
View File
@@ -458,7 +458,7 @@ const RestoreOperationStatus = ({ operation }: { operation: Operation }) => {
type="link"
onClick={() => {
backrestService
.getDownloadURL({ value: operation.id })
.getDownloadURL({ opId: operation.id!, filePath: "" })
.then((resp) => {
window.open(resp.value, "_blank");
})
+15 -14
View File
@@ -133,13 +133,19 @@ export const SnapshotBrowser = ({
path += "/";
}
const resp = await backrestService.listSnapshotFiles(
create(ListSnapshotFilesRequestSchema, {
path,
repoGuid,
snapshotId,
})
);
let resp: ListSnapshotFilesResponse;
try {
resp = await backrestService.listSnapshotFiles(
create(ListSnapshotFilesRequestSchema, {
path,
repoGuid,
snapshotId,
})
);
} catch (e: any) {
alertApi?.error("Failed to load snapshot files: " + e.message);
return;
}
setTreeData((treeData) => {
let toUpdate: DataNode | null = null;
@@ -234,15 +240,10 @@ const FileNode = ({
label: "Download",
onClick: () => {
backrestService
.getDownloadURL({ value: snapshotOpId })
.getDownloadURL({ opId: snapshotOpId!, filePath: entry.path! })
.then((resp) => {
const encodePathKeepSlashes = (p: string) =>
p
.split("/")
.map((seg) => encodeURIComponent(seg))
.join("/");
window.open(
resp.value + encodePathKeepSlashes(entry.path!),
resp.value,
"_blank"
);
})