Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow S3 object ACL to be toggled when a shortlink is activated/deactivated #63

Merged
merged 13 commits into from
May 7, 2020

Conversation

yong-jie
Copy link
Member

@yong-jie yong-jie commented May 5, 2020

Problem

We need a way to toggle the visibility of the s3 object. This is because our bucket defaults to private. After a short link has been reserved and the file has been uploaded to S3, the client will need to call the edit-url-state endpoint once to trigger this hook, setting the s3 object to visible.

Solution

Use a hook in the active/inactive edit API endpoint to also toggle the visibility of the S3 object, if the url has isFile set to true

@yong-jie yong-jie requested review from liangyuanruo and kylerwsm May 5, 2020 05:38
src/server/api/user.ts Outdated Show resolved Hide resolved
src/server/util/aws.ts Outdated Show resolved Hide resolved
src/server/util/aws.ts Outdated Show resolved Hide resolved
src/server/api/user.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@liangyuanruo liangyuanruo left a comment

Choose a reason for hiding this comment

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

as requested

@yong-jie yong-jie requested a review from liangyuanruo May 6, 2020 03:43
@yong-jie yong-jie marked this pull request as draft May 6, 2020 06:10
@yong-jie
Copy link
Member Author

yong-jie commented May 6, 2020

sry this PR doesnt work properly on staging, will convert to draft first to fix

@yong-jie yong-jie marked this pull request as ready for review May 6, 2020 06:49
@yong-jie
Copy link
Member Author

yong-jie commented May 6, 2020

Changes requested have been made. Issues that surfaced during a test on staging have also been fixed, making this PR ready for review.

@yong-jie yong-jie merged commit 6294105 into develop May 7, 2020
@yong-jie yong-jie deleted the toggle-acl-hooks branch May 7, 2020 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants