fix: validate url for Dashboard Apps [CW-2979] (#8736)

This commit is contained in:
Shivam Mishra
2024-01-18 17:48:30 +05:30
committed by GitHub
parent 5f6e17f307
commit e39c14460b
2 changed files with 32 additions and 1 deletions

View File

@@ -33,9 +33,12 @@ class DashboardApp < ApplicationRecord
'required' => %w[url type],
'properties' => {
'type' => { 'enum': ['frame'] },
'url' => { :type => 'string', 'format' => 'uri' }
'url' => { '$ref' => '#/definitions/saneUrl' }
}
},
'definitions' => {
'saneUrl' => { 'format' => 'uri', 'pattern' => '^https?://' }
},
'additionalProperties' => false,
'minItems' => 1
}