Skip to content

Commit

Permalink
fix input validation for s3; add aws creds in env
Browse files Browse the repository at this point in the history
  • Loading branch information
jblom committed Aug 26, 2024
1 parent 55e5346 commit 41ca4f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ S3_ENDPOINT_URL=https://some_url

# default bucket and subdir
S3_BUCKET=x-omg-daan-av
S3_FOLDER_IN_BUCKET=assets
S3_FOLDER_IN_BUCKET=assets

# your AWS credentials for the S3 bucket in question
AWS_ACCESS_KEY_ID=your-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
5 changes: 4 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
assert s3_folder_in_bucket, "Please enter a path within the supplied S3 bucket"

if audio_sample_url:
assert validators.url(audio_sample_url), "Please provide a valid AUDIO_SAMPLE_URL"
if audio_sample_url[0:5] != "s3://":
assert validators.url(
audio_sample_url
), "Please provide a valid AUDIO_SAMPLE_URL"

0 comments on commit 41ca4f5

Please sign in to comment.