From 476b2e66dc5f9ef33a36f579b4afef8ecfabf1c7 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 29 Apr 2021 09:07:49 -0700 Subject: [PATCH 1/5] Fixed messages and schema --- .../main/resources/entity-attributes-filters-ui-schema.json | 1 + backend/src/main/resources/i18n/messages.properties | 5 ++++- backend/src/main/resources/nameid-filter.schema.json | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/main/resources/entity-attributes-filters-ui-schema.json b/backend/src/main/resources/entity-attributes-filters-ui-schema.json index fa64d5abb..d5968834e 100644 --- a/backend/src/main/resources/entity-attributes-filters-ui-schema.json +++ b/backend/src/main/resources/entity-attributes-filters-ui-schema.json @@ -174,6 +174,7 @@ } }, "attributeRelease": { + "title": "label.attribute-release", "type": "array", "description": "Attribute release table - select the attributes you want to release (default unchecked)", "widget": { diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties index 0032a25ed..1a74a40eb 100644 --- a/backend/src/main/resources/i18n/messages.properties +++ b/backend/src/main/resources/i18n/messages.properties @@ -118,6 +118,9 @@ brand.and=and heading.shibboleth=Shibboleth +label.source-configuration=Metadata Source Configuration +label.provider-configuration=Metadata Provider Configuration + label.metadata-source=Metadata Source label.metadata-sources=Metadata Sources label.metadata-provider=Metadata Provider @@ -410,7 +413,7 @@ label.author=Author label.creation-date=Creation Date label.order=Order label.provider-type=Provider Type - +label.version-history=Version History label.metadata-resolver-history=Metadata resolver history label.metadata-version-history=Metadata Version History label.select-version=Select Version diff --git a/backend/src/main/resources/nameid-filter.schema.json b/backend/src/main/resources/nameid-filter.schema.json index 0416092d0..b033a13b9 100644 --- a/backend/src/main/resources/nameid-filter.schema.json +++ b/backend/src/main/resources/nameid-filter.schema.json @@ -49,7 +49,7 @@ }, "properties": { "nameIdFormatFilterTargetType": { - "title": "", + "title": "label.filter-target-type", "type": "string", "default": "ENTITY", "oneOf": [ @@ -74,6 +74,7 @@ ] }, "value": { + "title": "label.filter-target-value", "type": "array", "buttons": [ { From 252a954b8f50b759a04f4bb5e0f206db20549010 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 17 May 2021 11:03:26 -0700 Subject: [PATCH 2/5] 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 From a38d027e20f1768c3384301179da48167ff65589 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Tue, 18 May 2021 14:59:50 -0700 Subject: [PATCH 3/5] Updated schema api --- ...ibutesFiltersUiDefinitionController.groovy | 2 +- .../entity-attributes-filters-ui-schema.json | 123 +++++------------- .../main/resources/nameid-filter.schema.json | 73 ++--------- 3 files changed, 46 insertions(+), 152 deletions(-) diff --git a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityAttributesFiltersUiDefinitionController.groovy b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityAttributesFiltersUiDefinitionController.groovy index ffd3ee3ab..556adb962 100644 --- a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityAttributesFiltersUiDefinitionController.groovy +++ b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityAttributesFiltersUiDefinitionController.groovy @@ -41,7 +41,7 @@ class EntityAttributesFiltersUiDefinitionController { ResponseEntity getUiDefinitionJsonSchema() { try { def parsedJson = jacksonObjectMapper.readValue(this.jsonSchemaLocation.url, Map) - 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/resources/entity-attributes-filters-ui-schema.json b/backend/src/main/resources/entity-attributes-filters-ui-schema.json index d5968834e..d34412613 100644 --- a/backend/src/main/resources/entity-attributes-filters-ui-schema.json +++ b/backend/src/main/resources/entity-attributes-filters-ui-schema.json @@ -1,34 +1,20 @@ { - "title": "EntityAttributes Filter", "type": "object", "properties": { "name": { "title": "label.filter-name", "description": "tooltip.filter-name", - "type": "string", - "widget": { - "id": "string", - "help": "message.must-be-unique" - } + "type": "string" }, "@type": { "type": "string", - "widget": { - "id": "hidden" - }, "default": "EntityAttributes" }, "resourceId": { - "type": "string", - "widget": { - "id": "hidden" - } + "type": "string" }, "version": { - "type": "integer", - "widget": { - "id": "hidden" - } + "type": "integer" }, "filterEnabled": { "title": "label.enable-filter", @@ -40,34 +26,20 @@ "title": "label.search-criteria", "description": "tooltip.search-criteria", "type": "object", - "widget": { - "id": "filter-target", - "target": "entityAttributesFilterTargetType" - }, "properties": { "entityAttributesFilterTargetType": { "title": "label.filter-target-type", "type": "string", "default": "ENTITY", - "oneOf": [ - { - "enum": [ - "ENTITY" - ], - "description": "value.entity-id" - }, - { - "enum": [ - "REGEX" - ], - "description": "value.regex" - }, - { - "enum": [ - "CONDITION_SCRIPT" - ], - "description": "value.script" - } + "enum": [ + "ENTITY", + "REGEX", + "CONDITION_SCRIPT" + ], + "enumNames": [ + "value.entity-id", + "value.regex", + "value.script" ] }, "value": { @@ -87,7 +59,10 @@ } } }, - "required": ["value", "entityAttributesFilterTargetType"] + "required": [ + "value", + "entityAttributesFilterTargetType" + ] }, "relyingPartyOverrides": { "type": "object", @@ -134,41 +109,35 @@ }, "nameIdFormats": { "title": "label.nameid-format-to-send", - "placeholder": "label.nameid-format", "description": "tooltip.nameid-format", "type": "array", "uniqueItems": true, "items": { - "title": "label.nameid-format", "type": "string", - "widget": { - "id": "datalist", - "data": [ - "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", - "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", - "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", - "urn:oasis:names:tc:SAML:2.0:nameid-format:transient" - ] - } + "minLength": 1, + "maxLength": 255, + "examples": [ + "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", + "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", + "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", + "urn:oasis:names:tc:SAML:2.0:nameid-format:transient" + ] } }, "authenticationMethods": { "title": "label.authentication-methods-to-use", "description": "tooltip.authentication-methods-to-use", "type": "array", - "placeholder": "label.authentication-method", "uniqueItems": true, "items": { "type": "string", - "title": "label.authentication-method", - "widget": { - "id": "datalist", - "data": [ - "https://refeds.org/profile/mfa", - "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken", - "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" - ] - } + "minLength": 1, + "maxLength": 255, + "examples": [ + "https://refeds.org/profile/mfa", + "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken", + "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" + ] } } } @@ -177,10 +146,7 @@ "title": "label.attribute-release", "type": "array", "description": "Attribute release table - select the attributes you want to release (default unchecked)", - "widget": { - "id": "checklist", - "dataUrl": "/customAttributes" - }, + "uniqueItems": true, "items": { "type": "string" } @@ -189,31 +155,6 @@ "required": [ "name" ], - "fieldsets": [ - { - "type": "group-lg", - "fields": [ - "name", - "@type", - "resourceId", - "version", - "entityAttributesFilterTarget" - ] - }, - { - "type": "group", - "fields": [ - "filterEnabled", - "relyingPartyOverrides" - ] - }, - { - "type": "group", - "fields": [ - "attributeRelease" - ] - } - ], "definitions": { } } \ No newline at end of file diff --git a/backend/src/main/resources/nameid-filter.schema.json b/backend/src/main/resources/nameid-filter.schema.json index b033a13b9..3ed9ee68d 100644 --- a/backend/src/main/resources/nameid-filter.schema.json +++ b/backend/src/main/resources/nameid-filter.schema.json @@ -1,25 +1,5 @@ { "type": "object", - "fieldsets": [ - { - "type": "group-lg", - "fields": [ - "name", - "nameIdFormatFilterTarget", - "filterEnabled", - "@type", - "resourceId", - "version", - "removeExistingFormats" - ] - }, - { - "type": "group", - "fields": [ - "formats" - ] - } - ], "required": [ "name" ], @@ -27,11 +7,7 @@ "name": { "title": "label.filter-name", "description": "tooltip.filter-name", - "type": "string", - "widget": { - "id": "string", - "help": "message.must-be-unique" - } + "type": "string" }, "filterEnabled": { "title": "label.enable-filter", @@ -43,34 +19,20 @@ "title": "label.search-criteria", "description": "tooltip.search-criteria", "type": "object", - "widget": { - "id": "filter-target", - "target": "nameIdFormatFilterTargetType" - }, "properties": { "nameIdFormatFilterTargetType": { - "title": "label.filter-target-type", + "title": "", "type": "string", "default": "ENTITY", - "oneOf": [ - { - "enum": [ - "ENTITY" - ], - "description": "value.entity-id" - }, - { - "enum": [ - "REGEX" - ], - "description": "value.regex" - }, - { - "enum": [ - "CONDITION_SCRIPT" - ], - "description": "value.script" - } + "enum": [ + "ENTITY", + "REGEX", + "CONDITION_SCRIPT" + ], + "enumNames": [ + "value.entity-id", + "value.regex", + "value.script" ] }, "value": { @@ -97,22 +59,13 @@ }, "@type": { "type": "string", - "widget": { - "id": "hidden" - }, "default": "NameIDFormat" }, "version": { - "type": "integer", - "widget": { - "id": "hidden" - } + "type": "integer" }, "resourceId": { - "type": "string", - "widget": { - "id": "hidden" - } + "type": "string" }, "removeExistingFormats": { "type": "boolean", From fd9662e76c7ba7edb5c4a76faf63ff738729a4b7 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 19 May 2021 13:07:35 -0700 Subject: [PATCH 4/5] updated nameid schema --- backend/src/main/resources/nameid-filter.schema.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/backend/src/main/resources/nameid-filter.schema.json b/backend/src/main/resources/nameid-filter.schema.json index 3ed9ee68d..d6d02c84f 100644 --- a/backend/src/main/resources/nameid-filter.schema.json +++ b/backend/src/main/resources/nameid-filter.schema.json @@ -38,13 +38,6 @@ "value": { "title": "label.filter-target-value", "type": "array", - "buttons": [ - { - "id": "preview", - "label": "action.preview", - "widget": "icon-button" - } - ], "minItems": 1, "uniqueItems": true, "items": { From e3744075a2a61c7c8e2d29531b11b3d37ff5a333 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 20 May 2021 14:23:47 -0700 Subject: [PATCH 5/5] Fixed validation --- .../main/resources/dynamic-http-metadata-provider.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f4f96fe4b..71cfd3ac3 100644 --- a/backend/src/main/resources/dynamic-http-metadata-provider.schema.json +++ b/backend/src/main/resources/dynamic-http-metadata-provider.schema.json @@ -116,7 +116,7 @@ { "properties": { "initializeFromPersistentCacheInBackground": { - "const": true + "enum": [true] }, "backgroundInitializationFromCacheDelay": { "title": "label.background-init-from-cache-delay", @@ -129,7 +129,7 @@ { "properties": { "initializeFromPersistentCacheInBackground": { - "const": false + "enum": [false] } } }