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

Feat/Refresh s3 links in projects and issues #3165

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from

Conversation

daniel-alba17
Copy link

🎯 Milestone

Refresh s3 links in issue body and project cover if bucket is private

🛠 Changes

  • Create a new class for S3 actions (upload, delete, referesh url)
  • Create method for verify if a link is a S3 link
  • Create method for verify if a S3 link has expired
  • Create method to parse html to html object
  • Create class in serialzers for update S3 links
  • Add AWS_S3_BUCKET_AUTH, AWS_S3_MAX_AGE_SECONDS and AWS_S3_SIGNATURE_VERSION in settings.common file

daniel added 26 commits December 7, 2023 16:57
… and AWS_S3_MAX_AGE_SECONDS to config file
@pablohashescobar
Copy link
Collaborator

@daniel-alba17, thanks for creating the PR we will review this and get back.

@CLAassistant
Copy link

CLAassistant commented Feb 8, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ daniel-alba17
❌ daniel


daniel seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@vansergen vansergen left a comment

Choose a reason for hiding this comment

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

What about this one?

s3 = boto3.client(
"s3",
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
)
params = {
"Bucket": settings.AWS_STORAGE_BUCKET_NAME,
"Prefix": "static/project-cover/",
}
response = s3.list_objects_v2(**params)

Something should be done with the following errors too

An error occurred (InvalidAccessKeyId) when calling the ListObjectsV2 operation: The AWS Access Key Id you provided does not exist in our records.
GET - /api/project-covers/ of Queries: 1
Internal Server Error: /api/project-covers/
172.22.1.1:32020 - "GET /api/project-covers/ HTTP/1.1" 500

@vansergen
Copy link

There is a new issue #4248 about that last error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants