Skip to content

Commit

Permalink
web/satellite: fix access grants used for sharing objects and buckets
Browse files Browse the repository at this point in the history
Fix access grants used for linksharing.
Allow only List and Download.

Change-Id: I6123eb63af1ebefa0d771505632250c1c098a3b3
  • Loading branch information
VitaliiShpital authored and andriikotko committed Sep 1, 2022
1 parent 7933e0c commit 9c5e2fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions web/satellite/src/components/modals/ShareBucketModal.vue
Expand Up @@ -125,9 +125,9 @@ export default class ShareBucketModal extends Vue {
this.worker.postMessage({
'type': 'RestrictGrant',
'isDownload': true,
'isUpload': true,
'isUpload': false,
'isList': true,
'isDelete': true,
'isDelete': false,
'paths': [path],
'grant': grantData.value,
});
Expand Down
10 changes: 5 additions & 5 deletions web/satellite/src/components/objects/UploadFile.vue
Expand Up @@ -122,7 +122,7 @@ export default class UploadFile extends Vue {
const cleanAPIKey: AccessGrant = await this.$store.dispatch(ACCESS_GRANTS_ACTIONS.CREATE, LINK_SHARING_AG_NAME);
try {
const credentials: EdgeCredentials = await this.generateCredentials(cleanAPIKey.secret, path, true);
const credentials: EdgeCredentials = await this.generateShareCredentials(cleanAPIKey.secret, path, true);
path = encodeURIComponent(path.trim());
Expand Down Expand Up @@ -211,9 +211,9 @@ export default class UploadFile extends Vue {
}
/**
* Generates gateway credentials.
* Generates share gateway credentials.
*/
private async generateCredentials(cleanApiKey: string, path: string, isPublic: boolean): Promise<EdgeCredentials> {
private async generateShareCredentials(cleanApiKey: string, path: string, isPublic: boolean): Promise<EdgeCredentials> {
const satelliteNodeURL = MetaUtils.getMetaContent('satellite-nodeurl');
this.worker.postMessage({
Expand All @@ -235,9 +235,9 @@ export default class UploadFile extends Vue {
this.worker.postMessage({
'type': 'RestrictGrant',
'isDownload': true,
'isUpload': true,
'isUpload': false,
'isList': true,
'isDelete': true,
'isDelete': false,
'paths': [path],
'grant': grantData.value,
});
Expand Down

1 comment on commit 9c5e2fd

@storjrobot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Storj Community Forum (official). There might be relevant details there:

https://forum.storj.io/t/release-preparation-v1-63/19558/1

Please sign in to comment.