Verified Commit 3e20a322 authored by p.jbowden's avatar p.jbowden
Browse files

add keyid to asclepiosPath

and standardize on useage of "filename" vs "path"
parent 2c87a59c
Pipeline #254602 passed with stage
in 45 seconds
......@@ -16,9 +16,9 @@ function createResult(data) {
result.removeAttribute('id');
result.classList.remove('is-hidden');
let filename = data.filename.substring(data.filename.lastIndexOf('/') + 1)
let fileName = data.asclepiosPath.substring(data.asclepiosPath.lastIndexOf('/') + 1)
let title = result.querySelector('.result-title');
title.textContent = `${data.type}: ${filename}`;
title.textContent = `${data.type}: ${fileName}`;
let modal = result.querySelector(`.metadata-modal`);
......@@ -100,7 +100,7 @@ async function initSingletonWidget() {
let urlParams = new URLSearchParams(window.location.search);
if (!urlParams.has('filename')) return;
if (!urlParams.has('asclepiosPath')) return;
if (!urlParams.has('keyid')) return;
let { verKey, encKey } = await getSSEkeys(
......@@ -110,7 +110,7 @@ async function initSingletonWidget() {
)
let response = await search(
{'keyword': [`filename|${urlParams.get('filename')}`]},
{'keyword': [`asclepiosPath|${urlParams.get('asclepiosPath')}`]},
verKey, encKey, urlParams.get('keyid'),
true, false,
keycloak.token
......@@ -156,7 +156,7 @@ async function initDownloadWidget() {
let downloadWidget = document.querySelector('#download-widget');
if (!urlParams.has('filename')) return;
if (!urlParams.has('asclepiosPath')) return;
if (!urlParams.has('keyid')) return;
downloadWidget.classList.remove('is-hidden');
......@@ -167,9 +167,9 @@ async function initDownloadWidget() {
keycloak.token
)
let buffer = await asmcrypto_downloadDecryptBuffer(urlParams.get('filename'), encKey, keycloak.token);
let buffer = await asmcrypto_downloadDecryptBuffer(urlParams.get('asclepiosPath'), encKey, keycloak.token);
let asclepiosPath = urlParams.get('filename');
let asclepiosPath = $urlParams.get('asclepiosPath');
let fileName = asclepiosPath.substring(asclepiosPath.lastIndexOf('/') + 1)
downloadFile(new Blob([buffer]), fileName)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment