Skip to content

Commit

Permalink
SHIBUI-1020 Fixed schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Nov 28, 2018
1 parent fd0b93b commit cec26af
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,35 @@
"@type",
"content"
],
"anyOf": [
{
"properties": {
"@type": {
"enum": [
"Regex"
]
}
},
"required": [
"@type",
"content",
"match"
]
},
{
"properties": {
"@type": {
"enum": [
"MetadataQueryProtocol"
]
}
},
"required": [
"@type",
"content"
]
}
],
"properties": {
"@type": {
"title": "label.md-request-type",
Expand All @@ -40,12 +69,6 @@
],
"description": "value.md-query-protocol"
},
{
"enum": [
"Template"
],
"description": "value.template"
},
{
"enum": [
"Regex"
Expand All @@ -59,58 +82,6 @@
"description": "tooltip.md-request-value",
"type": "string"
},
"transformRef": {
"title": "label.transform-ref",
"description": "tooltip.transform-ref",
"type": "string",
"widget": "hidden"
},
"encodingStyle": {
"title": "label.encoding-style",
"description": "tooltip.encoding-style",
"type": "string",
"widget": {
"id": "select"
},
"default": "FORM",
"oneOf": [
{
"enum": [
"NONE"
],
"description": "None"
},
{
"enum": [
"FORM"
],
"description": "Form"
},
{
"enum": [
"PATH"
],
"description": "Path"
},
{
"enum": [
"FRAGMENT"
],
"description": "Fragment"
}
],
"visibleIf": {
"@type": [
"Template"
]
}
},
"velocityEngine": {
"title": "label.velocity-engine",
"description": "tooltip.velocity-engine",
"type": "string",
"widget": "hidden"
},
"match": {
"title": "label.match",
"description": "tooltip.match",
Expand Down Expand Up @@ -634,7 +605,6 @@
"title": "label.certificate-file",
"description": "tooltip.certificate-file",
"type": "string",
"widget": "textarea",
"default": ""
}
},
Expand Down
16 changes: 1 addition & 15 deletions ui/src/app/metadata/provider/model/dynamic-http.provider.form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,7 @@ export const DynamicHttpMetadataProviderWizard: Wizard<DynamicHttpMetadataProvid
...BaseMetadataProviderEditor,
label: 'DynamicHttpMetadataProvider',
type: 'DynamicHttpMetadataResolver',
bindings: {
'/metadataRequestURLConstructionScheme/@type': [
{
'input': (event, property: FormProperty) => {
let transform = property.parent.getProperty('transformRef');
let content = property.parent.getProperty('content');
if (!content.value && property.value !== 'Regex') {
transform.setVisible(true);
} else {
transform.setVisible(false);
}
}
}
]
},
bindings: {},
getValidators(namesList: string[] = [], xmlIdList: string[] = []): any {
const validators = BaseMetadataProviderEditor.getValidators(namesList);
validators['/xmlId'] = (value, property, form) => {
Expand Down
114 changes: 37 additions & 77 deletions ui/src/assets/schema/provider/dynamic-http.schema.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"type": "object",
"order": [
"xmlId",
"metadataURL"
],
"required": [
"xmlId",
"metadataURL"
"metadataURL",
"metadataRequestURLConstructionScheme"
],
"properties": {
"enabled": {
Expand All @@ -23,9 +20,40 @@
"minLength": 1
},
"metadataRequestURLConstructionScheme": {
"title": "label.md-request-url-construction-schema",
"description": "tooltip.md-request-url-construction-schema",
"type": "object",
"required": [
"@type",
"content"
],
"anyOf": [
{
"properties": {
"@type": {
"enum": [
"Regex"
]
}
},
"required": [
"@type",
"content",
"match"
]
},
{
"properties": {
"@type": {
"enum": [
"MetadataQueryProtocol"
]
}
},
"required": [
"@type",
"content"
]
}
],
"properties": {
"@type": {
"title": "label.md-request-type",
Expand All @@ -41,12 +69,6 @@
],
"description": "value.md-query-protocol"
},
{
"enum": [
"Template"
],
"description": "value.template"
},
{
"enum": [
"Regex"
Expand All @@ -56,71 +78,10 @@
]
},
"content": {
"title": "label.value",
"description": "tooltip.md-request-url-construction-scheme-value",
"title": "label.md-request-value",
"description": "tooltip.md-request-value",
"type": "string"
},
"transformRef": {
"title": "label.transform-ref",
"description": "tooltip.transform-ref",
"type": "string",
"visibleIf": {
"content": [
""
]
}
},
"encodingStyle": {
"title": "label.encoding-style",
"description": "tooltip.encoding-style",
"type": "string",
"widget": {
"id": "select"
},
"default": "FORM",
"oneOf": [
{
"enum": [
"NONE"
],
"description": "None"
},
{
"enum": [
"FORM"
],
"description": "Form"
},
{
"enum": [
"PATH"
],
"description": "Path"
},
{
"enum": [
"FRAGMENT"
],
"description": "Fragment"
}
],
"visibleIf": {
"@type": [
"Template"
]
}
},
"velocityEngine": {
"title": "label.velocity-engine",
"description": "tooltip.velocity-engine",
"type": "string",
"default": "shibboleth.VelocityEngine",
"visibleIf": {
"@type": [
"Template"
]
}
},
"match": {
"title": "label.match",
"description": "tooltip.match",
Expand Down Expand Up @@ -644,7 +605,6 @@
"title": "label.certificate-file",
"description": "tooltip.certificate-file",
"type": "string",
"widget": "textarea",
"default": ""
}
},
Expand Down

0 comments on commit cec26af

Please sign in to comment.