Skip to content

Commit

Permalink
Updated schema api
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed May 18, 2021
1 parent 252a954 commit a38d027
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
123 changes: 32 additions & 91 deletions backend/src/main/resources/entity-attributes-filters-ui-schema.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand All @@ -87,7 +59,10 @@
}
}
},
"required": ["value", "entityAttributesFilterTargetType"]
"required": [
"value",
"entityAttributesFilterTargetType"
]
},
"relyingPartyOverrides": {
"type": "object",
Expand Down Expand Up @@ -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"
]
}
}
}
Expand All @@ -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"
}
Expand All @@ -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": {
}
}
73 changes: 13 additions & 60 deletions backend/src/main/resources/nameid-filter.schema.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
{
"type": "object",
"fieldsets": [
{
"type": "group-lg",
"fields": [
"name",
"nameIdFormatFilterTarget",
"filterEnabled",
"@type",
"resourceId",
"version",
"removeExistingFormats"
]
},
{
"type": "group",
"fields": [
"formats"
]
}
],
"required": [
"name"
],
"properties": {
"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",
Expand All @@ -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": {
Expand All @@ -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",
Expand Down

0 comments on commit a38d027

Please sign in to comment.