Validate key names when deleting directory with a configurable regex

This commit is contained in:
Simon Detheridge
2020-03-10 17:54:09 +00:00
parent 2509b51883
commit 28c3fe4a56
7 changed files with 144 additions and 32 deletions
@@ -39,6 +39,8 @@ settings =
apiEndpoint: process.env['GCS_API_ENDPOINT']
apiScheme: process.env['GCS_API_SCHEME']
projectId: process.env['GCS_PROJECT_ID']
# only keys that match this regex can be deleted
directoryKeyRegex: new RegExp(process.env['GCS_DIRECTORY_KEY_REGEX'] || "^[0-9a-fA-F]{24}/[0-9a-fA-F]{24}")
s3:
if process.env['AWS_ACCESS_KEY_ID']? or process.env['S3_BUCKET_CREDENTIALS']?