diff --git a/backend/src/main/resources/dynamic-http-metadata-provider.schema.json b/backend/src/main/resources/dynamic-http-metadata-provider.schema.json index 109e09202..f9dec02b8 100644 --- a/backend/src/main/resources/dynamic-http-metadata-provider.schema.json +++ b/backend/src/main/resources/dynamic-http-metadata-provider.schema.json @@ -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", @@ -40,12 +69,6 @@ ], "description": "value.md-query-protocol" }, - { - "enum": [ - "Template" - ], - "description": "value.template" - }, { "enum": [ "Regex" @@ -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", @@ -634,7 +605,6 @@ "title": "label.certificate-file", "description": "tooltip.certificate-file", "type": "string", - "widget": "textarea", "default": "" } }, diff --git a/ui/src/app/metadata/provider/model/dynamic-http.provider.form.ts b/ui/src/app/metadata/provider/model/dynamic-http.provider.form.ts index 1692d8f36..7f38d02e3 100644 --- a/ui/src/app/metadata/provider/model/dynamic-http.provider.form.ts +++ b/ui/src/app/metadata/provider/model/dynamic-http.provider.form.ts @@ -11,21 +11,7 @@ export const DynamicHttpMetadataProviderWizard: Wizard { - 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) => { diff --git a/ui/src/assets/schema/provider/dynamic-http.schema.json b/ui/src/assets/schema/provider/dynamic-http.schema.json index 9de6996de..f9dec02b8 100644 --- a/ui/src/assets/schema/provider/dynamic-http.schema.json +++ b/ui/src/assets/schema/provider/dynamic-http.schema.json @@ -1,12 +1,9 @@ { "type": "object", - "order": [ - "xmlId", - "metadataURL" - ], "required": [ "xmlId", - "metadataURL" + "metadataURL", + "metadataRequestURLConstructionScheme" ], "properties": { "enabled": { @@ -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", @@ -41,12 +69,6 @@ ], "description": "value.md-query-protocol" }, - { - "enum": [ - "Template" - ], - "description": "value.template" - }, { "enum": [ "Regex" @@ -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", @@ -644,7 +605,6 @@ "title": "label.certificate-file", "description": "tooltip.certificate-file", "type": "string", - "widget": "textarea", "default": "" } },