From 252a954b8f50b759a04f4bb5e0f206db20549010 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 17 May 2021 11:03:26 -0700 Subject: [PATCH] Updated schema files for react --- ...tadataSourcesUiDefinitionController.groovy | 2 +- .../service/JsonSchemaBuilderService.groovy | 8 +- ...dynamic-http-metadata-provider.schema.json | 425 ++++++------------ .../file-system-metadata-provider.schema.json | 71 +-- ...ebacked-http-metadata-provider.schema.json | 355 +++------------ .../main/resources/i18n/messages.properties | 2 +- ...ocal-dynamic-metadata-provider.schema.json | 107 +---- .../resources/metadata-sources-ui-schema.json | 140 ++---- 8 files changed, 238 insertions(+), 872 deletions(-) diff --git a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy index 6fa503fcc..bf685db05 100644 --- a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy +++ b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy @@ -46,7 +46,7 @@ class MetadataSourcesUiDefinitionController { try { def parsedJson = jacksonObjectMapper.readValue(this.jsonSchemaLocation.url, Map) jsonSchemaBuilderService.hideServiceEnabledFromNonAdmins(parsedJson) - jsonSchemaBuilderService.addReleaseAttributesToJson(parsedJson['properties']['attributeRelease']['widget']) + jsonSchemaBuilderService.addReleaseAttributesToJson(parsedJson['properties']['attributeRelease']['items']) jsonSchemaBuilderService.addRelyingPartyOverridesToJson(parsedJson['properties']['relyingPartyOverrides']) jsonSchemaBuilderService.addRelyingPartyOverridesCollectionDefinitionsToJson(parsedJson["definitions"]) return ResponseEntity.ok(parsedJson) diff --git a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy index ab3ae6fda..aa9f123da 100644 --- a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy +++ b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy @@ -20,8 +20,8 @@ class JsonSchemaBuilderService { } void addReleaseAttributesToJson(Object json) { - json['data'] = customPropertiesConfiguration.getAttributes().collect { - [key: it['name'], label: it['displayName']] + json['enum'] = customPropertiesConfiguration.getAttributes().collect { + it['name'] } } @@ -64,7 +64,7 @@ class JsonSchemaBuilderService { def items = [type : 'string', minLength: 1, // TODO: should this be configurable? maxLength: 255] //TODO: or this? - items.widget = [id: 'datalist', data: it['defaultValues']] + items.examples = it['defaultValues'] definition['items'] = items json[(String) it['name']] = definition @@ -76,7 +76,7 @@ class JsonSchemaBuilderService { if (currentUser != null && currentUser.role != 'ROLE_ADMIN') { // user isn't an admin, so hide 'ServiceEnabled' Map serviceEnabled = (HashMap) json['properties']['serviceEnabled'] - serviceEnabled['widget'] = 'hidden' + serviceEnabled['readOnly'] = true serviceEnabled.remove('title') serviceEnabled.remove('description') } 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 035e8d4e0..f4f96fe4b 100644 --- a/backend/src/main/resources/dynamic-http-metadata-provider.schema.json +++ b/backend/src/main/resources/dynamic-http-metadata-provider.schema.json @@ -10,30 +10,13 @@ "name": { "title": "label.metadata-provider-name-dashboard-display-only", "description": "tooltip.metadata-provider-name-dashboard-display-only", - "type": "string", - "widget": { - "id": "string", - "help": "message.must-be-unique" - } + "type": "string" }, "@type": { "title": "label.metadata-provider-type", "description": "tooltip.metadata-provider-type", - "placeholder": "label.select-metadata-type", "type": "string", - "readOnly": true, - "widget": { - "id": "select", - "disabled": true - }, - "oneOf": [ - { - "enum": [ - "DynamicHttpMetadataResolver" - ], - "description": "value.dynamic-http-metadata-provider" - } - ] + "const": "DynamicHttpMetadataResolver" }, "enabled": { "title": "label.enable-provider-upon-saving", @@ -53,6 +36,48 @@ "@type", "content" ], + "dependencies": { + "@type": { + "oneOf": [ + { + "properties": { + "@type": { + "enum": [ + "Regex" + ] + }, + "match": { + "title": "label.match", + "description": "tooltip.match", + "type": "string", + "widget": { + "id": "string", + "required": true + } + } + }, + "required": [ + "@type", + "content", + "match" + ] + }, + { + "properties": { + "@type": { + "enum": [ + "MetadataQueryProtocol" + ] + } + }, + "required": [ + "@type", + "content" + ] + } + ] + } + }, "properties": { "@type": { "title": "label.md-request-type", @@ -61,99 +86,62 @@ "widget": { "id": "select" }, - "oneOf": [ - { - "enum": [ - "MetadataQueryProtocol" - ], - "description": "value.md-query-protocol" - }, - { - "enum": [ - "Regex" - ], - "description": "value.regex" - } + "enum": [ + "MetadataQueryProtocol", + "Regex" ] }, "content": { "title": "label.md-request-value", "description": "tooltip.md-request-value", "type": "string" - }, - "match": { - "title": "label.match", - "description": "tooltip.match", - "type": "string", - "widget": { - "id": "string", - "required": true - }, - "visibleIf": { - "@type": [ - "Regex" - ] - } } } }, "requireValidMetadata": { "title": "label.require-valid-metadata", "description": "tooltip.require-valid-metadata", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "failFastInitialization": { "title": "label.fail-fast-init", "description": "tooltip.fail-fast-init", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "dynamicMetadataResolverAttributes": { "type": "object", + "dependencies": { + "initializeFromPersistentCacheInBackground": { + "oneOf": [ + { + "properties": { + "initializeFromPersistentCacheInBackground": { + "const": true + }, + "backgroundInitializationFromCacheDelay": { + "title": "label.background-init-from-cache-delay", + "description": "tooltip.background-init-from-cache-delay", + "type": "string", + "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" + } + } + }, + { + "properties": { + "initializeFromPersistentCacheInBackground": { + "const": false + } + } + } + ] + } + }, "properties": { "refreshDelayFactor": { "title": "label.refresh-delay-factor", "description": "tooltip.refresh-delay-factor", "type": "number", - "widget": { - "id": "float", - "help": "message.real-number", - "step": 0.01 - }, - "placeholder": "label.real-number", + "multipleOf": 0.01, "minimum": 0.001, "maximum": 0.999 }, @@ -161,106 +149,29 @@ "title": "label.min-cache-duration", "description": "tooltip.min-cache-duration", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "maxCacheDuration": { "title": "label.max-cache-duration", "description": "tooltip.max-cache-duration", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "maxIdleEntityData": { "title": "label.max-idle-entity-data", "description": "tooltip.max-idle-entity-data", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "removeIdleEntityData": { "title": "label.remove-idle-entity-data", "description": "tooltip.remove-idle-entity-data", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "cleanupTaskInterval": { "title": "label.cleanup-task-interval", "description": "tooltip.cleanup-task-interval", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "persistentCacheManagerDirectory": { @@ -272,50 +183,7 @@ "initializeFromPersistentCacheInBackground": { "title": "label.initialize-from-persistent-cache-in-background", "description": "tooltip.initialize-from-persistent-cache-in-background", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] - }, - "backgroundInitializationFromCacheDelay": { - "title": "label.background-init-from-cache-delay", - "description": "tooltip.background-init-from-cache-delay", - "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, - "visibleIf": { - "initializeFromPersistentCacheInBackground": [ - true - ] - }, - "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" + "type": "boolean" } } }, @@ -377,37 +245,18 @@ "disregardTLSCertificate": { "type": "boolean", "title": "label.disregard-tls-cert", - "description": "tooltip.disregard-tls-cert", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "True" - }, - { - "enum": [ - false - ], - "description": "False" - } - ] + "description": "tooltip.disregard-tls-cert" }, "httpClientRef": { "type": "string", "title": "", "description": "", - "placeholder": "", "widget": "hidden" }, "connectionRequestTimeout": { "type": "string", "title": "label.connection-request-timeout", "description": "tooltip.connection-request-timeout", - "placeholder": "label.duration", "widget": { "id": "datalist", "data": [ @@ -428,7 +277,6 @@ "type": "string", "title": "label.connection-timeout", "description": "tooltip.connection-timeout", - "placeholder": "label.duration", "widget": { "id": "datalist", "data": [ @@ -449,7 +297,6 @@ "type": "string", "title": "label.socket-timeout", "description": "tooltip.socket-timeout", - "placeholder": "label.duration", "widget": { "id": "datalist", "data": [ @@ -469,46 +316,37 @@ "tlsTrustEngineRef": { "type": "string", "title": "", - "description": "", - "placeholder": "", - "widget": "hidden" + "description": "" }, "httpClientSecurityParametersRef": { "type": "string", "title": "", - "description": "", - "placeholder": "", - "widget": "hidden" + "description": "" }, "proxyHost": { "type": "string", "title": "label.proxy-host", - "description": "tooltip.proxy-host", - "placeholder": "" + "description": "tooltip.proxy-host" }, "proxyPort": { "type": "string", "title": "label.proxy-port", - "description": "tooltip.proxy-port", - "placeholder": "" + "description": "tooltip.proxy-port" }, "proxyUser": { "type": "string", "title": "label.proxy-user", - "description": "tooltip.proxy-user", - "placeholder": "" + "description": "tooltip.proxy-user" }, "proxyPassword": { "type": "string", "title": "label.proxy-password", - "description": "tooltip.proxy-password", - "placeholder": "" + "description": "tooltip.proxy-password" }, "httpCaching": { "type": "string", "title": "label.http-caching", "description": "tooltip.http-caching", - "placeholder": "label.select-caching-type", "widget": { "id": "select" }, @@ -536,21 +374,18 @@ "httpCacheDirectory": { "type": "string", "title": "label.http-caching-directory", - "description": "tooltip.http-caching-directory", - "placeholder": "" + "description": "tooltip.http-caching-directory" }, "httpMaxCacheEntries": { "type": "integer", "title": "label.http-max-cache-entries", "description": "tooltip.http-max-cache-entries", - "placeholder": "", "minimum": 0 }, "httpMaxCacheEntrySize": { "type": "integer", "title": "label.max-cache-entry-size", "description": "tooltip.max-cache-entry-size", - "placeholder": "", "minimum": 0 } } @@ -560,7 +395,6 @@ "title": "", "description": "", "type": "array", - "additionalItems": true, "items": [ { "$id": "RequiredValidUntil", @@ -570,25 +404,14 @@ "id": "fieldset" }, "properties": { + "@type": { + "type": "string", + "default": "RequiredValidUntil" + }, "maxValidityInterval": { "title": "label.max-validity-interval", "description": "tooltip.max-validity-interval", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" } } @@ -601,6 +424,10 @@ "id": "fieldset" }, "properties": { + "@type": { + "type": "string", + "default": "SignatureValidation" + }, "requireSignedRoot": { "title": "label.require-signed-root", "description": "tooltip.require-signed-root", @@ -612,29 +439,29 @@ "type": "string" } }, - "anyOf": [ - { - "properties": { - "requireSignedRoot": { - "enum": [ - true + "dependencies": { + "requireSignedRoot": { + "oneOf": [ + { + "properties": { + "requireSignedRoot": { + "const": true + } + }, + "required": [ + "certificateFile" ] + }, + { + "properties": { + "requireSignedRoot": { + "const": false + } + } } - }, - "required": [ - "certificateFile" ] - }, - { - "properties": { - "requireSignedRoot": { - "enum": [ - false - ] - } - } } - ] + } }, { "$id": "EntityRoleWhiteList", @@ -644,6 +471,10 @@ "id": "fieldset" }, "properties": { + "@type": { + "type": "string", + "default": "EntityRoleWhiteList" + }, "retainedRoles": { "title": "label.retained-roles", "description": "tooltip.retained-roles", @@ -653,19 +484,13 @@ "id": "select" }, "type": "string", - "oneOf": [ - { - "enum": [ - "SPSSODescriptor" - ], - "description": "value.spdescriptor" - }, - { - "enum": [ - "AttributeAuthorityDescriptor" - ], - "description": "value.attr-auth-descriptor" - } + "enum": [ + "SPSSODescriptor", + "AttributeAuthorityDescriptor" + ], + "enumNames": [ + "value.spdescriptor", + "value.attr-auth-descriptor" ] } }, @@ -684,4 +509,4 @@ ] } } -} +} \ No newline at end of file diff --git a/backend/src/main/resources/file-system-metadata-provider.schema.json b/backend/src/main/resources/file-system-metadata-provider.schema.json index b7b2292d9..38d0d90e3 100644 --- a/backend/src/main/resources/file-system-metadata-provider.schema.json +++ b/backend/src/main/resources/file-system-metadata-provider.schema.json @@ -19,21 +19,8 @@ "@type": { "title": "label.metadata-provider-type", "description": "tooltip.metadata-provider-type", - "placeholder": "label.select-metadata-type", "type": "string", - "readOnly": true, - "widget": { - "id": "select", - "disabled": true - }, - "oneOf": [ - { - "enum": [ - "FilesystemMetadataResolver" - ], - "description": "value.file-system-metadata-provider" - } - ] + "const": "FilesystemMetadataResolver" }, "xmlId": { "title": "label.xml-id", @@ -56,24 +43,7 @@ "doInitialization": { "title": "label.do-resolver-initialization", "description": "tooltip.do-resolver-initialization", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "reloadableMetadataResolverAttributes": { "type": "object", @@ -82,54 +52,19 @@ "title": "label.min-refresh-delay", "description": "tooltip.min-refresh-delay", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "maxRefreshDelay": { "title": "label.max-refresh-delay", "description": "tooltip.max-refresh-delay", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "refreshDelayFactor": { "title": "label.refresh-delay-factor", "description": "tooltip.refresh-delay-factor", "type": "number", - "widget": { - "id": "float", - "help": "message.real-number", - "step": 0.01 - }, - "placeholder": "label.real-number", + "multipleOf": 0.01, "minimum": 0.001, "maximum": 0.999 } diff --git a/backend/src/main/resources/filebacked-http-metadata-provider.schema.json b/backend/src/main/resources/filebacked-http-metadata-provider.schema.json index ee27e6330..a85d1e400 100644 --- a/backend/src/main/resources/filebacked-http-metadata-provider.schema.json +++ b/backend/src/main/resources/filebacked-http-metadata-provider.schema.json @@ -38,21 +38,8 @@ "@type": { "title": "label.metadata-provider-type", "description": "tooltip.metadata-provider-type", - "placeholder": "label.select-metadata-type", "type": "string", - "readOnly": true, - "widget": { - "id": "select", - "disabled": true - }, - "oneOf": [ - { - "enum": [ - "FileBackedHttpMetadataResolver" - ], - "description": "value.file-backed-http-metadata-provider" - } - ] + "const": "FileBackedHttpMetadataResolver" }, "enabled": { "title": "label.enable-service", @@ -75,24 +62,7 @@ "initializeFromBackupFile": { "title": "label.init-from-backup", "description": "tooltip.init-from-backup", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "backingFile": { "title": "label.backing-file", @@ -103,179 +73,49 @@ "title": "label.backup-file-init-refresh-delay", "description": "tooltip.backup-file-init-refresh-delay", "type": "string", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "requireValidMetadata": { "title": "label.require-valid-metadata", "description": "tooltip.require-valid-metadata", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "failFastInitialization": { "title": "label.fail-fast-init", "description": "tooltip.fail-fast-init", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "useDefaultPredicateRegistry": { "title": "label.use-default-predicate-reg", "description": "tooltip.use-default-predicate-reg", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "satisfyAnyPredicates": { "$id": "satisfyAnyPredicates", "title": "label.satisfy-any-predicates", "description": "tooltip.satisfy-any-predicates", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "httpMetadataResolverAttributes": { "$id": "httpMetadataResolverAttributes", "order": [], "type": "object", - "fieldsets": [ - { - "title": "label.http-connection-attributes", - "type": "section", - "fields": [ - "connectionRequestTimeout", - "connectionTimeout", - "socketTimeout" - ] - }, - { - "title": "label.http-security-attributes", - "type": "section", - "class": "col-12", - "fields": [ - "disregardTLSCertificate" - ] - }, - { - "title": "label.http-proxy-attributes", - "type": "section", - "class": "col-12", - "fields": [ - "proxyHost", - "proxyPort", - "proxyUser", - "proxyPassword" - ] - }, - { - "title": "label.http-caching-attributes", - "type": "section", - "class": "col-12", - "fields": [ - "httpCaching", - "httpCacheDirectory", - "httpMaxCacheEntries", - "httpMaxCacheEntrySize" - ] - }, - { - "title": "", - "type": "hidden", - "class": "col-12", - "fields": [ - "tlsTrustEngineRef", - "httpClientSecurityParametersRef", - "httpClientRef" - ] - } - ], "properties": { + "disregardTLSCertificate": { + "type": "boolean", + "title": "label.disregard-tls-cert", + "description": "tooltip.disregard-tls-cert" + }, "httpClientRef": { "type": "string", "title": "", "description": "", - "placeholder": "", "widget": "hidden" }, "connectionRequestTimeout": { "type": "string", "title": "label.connection-request-timeout", "description": "tooltip.connection-request-timeout", - "placeholder": "label.duration", "widget": { "id": "datalist", "data": [ @@ -296,7 +136,6 @@ "type": "string", "title": "label.connection-timeout", "description": "tooltip.connection-timeout", - "placeholder": "label.duration", "widget": { "id": "datalist", "data": [ @@ -317,7 +156,6 @@ "type": "string", "title": "label.socket-timeout", "description": "tooltip.socket-timeout", - "placeholder": "label.duration", "widget": { "id": "datalist", "data": [ @@ -334,71 +172,40 @@ }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, - "disregardTLSCertificate": { - "type": "boolean", - "title": "label.disregard-tls-cert", - "description": "tooltip.disregard-tls-cert", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "True" - }, - { - "enum": [ - false - ], - "description": "False" - } - ] - }, "tlsTrustEngineRef": { "type": "string", "title": "", - "description": "", - "placeholder": "", - "widget": "hidden" + "description": "" }, "httpClientSecurityParametersRef": { "type": "string", "title": "", - "description": "", - "placeholder": "", - "widget": "hidden" + "description": "" }, "proxyHost": { "type": "string", "title": "label.proxy-host", - "description": "tooltip.proxy-host", - "placeholder": "" + "description": "tooltip.proxy-host" }, "proxyPort": { "type": "string", "title": "label.proxy-port", - "description": "tooltip.proxy-port", - "placeholder": "" + "description": "tooltip.proxy-port" }, "proxyUser": { "type": "string", "title": "label.proxy-user", - "description": "tooltip.proxy-user", - "placeholder": "" + "description": "tooltip.proxy-user" }, "proxyPassword": { "type": "string", "title": "label.proxy-password", - "description": "tooltip.proxy-password", - "placeholder": "" + "description": "tooltip.proxy-password" }, "httpCaching": { "type": "string", "title": "label.http-caching", "description": "tooltip.http-caching", - "placeholder": "label.select-caching-type", "widget": { "id": "select" }, @@ -426,21 +233,18 @@ "httpCacheDirectory": { "type": "string", "title": "label.http-caching-directory", - "description": "tooltip.http-caching-directory", - "placeholder": "" + "description": "tooltip.http-caching-directory" }, "httpMaxCacheEntries": { "type": "integer", "title": "label.http-max-cache-entries", "description": "tooltip.http-max-cache-entries", - "placeholder": "", "minimum": 0 }, "httpMaxCacheEntrySize": { "type": "integer", "title": "label.max-cache-entry-size", "description": "tooltip.max-cache-entry-size", - "placeholder": "", "minimum": 0 } } @@ -453,54 +257,19 @@ "title": "label.min-refresh-delay", "description": "tooltip.min-refresh-delay", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "maxRefreshDelay": { "title": "label.max-refresh-delay", "description": "tooltip.max-refresh-delay", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "refreshDelayFactor": { "title": "label.refresh-delay-factor", "description": "tooltip.refresh-delay-factor", "type": "number", - "widget": { - "id": "float", - "help": "message.real-number", - "step": 0.01 - }, - "placeholder": "label.real-number", + "multipleOf": 0.01, "minimum": 0.001, "maximum": 0.999 } @@ -511,7 +280,6 @@ "title": "", "description": "", "type": "array", - "additionalItems": true, "items": [ { "$id": "RequiredValidUntil", @@ -521,25 +289,14 @@ "id": "fieldset" }, "properties": { + "@type": { + "type": "string", + "default": "RequiredValidUntil" + }, "maxValidityInterval": { "title": "label.max-validity-interval", "description": "tooltip.max-validity-interval", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" } } @@ -552,6 +309,10 @@ "id": "fieldset" }, "properties": { + "@type": { + "type": "string", + "default": "SignatureValidation" + }, "requireSignedRoot": { "title": "label.require-signed-root", "description": "tooltip.require-signed-root", @@ -563,29 +324,29 @@ "type": "string" } }, - "anyOf": [ - { - "properties": { - "requireSignedRoot": { - "enum": [ - true + "dependencies": { + "requireSignedRoot": { + "oneOf": [ + { + "properties": { + "requireSignedRoot": { + "const": true + } + }, + "required": [ + "certificateFile" ] + }, + { + "properties": { + "requireSignedRoot": { + "const": false + } + } } - }, - "required": [ - "certificateFile" ] - }, - { - "properties": { - "requireSignedRoot": { - "enum": [ - false - ] - } - } } - ] + } }, { "$id": "EntityRoleWhiteList", @@ -595,6 +356,10 @@ "id": "fieldset" }, "properties": { + "@type": { + "type": "string", + "default": "EntityRoleWhiteList" + }, "retainedRoles": { "title": "label.retained-roles", "description": "tooltip.retained-roles", @@ -604,19 +369,13 @@ "id": "select" }, "type": "string", - "oneOf": [ - { - "enum": [ - "SPSSODescriptor" - ], - "description": "value.spdescriptor" - }, - { - "enum": [ - "AttributeAuthorityDescriptor" - ], - "description": "value.attr-auth-descriptor" - } + "enum": [ + "SPSSODescriptor", + "AttributeAuthorityDescriptor" + ], + "enumNames": [ + "value.spdescriptor", + "value.attr-auth-descriptor" ] } }, diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties index 1a74a40eb..2e7f58ebb 100644 --- a/backend/src/main/resources/i18n/messages.properties +++ b/backend/src/main/resources/i18n/messages.properties @@ -151,7 +151,7 @@ label.select-protocol=Select Protocol label.nameid-format=NameID Format label.nameid-formats=NameID Formats label.name-and-entity-id=Name and Entity ID -label.organization-information=Organization Information +label.organization-information=SP/Organization Information label.contact-information=Contact Information label.given-name=Given Name label.contact-type=Contact Type diff --git a/backend/src/main/resources/local-dynamic-metadata-provider.schema.json b/backend/src/main/resources/local-dynamic-metadata-provider.schema.json index df9c432e4..be547ae24 100644 --- a/backend/src/main/resources/local-dynamic-metadata-provider.schema.json +++ b/backend/src/main/resources/local-dynamic-metadata-provider.schema.json @@ -19,21 +19,8 @@ "@type": { "title": "label.metadata-provider-type", "description": "tooltip.metadata-provider-type", - "placeholder": "label.select-metadata-type", "type": "string", - "readOnly": true, - "widget": { - "id": "select", - "disabled": true - }, - "oneOf": [ - { - "enum": [ - "LocalDynamicMetadataResolver" - ], - "description": "value.local-dynamic-metadata-provider" - } - ] + "const": "LocalDynamicMetadataResolver" }, "xmlId": { "title": "label.xml-id", @@ -60,12 +47,7 @@ "title": "label.refresh-delay-factor", "description": "tooltip.refresh-delay-factor", "type": "number", - "widget": { - "id": "float", - "help": "message.real-number", - "step": 0.01 - }, - "placeholder": "label.real-number", + "multipleOf": 0.01, "minimum": 0.001, "maximum": 0.999 }, @@ -73,113 +55,32 @@ "title": "label.min-cache-duration", "description": "tooltip.min-cache-duration", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT8H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "maxCacheDuration": { "title": "label.max-cache-duration", "description": "tooltip.max-cache-duration", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT8H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "maxIdleEntityData": { "title": "label.max-idle-entity-data", "description": "tooltip.max-idle-entity-data", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT8H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" }, "removeIdleEntityData": { "title": "label.remove-idle-entity-data", "description": "tooltip.remove-idle-entity-data", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } - ] + "type": "boolean" }, "cleanupTaskInterval": { "title": "label.cleanup-task-interval", "description": "tooltip.cleanup-task-interval", "type": "string", - "placeholder": "label.duration", - "widget": { - "id": "datalist", - "data": [ - "PT0S", - "PT30S", - "PT1M", - "PT10M", - "PT30M", - "PT1H", - "PT4H", - "PT8H", - "PT12H", - "PT24H" - ] - }, "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" } } } } -} +} \ No newline at end of file diff --git a/backend/src/main/resources/metadata-sources-ui-schema.json b/backend/src/main/resources/metadata-sources-ui-schema.json index 89a312a9f..1e4714905 100644 --- a/backend/src/main/resources/metadata-sources-ui-schema.json +++ b/backend/src/main/resources/metadata-sources-ui-schema.json @@ -5,16 +5,16 @@ "entityId" ], "properties": { - "entityId": { - "title": "label.entity-id", - "description": "tooltip.entity-id", + "serviceProviderName": { + "title": "label.service-provider-name", + "description": "tooltip.service-provider-name", "type": "string", "minLength": 1, "maxLength": 255 }, - "serviceProviderName": { - "title": "label.service-provider-name", - "description": "tooltip.service-provider-name", + "entityId": { + "title": "label.entity-id", + "description": "tooltip.entity-id", "type": "string", "minLength": 1, "maxLength": 255 @@ -44,87 +44,49 @@ "widget": { "id": "fieldset" }, - "fieldsets": [ - { - "type": "group", - "fields": [ - "x509CertificateAvailable", - "authenticationRequestsSigned", - "wantAssertionsSigned" - ] - }, - { - "type": "group", - "fields": [ - "x509Certificates" - ] - } - ], - "properties": { - "x509CertificateAvailable": { - "title": "label.is-there-a-x509-certificate", - "description": "tooltip.is-there-a-x509-certificate", - "type": "boolean", - "widget": { - "id": "boolean-radio" - }, + "dependencies": { + "authenticationRequestsSigned": { "oneOf": [ { - "enum": [ - true - ], - "description": "value.true" + "properties": { + "authenticationRequestsSigned": { + "const": true + }, + "x509Certificates": { + "minItems": 1 + } + } }, { - "enum": [ - false - ], - "description": "value.false" + "properties": { + "authenticationRequestsSigned": { + "const": false + }, + "x509Certificates": { + "minItems": 0 + } + } } ] - }, + } + }, + "properties": { "authenticationRequestsSigned": { "title": "label.authentication-requests-signed", "description": "tooltip.authentication-requests-signed", "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } + "enumNames": [ + "value.true", + "value.false" ] }, "wantAssertionsSigned": { "title": "label.want-assertions-signed", "description": "tooltip.want-assertions-signed", "type": "boolean", - "widget": { - "id": "boolean-radio" - }, - "oneOf": [ - { - "enum": [ - true - ], - "description": "value.true" - }, - { - "enum": [ - false - ], - "description": "value.false" - } + "enumNames": [ + "value.true", + "value.false" ] }, "x509Certificates": { @@ -146,24 +108,11 @@ }, "serviceProviderSsoDescriptor": { "type": "object", - "fieldsets": [ - { - "type": "group", - "fields": [ - "protocolSupportEnum", - "nameIdFormats" - ] - } - ], - "required": [ - "nameIdFormats" - ], "properties": { "protocolSupportEnum": { "title": "label.protocol-support-enumeration", "description": "tooltip.protocol-support-enumeration", "type": "string", - "placeholder": "label.select-protocol", "widget": { "id": "select" }, @@ -185,6 +134,11 @@ "nameIdFormats": { "$ref": "#/definitions/nameIdFormats" } + }, + "dependencies": { + "nameIdFormats": [ + "protocolSupportEnum" + ] } }, "logoutEndpoints": { @@ -203,18 +157,14 @@ "type": "array", "title": "label.attribute-release", "description": "Attribute release table - select the attributes you want to release (default unchecked)", - "widget": { - "id": "checklist", - "dataUrl": "/customAttributes" - }, "items": { "type": "string" - } + }, + "uniqueItems": true } }, "definitions": { "Contact": { - "title": "label.contact", "type": "object", "required": [ "name", @@ -274,7 +224,6 @@ }, "Certificate": { "type": "object", - "title": "label.certificate", "required": [ "type", "value" @@ -288,7 +237,6 @@ }, "type": { "title": "label.certificate-type", - "description": "tooltip.certificate-type", "type": "string", "widget": { "id": "radio", @@ -326,7 +274,6 @@ }, "AssertionConsumerService": { "type": "object", - "title": "label.assertion-consumer-service-endpoint", "required": [ "locationUrl", "binding" @@ -395,7 +342,6 @@ } }, "LogoutEndpoint": { - "title": "label.new-endpoint", "description": "tooltip.new-endpoint", "type": "object", "fieldsets": [ @@ -518,13 +464,13 @@ "logoHeight": { "title": "label.logo-height", "description": "tooltip.mdui-logo-height", - "min": 0, + "minimum": 0, "type": "integer" }, "logoWidth": { "title": "label.logo-width", "description": "tooltip.mdui-logo-width", - "min": 0, + "minimum": 0, "type": "integer" } } @@ -576,4 +522,4 @@ } } } -} +} \ No newline at end of file