Skip to content

Commit

Permalink
Merged in react (pull request #483)
Browse files Browse the repository at this point in the history
React Conversion
  • Loading branch information
rmathis committed Jun 14, 2021
2 parents 6fe87cb + 0c02bcb commit fc668d2
Show file tree
Hide file tree
Showing 913 changed files with 37,452 additions and 52,431 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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
}

Expand All @@ -36,12 +36,8 @@ class JsonSchemaBuilderService {
property =
[title : it['displayName'],
description: it['helpText'],
type : it['displayType']]
if (it['displayType'] == 'boolean') {
property['default'] = Boolean.valueOf(it['defaultValue'])
} else {
property['default'] = it['defaultValue']
}
type : it['displayType'],
examples : it['examples']]
}
properties[(String) it['name']] = property
}
Expand All @@ -64,7 +60,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['examples']

definition['items'] = items
json[(String) it['name']] = definition
Expand All @@ -76,7 +72,7 @@ class JsonSchemaBuilderService {
if (currentUser != null && currentUser.role != 'ROLE_ADMIN') {
// user isn't an admin, so hide 'ServiceEnabled'
Map<String, String> serviceEnabled = (HashMap) json['properties']['serviceEnabled']
serviceEnabled['widget'] = 'hidden'
serviceEnabled['readOnly'] = true
serviceEnabled.remove('title')
serviceEnabled.remove('description')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void indexHtml(HttpServletRequest request, HttpServletResponse response)
.lines()
.collect(Collectors.joining("\n"));

content = content.replaceFirst("<base.+>", "<base href=\"" + request.getContextPath() + "/\">");
content = content.replaceFirst("<base[^>]+>", "<base href=\"" + request.getContextPath() + "/\">");
response.setContentType("text/html");
try (OutputStream writer = response.getOutputStream()) {
writer.write(content.getBytes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class RelyingPartyOverrideProperty {
private String displayType;
private String defaultValue;
private String helpText;
private List<String> defaultValues;
private List<String> examples;
private String persistType;
private String persistValue;
private String attributeName;
Expand All @@ -33,7 +33,7 @@ public String toString() {
+ ", \nhelpText='" + helpText + '\''
+ ", \npersistType='" + persistType + '\''
+ ", \npersistValue='" + persistValue + '\''
+ ", \ndefaultValues=" + defaultValues
+ ", \nexamples=" + examples
+ ", \nattributeName='" + attributeName + '\''
+ ", \nattributeFriendlyName='" + attributeFriendlyName + '\''
+ "\n}";
Expand Down
12 changes: 2 additions & 10 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,26 @@ custom:
- name: signAssertion
displayName: label.sign-the-assertion
displayType: boolean
defaultValue: false
helpText: tooltip.sign-assertion
attributeName: http://shibboleth.net/ns/profiles/saml2/sso/browser/signAssertions
attributeFriendlyName: signAssertions
- name: dontSignResponse
displayName: label.dont-sign-the-response
displayType: boolean
defaultValue: false
helpText: tooltip.dont-sign-response
attributeName: http://shibboleth.net/ns/profiles/saml2/sso/browser/signResponses
attributeFriendlyName: signResponses
invert: true
- name: turnOffEncryption
displayName: label.turn-off-encryption-of-response
displayType: boolean
defaultValue: false
helpText: tooltip.turn-off-encryption
attributeName: http://shibboleth.net/ns/profiles/encryptAssertions
attributeFriendlyName: encryptAssertions
invert: true
- name: useSha
displayName: label.use-sha1-signing-algorithm
displayType: boolean
defaultValue: false
helpText: tooltip.usa-sha-algorithm
persistType: string
persistValue: shibboleth.SecurityConfiguration.SHA1
Expand All @@ -100,7 +96,6 @@ custom:
- name: ignoreAuthenticationMethod
displayName: label.ignore-any-sp-requested-authentication-method
displayType: boolean
defaultValue: false
helpText: tooltip.ignore-auth-method
persistType: string
persistValue: 0x1
Expand All @@ -109,23 +104,21 @@ custom:
- name: omitNotBefore
displayName: label.omit-not-before-condition
displayType: boolean
defaultValue: false
helpText: tooltip.omit-not-before-condition
attributeName: http://shibboleth.net/ns/profiles/includeConditionsNotBefore
attributeFriendlyName: includeConditionsNotBefore
invert: true
- name: responderId
displayName: label.responder-id
displayType: string
defaultValue: null
helpText: tooltip.responder-id
attributeName: http://shibboleth.net/ns/profiles/responderId
attributeFriendlyName: responderId
- name: nameIdFormats
displayName: label.nameid-format-to-send
displayType: set
helpText: tooltip.nameid-format
defaultValues:
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
Expand All @@ -136,7 +129,7 @@ custom:
displayName: label.authentication-methods-to-use
displayType: set
helpText: tooltip.authentication-methods-to-use
defaultValues:
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 @@ -145,7 +138,6 @@ custom:
- name: forceAuthn
displayName: label.force-authn
displayType: boolean
defaultValue: false
helpText: tooltip.force-authn
attributeName: http://shibboleth.net/ns/profiles/forceAuthn
attributeFriendlyName: forceAuthn
Loading

0 comments on commit fc668d2

Please sign in to comment.