diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties index 87b0e707d..87e654017 100644 --- a/backend/src/main/resources/i18n/messages.properties +++ b/backend/src/main/resources/i18n/messages.properties @@ -481,6 +481,8 @@ message.restoring-this-version-will-copy=Restoring this version will copy the Ve message.invalid-regex-pattern=Invalid Regular Expression +message.invalid-signing=Warning! If neither the Assertions or the Response are signed the service will not be able to verify a SAML response from the Identity Provider. + tooltip.entity-id=Entity ID tooltip.service-provider-name=Service Provider Name (Dashboard Display Only) tooltip.force-authn=Disallows use (or reuse) of authentication results and login flows that don\u0027t provide a real-time proof of user presence in the login process diff --git a/ui/src/app/metadata/domain/model/wizards/metadata-source-base.spec.ts b/ui/src/app/metadata/domain/model/wizards/metadata-source-base.spec.ts index 0cf3344ad..f9d614c2e 100644 --- a/ui/src/app/metadata/domain/model/wizards/metadata-source-base.spec.ts +++ b/ui/src/app/metadata/domain/model/wizards/metadata-source-base.spec.ts @@ -41,9 +41,7 @@ describe('Metadata Source Base class', () => { expect(Object.keys(getValidators([]))).toEqual([ '/', '/entityId', - '/organization/name', - '/organization/displayName', - '/organization/url' + '/relyingPartyOverrides' ]); }); }); diff --git a/ui/src/app/metadata/domain/model/wizards/metadata-source-base.ts b/ui/src/app/metadata/domain/model/wizards/metadata-source-base.ts index 106ebcf1d..0e8a0c209 100644 --- a/ui/src/app/metadata/domain/model/wizards/metadata-source-base.ts +++ b/ui/src/app/metadata/domain/model/wizards/metadata-source-base.ts @@ -64,39 +64,6 @@ export class MetadataSourceBase implements Wizard { } getValidators(entityIdList: string[]): { [key: string]: any } { - const checkRequiredChild = (value, property, form) => { - if (!value) { - return { - code: 'REQUIRED', - path: `#${property.path}`, - message: `message.required`, - params: [value] - }; - } - return null; - }; - const checkRequiredChildren = (value, property, form) => { - let errors; - Object.keys(value).forEach((item, index, all) => { - const error = checkRequiredChild(item, { path: `${index}` }, form); - if (error) { - errors = errors || []; - errors.push(error); - } - }); - return errors; - }; - const checkOrg = (value, property, form) => { - const org = property.parent; - const orgValue = org.value || {}; - const err = Object.keys(orgValue) && !value ? { - code: 'ORG_INCOMPLETE', - path: `#${property.path}`, - message: `message.org-incomplete`, - params: [value] - } : null; - return err; - }; const validators = { '/': (value, property, form_current) => { let errors; @@ -122,9 +89,19 @@ export class MetadataSourceBase implements Wizard { } : null; return err; }, - '/organization/name': checkOrg, - '/organization/displayName': checkOrg, - '/organization/url': checkOrg + '/relyingPartyOverrides': (value, property, form) => { + let errors; + if (!value.signAssertion && value.dontSignResponse) { + errors = []; + errors.push({ + code: 'INVALID_SIGNING', + path: `#${property.path}`, + message: 'message.invalid-signing', + params: [value] + }); + } + return errors; + } }; return validators; } diff --git a/ui/src/app/metadata/metadata.component.ts b/ui/src/app/metadata/metadata.component.ts index 5ffdd926a..70c094645 100644 --- a/ui/src/app/metadata/metadata.component.ts +++ b/ui/src/app/metadata/metadata.component.ts @@ -1,7 +1,4 @@ import { Component, ChangeDetectionStrategy } from '@angular/core'; -import { Store } from '@ngrx/store'; - -import * as fromRoot from '../app.reducer'; @Component({ selector: 'metadata-page', @@ -10,7 +7,5 @@ import * as fromRoot from '../app.reducer'; styleUrls: [] }) export class MetadataPageComponent { - constructor( - private store: Store - ) {} + constructor() {} } diff --git a/ui/src/app/schema-form/widget/object/object.component.html b/ui/src/app/schema-form/widget/object/object.component.html index 427cf462b..b085a0aa3 100644 --- a/ui/src/app/schema-form/widget/object/object.component.html +++ b/ui/src/app/schema-form/widget/object/object.component.html @@ -1,4 +1,7 @@
+ +
{{error.message | translate}}
+
; + + constructor() { + super(); + } + + ngAfterViewInit(): void { + super.ngAfterViewInit(); + if (this.formProperty) { + this.customErrors$ = this.formProperty.errorsChanges + .pipe( + map(errors => errors ? errors : []), + map(errors => { + return errors.filter(err => err.path.replace('#', '') === (this.formProperty.path)); + }), + map(errors => Object.values(errors.reduce((collection, error) => ({ ...collection, [error.code]: error }), {}))), + map(errors => errors.length ? errors : null) + ) as Observable; + } + } +}