Skip to content

Commit 70b7e38

Browse files
fix(schema-validation): disable bucker region validation (#448)
1 parent 3efaede commit 70b7e38

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Diff for: manual_tests/client.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ let options = {};
77
const signature = process.env.SIGNATURE || null;
88
const policy = process.env.POLICY || null;
99
const cname = process.env.CNAME || null;
10-
const securityEnabled = process.env.SECURITY_ENABLED || false;
10+
const securityEnabled = process.env.SECURITY_ENABLED || (policy && signature) || false;
1111

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

14-
if (!signature || !policy) {
15-
throw new Error('Signature and Policy are always required')
16-
}
17-
1814
if (securityEnabled) {
15+
if (!signature || !policy) {
16+
throw new Error('Signature and Policy are always required')
17+
}
18+
1919
options.security = {
2020
signature,
2121
policy

Diff for: src/schema/definitions.schema.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ export const DefinitionsSchema = {
6262
regionsDef: {
6363
id: '/regionsDef',
6464
type: 'string',
65-
pattern: '^[a-zA-Z]{2}-[a-zA-z]{1,}-[1-9]$',
66-
errorMessage: 'AWS Region Param is in invalid format',
65+
// for now we decided to remove validation of regions (AWS + Rackspace)
66+
// pattern: '^[a-zA-Z]{2}-[a-zA-z]{1,}-[1-9]$',
67+
// errorMessage: 'AWS Region Param is in invalid format',
6768
},
6869
locationsDef: {
6970
id: '/locationsDef',

0 commit comments

Comments
 (0)