Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Libupload path in docker files
- Fix hiding the pagination of data tables
- Fix shared objects functionality: visibility, deleting, editing tags
- URL does not strip the path, when that is present. Also small fixes to make it deployable under the same URL.

### Removed

Expand Down
14 changes: 8 additions & 6 deletions swift_browser_ui_frontend/src/common/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class DecryptedDownloadSession {
let reader = response.body.getReader();
this.reader = reader;
let { value: chunk, done: readerDone } = await this.reader.read();

this.chunk = chunk;
this.readerDone = readerDone;

Expand Down Expand Up @@ -165,7 +165,7 @@ export class DecryptedDownloadSession {
signatureUrl.searchParams.append("path", headerPath);
signed = await GET(signatureUrl);
signed = await signed.json();
let headerUrl = new URL(headerPath, this.endpoint);
let headerUrl = new URL(this.endpoint.concat(headerPath));
headerUrl.searchParams.append("valid", signed.valid);
headerUrl.searchParams.append("signature", signed.signature);
headerUrl.searchParams.append(
Expand All @@ -185,14 +185,14 @@ export class DecryptedDownloadSession {
initServiceWorker() {
navigator.serviceWorker.addEventListener("message", (e) => {
e.stopImmediatePropagation();
switch(e.data.eventType) {
switch (e.data.eventType) {
case "downloadSessionOpened":
this.object = this.objects.pop();
this.currentFinished = false;
if (this.object == undefined) {
this.finished = true;
}
this.getHeader(e.data.pubKey).then(() => {});
this.getHeader(e.data.pubKey).then(() => { });
break;
case "beginDecryption":
window.open(new URL("/file", document.location.origin), "_blank");
Expand All @@ -203,15 +203,17 @@ export class DecryptedDownloadSession {
});
break;
case "nextDecryptChunk":
this.getSlice().then(() => {});
this.getSlice().then(() => { });
break;
case "streamClosed":
(async () => {
let signatureUrl = new URL(`/sign/${60}`, document.location.origin);
signatureUrl.searchParams.append("path", this.whitelistPath);
let signed = await GET(signatureUrl);
signed = await signed.json();
let whitelistUrl = new URL(this.whitelistPath, this.endpoint);
let whitelistUrl = new URL(
this.endpoint.concat(this.whitelistPath),
);
whitelistUrl.searchParams.append("valid", signed.valid);
whitelistUrl.searchParams.append("signature", signed.signature);
await DELETE(whitelistUrl);
Expand Down
21 changes: 11 additions & 10 deletions swift_browser_ui_frontend/src/common/swift_sharing_request_bind.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Swift cross account container sharing API JavaScript bindings module.


import {
import {
GET,
} from "@/common/api";

Expand Down Expand Up @@ -39,8 +39,9 @@ class SwiftSharingRequest {
owner,
) {
// Add a request for container access.
let url = new URL("/request/user/".concat(username, "/", container),
this.address);
let url = new URL(this.address.concat("/request/user/",
username,
"/", container));
url.searchParams.append("owner", owner);

let signed = await this._getSignature(
Expand All @@ -62,8 +63,8 @@ class SwiftSharingRequest {
async listMadeRequests(
username,
) {
let url = new URL("/request/user/".concat(username),
this.address);
let url = new URL(this.address.concat("/request/user/", username),
);

let signed = await this._getSignature(
60,
Expand All @@ -83,8 +84,8 @@ class SwiftSharingRequest {
async listOwnedRequests(
username,
) {
let url = new URL("/request/owner/".concat(username),
this.address);
let url = new URL(this.address.concat("/request/owner/", username),
);

let signed = await this._getSignature(
60,
Expand All @@ -104,8 +105,8 @@ class SwiftSharingRequest {
async listContainerRequests(
container,
) {
let url = new URL("/request/container/".concat(container),
this.address);
let url = new URL(this.address.concat("/request/container/", container),
);

let signed = await this._getSignature(
60,
Expand All @@ -129,7 +130,7 @@ class SwiftSharingRequest {
) {
// Delete the details of an existing share action.
let url = new URL(
"/request/user/".concat(username, "/", container), this.address,
this.address.concat("/request/user/", username, "/", container),
);
url.searchParams.append("owner", owner);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SwiftXAccountSharing {
username,
) {
// List the containers the user has been given access to.
let url = new URL("/access/".concat(username), this.address);
let url = new URL(this.address.concat("/access/", username));

let signed = await this._getSignature(
60,
Expand All @@ -71,7 +71,7 @@ class SwiftXAccountSharing {
) {
// Get details from a container the user has been given access to.
let url = new URL(
"/access/".concat(username, "/", container), this.address,
this.address.concat("/access/", username, "/", container),
);

let signed = await this._getSignature(
Expand All @@ -94,7 +94,7 @@ class SwiftXAccountSharing {
username,
) {
// List the containers the user has shared to another user / users.
let url = new URL("/share/".concat(username), this.address);
let url = new URL(this.address.concat("/share/", username));

let signed = await this._getSignature(
60,
Expand All @@ -117,7 +117,7 @@ class SwiftXAccountSharing {
) {
// Get details from a container the user has given access to.
let url = new URL(
"/share/".concat(username, "/", container), this.address,
this.address.concat("/share/", username, "/", container),
);

let signed = await this._getSignature(
Expand All @@ -144,7 +144,7 @@ class SwiftXAccountSharing {
) {
// Upload details about a new share action.
let url = new URL(
"/share/".concat(username, "/", container), this.address,
this.address.concat("/share/", username, "/", container),
);
url.searchParams.append("user", this._parseListString(userlist));
url.searchParams.append("access", this._parseListString(accesslist));
Expand Down Expand Up @@ -173,7 +173,7 @@ class SwiftXAccountSharing {
) {
// Edit the details of an existing share action.
let url = new URL(
"/share/".concat(username, "/", container), this.address,
this.address.concat("/share/", username, "/", container),
);
url.searchParams.append("user", this._parseListString(userlist));
url.searchParams.append("access", this._parseListString(accesslist));
Expand All @@ -200,7 +200,7 @@ class SwiftXAccountSharing {
) {
// Delete the details of an existing share action.
let url = new URL(
"/share/".concat(username, "/", container), this.address,
this.address.concat("/share/", username, "/", container),
);

let signed = await this._getSignature(
Expand Down Expand Up @@ -228,7 +228,7 @@ class SwiftXAccountSharing {
) {
// Delete all shares on a container
let url = new URL(
"/share/".concat(username, "/", container), this.address,
this.address.concat("/share/", username, "/", container),
);

let signed = await this._getSignature(
Expand Down
11 changes: 5 additions & 6 deletions swift_browser_ui_frontend/src/entries/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ if ("serviceWorker" in navigator) {
if(DEV) console.log(err);
});
} else {
if(DEV) console.log("Did not register Service Worker.");
if (DEV) console.log("Did not register Service Worker.");
}

window.onerror = function(error) {
if(DEV) console.log("Global error", error);
window.onerror = function (error) {
if (DEV) console.log("Global error", error);
};
window.addEventListener("unhandledrejection", function (event) {
if (DEV) console.log("unhandledrejection", event);
Expand Down Expand Up @@ -217,7 +217,7 @@ new Vue({
get() {
return this.$store.state.openShareModal;
},
set() {},
set() { },
},
},
watch: {
Expand Down Expand Up @@ -347,8 +347,7 @@ new Vue({
let signed = await GET(signatureUrl);
signed = await signed.json();
let keyURL = new URL(
keyPath,
discovery.upload_endpoint,
discovery.upload_endpoint.concat(keyPath),
);
keyURL.searchParams.append("valid", signed.valid);
keyURL.searchParams.append("signature", signed.signature);
Expand Down