Skip to content

Commit

Permalink
Validation changes for job file
Browse files Browse the repository at this point in the history
Allow intermediary '/' & '-' in auth route
Allow intermediary '-' in relationships id of type appScanner
Allow intermediary '-' & '/' in relationships id of type route
Allow intermediary '-' in id of type appScanner resource object
Allow intermediary '-' & '/' in id of type route resource object
  • Loading branch information
binarymist committed Sep 9, 2021
1 parent a504be3 commit dcf9d21
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api/orchestration/schemas/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const schema = {
type: 'object',
additionalProperties: false,
properties: {
route: { type: 'string', pattern: '^/\\w{1,200}$' },
route: { type: 'string', pattern: '^/[-\\w/]{1,200}$' },
usernameFieldLocater: { type: 'string', pattern: '^[a-zA-Z0-9_-]{1,100}$' }, // Possibly allow spaces for css selectors.
passwordFieldLocater: { type: 'string', pattern: '^[a-zA-Z0-9_-]{1,100}$' }, // Possibly allow spaces for css selectors.
submit: { type: 'string', pattern: '^[a-zA-Z0-9_\\-\\s]{1,100}$' },
Expand Down Expand Up @@ -140,10 +140,10 @@ const schema = {
then: { properties: { id: { type: 'string', pattern: 'NA' } } },
else: {
if: { properties: { type: { enum: ['appScanner'] } } },
then: { properties: { id: { type: 'string', pattern: '^\\w{1,200}$' } } },
then: { properties: { id: { type: 'string', pattern: '^\\w[-\\w]{1,200}$' } } },
else: {
if: { properties: { type: { enum: ['route'] } } },
then: { properties: { id: { type: 'string', pattern: '^/\\w{1,200}$' } } }
then: { properties: { id: { type: 'string', pattern: '^/[-\\w/]{1,200}$' } } }
}
},
title: 'ResourceLinkage'
Expand Down Expand Up @@ -174,7 +174,7 @@ const schema = {
if: { properties: { type: { enum: ['appScanner'] } } },
then: {
properties: {
id: { type: 'string', pattern: '^\\w{1,200}$' },
id: { type: 'string', pattern: '^\\w[-\\w]{1,200}$' },
attributes: { $ref: '#/definitions/AttributesObjOfTopLevelResourceObjectOfTypeAppScanner' },
relationships: { $ref: '#/definitions/Relationships' }
},
Expand All @@ -184,7 +184,7 @@ const schema = {
if: { properties: { type: { enum: ['route'] } } },
then: {
properties: {
id: { type: 'string', pattern: '^/\\w{1,200}$' },
id: { type: 'string', pattern: '^/[-\\w/]{1,200}$' },
attributes: { $ref: '#/definitions/AttributesObjOfTopLevelResourceObjectOfTypeRoute' }
}
}
Expand Down

0 comments on commit dcf9d21

Please sign in to comment.