Skip to content

Commit

Permalink
fix(schema-validation): disable bucker region validation (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-wec committed Jul 28, 2021
1 parent 3efaede commit 70b7e38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions manual_tests/client.js
Expand Up @@ -7,15 +7,15 @@ let options = {};
const signature = process.env.SIGNATURE || null;
const policy = process.env.POLICY || null;
const cname = process.env.CNAME || null;
const securityEnabled = process.env.SECURITY_ENABLED || false;
const securityEnabled = process.env.SECURITY_ENABLED || (policy && signature) || false;

console.info(`FILESTACK-JS VERSION::::::: ${filestack.version}`)

if (!signature || !policy) {
throw new Error('Signature and Policy are always required')
}

if (securityEnabled) {
if (!signature || !policy) {
throw new Error('Signature and Policy are always required')
}

options.security = {
signature,
policy
Expand Down
5 changes: 3 additions & 2 deletions src/schema/definitions.schema.ts
Expand Up @@ -62,8 +62,9 @@ export const DefinitionsSchema = {
regionsDef: {
id: '/regionsDef',
type: 'string',
pattern: '^[a-zA-Z]{2}-[a-zA-z]{1,}-[1-9]$',
errorMessage: 'AWS Region Param is in invalid format',
// for now we decided to remove validation of regions (AWS + Rackspace)
// pattern: '^[a-zA-Z]{2}-[a-zA-z]{1,}-[1-9]$',
// errorMessage: 'AWS Region Param is in invalid format',
},
locationsDef: {
id: '/locationsDef',
Expand Down

0 comments on commit 70b7e38

Please sign in to comment.