Skip to content

Commit

Permalink
SHIBUI-1536 Updated ngrx library, disabled runtimeChecks
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis authored and dima767 committed Oct 24, 2019
1 parent 973dde2 commit b4644da
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,6 @@ gradle-app.setting

# pac4j
pac4j-module/out/

#Local run shell script wrapper
r
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,19 @@ public static Attribute getAttributeFromObjectAndRelyingPartyOverrideProperty(Ob
overrideProperty.getAttributeFriendlyName(),
(String) o);
case SET:
return ATTRIBUTE_UTILITY.createAttributeWithStringValues(overrideProperty.getAttributeName(),
overrideProperty.getAttributeFriendlyName(),
(List<String>) o);
if(((List<String>)o).size() > 0) {
return ATTRIBUTE_UTILITY.createAttributeWithStringValues(overrideProperty.getAttributeName(),
overrideProperty.getAttributeFriendlyName(),
(List<String>) o);
}
return null;
case LIST:
return ATTRIBUTE_UTILITY.createAttributeWithStringValues(overrideProperty.getAttributeName(),
overrideProperty.getAttributeFriendlyName(),
(List<String>) o);
if(((List<String>)o).size() > 0) {
return ATTRIBUTE_UTILITY.createAttributeWithStringValues(overrideProperty.getAttributeName(),
overrideProperty.getAttributeFriendlyName(),
(List<String>) o);
}
return null;
default:
throw new UnsupportedOperationException("getAttributeListFromRelyingPartyOverridesRepresentation was called with an unsupported type (" + overrideProperty.getDisplayType() + ")!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
import edu.internet2.tier.shibboleth.admin.ui.ShibbolethUiApplication
import edu.internet2.tier.shibboleth.admin.ui.configuration.CoreShibUiConfiguration
import edu.internet2.tier.shibboleth.admin.ui.configuration.CustomPropertiesConfiguration
import edu.internet2.tier.shibboleth.admin.ui.domain.Attribute
import edu.internet2.tier.shibboleth.admin.ui.domain.EntityDescriptor
import edu.internet2.tier.shibboleth.admin.ui.domain.XSAny
import edu.internet2.tier.shibboleth.admin.ui.domain.XSAnyBuilder
Expand All @@ -25,6 +26,7 @@ import edu.internet2.tier.shibboleth.admin.ui.security.service.UserService
import edu.internet2.tier.shibboleth.admin.ui.util.RandomGenerator
import edu.internet2.tier.shibboleth.admin.ui.util.TestObjectGenerator
import edu.internet2.tier.shibboleth.admin.util.AttributeUtility
import org.opensaml.saml.ext.saml2mdattr.EntityAttributes
import org.skyscreamer.jsonassert.JSONAssert
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
Expand Down Expand Up @@ -877,6 +879,31 @@ class JPAEntityDescriptorServiceImplTests extends Specification {
assert representation.relyingPartyOverrides.get('ignoreAuthenticationMethod') instanceof Boolean
}

def "SHIBUI-1522"() {
when:
EntityDescriptor inputEd = openSamlObjects.unmarshalFromXml this.class.getResource('/metadata/SHIBUI-1522.xml').bytes
EntityDescriptorRepresentation edr = service.createRepresentationFromDescriptor(inputEd)
edr.relyingPartyOverrides = [nameIdFormats: [], authenticationMethods: []]
EntityDescriptor outputEd = service.createDescriptorFromRepresentation(edr)

then:
outputEd.getExtensions().unknownXMLObjects[0].attributes.size() == 0

when:
edr.relyingPartyOverrides = [nameIdFormats: ['format1', 'format2']]
outputEd = service.createDescriptorFromRepresentation(edr)

then:
outputEd.getExtensions().unknownXMLObjects[0].attributes.size() == 1

when:
edr.relyingPartyOverrides = [nameIdFormats: ['format1', 'format2'], authenticationMethods: ['auth1', 'auth2']]
outputEd = service.createDescriptorFromRepresentation(edr)

then:
outputEd.getExtensions().unknownXMLObjects[0].attributes.size() == 2
}

EntityDescriptor generateRandomEntityDescriptor() {
EntityDescriptor ed = new EntityDescriptor()

Expand Down
16 changes: 16 additions & 0 deletions backend/src/test/resources/metadata/SHIBUI-1522.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<md:EntityDescriptor entityID="https://www.concursolutions2.net"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">
<md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:Extensions>
<mdui:UIInfo>
<mdui:DisplayName xml:lang="en">Concur Solutions</mdui:DisplayName>
<!-- <mdui:Description xml:lang="en">Logon using your 8-digit SMU ID and password.</mdui:Description> -->
<mdui:Logo height="146" width="148">https://www.concur.com/sites/all/themes/Concur6/images/Concur_logo.png</mdui:Logo>
</mdui:UIInfo>
</md:Extensions>
<md:NameIDFormat>urn:oid:1.3.6.1.4.1.5923.1.1.1.6</md:NameIDFormat>
<md:AssertionConsumerService index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://www.concursolutions.com/SAMLRedirector/ClientSAMLLogin.aspx"/>
</md:SPSSODescriptor>
</md:EntityDescriptor>
30 changes: 15 additions & 15 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"@angular/platform-browser-dynamic": "8.2.11",
"@angular/router": "8.2.11",
"@ng-bootstrap/ng-bootstrap": "5.1.1",
"@ngrx/effects": "7.4.0",
"@ngrx/entity": "7.4.0",
"@ngrx/router-store": "7.4.0",
"@ngrx/store": "7.4.0",
"@ngrx/store-devtools": "7.4.0",
"@ngrx/effects": "8.4.0",
"@ngrx/entity": "8.4.0",
"@ngrx/router-store": "8.4.0",
"@ngrx/store": "8.4.0",
"@ngrx/store-devtools": "8.4.0",
"bootstrap": "4.3.1",
"core-js": "^2.4.1",
"deep-object-diff": "^1.1.0",
Expand Down Expand Up @@ -73,4 +73,4 @@
"typescript": "3.5.3",
"webpack-bundle-analyzer": "^3.3.2"
}
}
}
10 changes: 8 additions & 2 deletions ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ import { NavigationService } from './core/service/navigation.service';
],
imports: [
StoreModule.forRoot(reducers, {
metaReducers
metaReducers,
runtimeChecks: {
strictActionImmutability: false,
strictActionSerializability: false,
strictStateImmutability: false,
strictStateSerializability: false
}
}),
StoreDevtoolsModule.instrument({
maxAge: 25, // Retains last 25 states
Expand All @@ -42,7 +48,7 @@ import { NavigationService } from './core/service/navigation.service';
EffectsModule.forRoot([]),
BrowserModule,
CoreModule.forRoot(),
StoreRouterConnectingModule,
StoreRouterConnectingModule.forRoot(),
NgbDropdownModule,
NgbModalModule,
NgbPopoverModule,
Expand Down

0 comments on commit b4644da

Please sign in to comment.