[java-identity-provider] branch main updated: JSPROF-1 - Move RelyingParty "layer" into java-shib-profile
Scott Cantor
cantor.2 at osu.edu
Tue Feb 14 14:33:39 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=7a01fad8c9715bc74718d161c5281381e49abbea
The following commit(s) were added to refs/heads/main by this push:
new 7a01fad8c JSPROF-1 - Move RelyingParty "layer" into java-shib-profile
7a01fad8c is described below
commit 7a01fad8c9715bc74718d161c5281381e49abbea
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Feb 14 09:33:35 2023 -0500
JSPROF-1 - Move RelyingParty "layer" into java-shib-profile
https://shibboleth.atlassian.net/browse/JSPROF-1
Refactor with class changes.
Remove most old RelyingParty classes.
---
...InitializeAdministrativeProfileContextTree.java | 2 +-
.../idp/admin/impl/DoStorageOperationTest.java | 1 -
...ializeAdministrativeProfileContextTreeTest.java | 2 +-
.../AuthenticationFlowsLookupFunction.java | 2 +-
.../navigate/ForceAuthnProfileConfigPredicate.java | 2 +-
.../PostAuthenticationFlowsLookupFunction.java | 2 +-
.../idp/authn/context/AuthenticationContext.java | 2 +-
.../principal/ProxyAuthenticationPrincipal.java | 2 +-
.../idp/authn/impl/ExternalAuthenticationImpl.java | 2 +-
.../idp/authn/impl/FinalizeAuthentication.java | 3 +-
.../impl/InitializeRequestedPrincipalContext.java | 2 +-
.../RelyingPartyMapJAASLoginConfigStrategy.java | 2 +-
.../impl/DiscoveryProfileRequestFunction.java | 9 +-
.../idp/authn/impl/FinalizeAuthenticationTest.java | 3 +-
.../InitializeRequestedPrincipalContextTest.java | 7 +-
...RelyingPartyMapJAASLoginConfigStrategyTest.java | 5 +-
.../idp/cas/config/ConfigLookupFunction.java | 4 +-
.../flow/impl/BuildRelyingPartyContextAction.java | 3 +-
.../flow/impl/BuildSAMLMetadataContextAction.java | 2 +-
.../idp/cas/flow/impl/GrantProxyTicketAction.java | 2 -
.../cas/flow/impl/GrantServiceTicketAction.java | 2 +-
.../PrepareTicketValidationResponseAction.java | 2 +-
.../impl/CASDateTimeAttributeTranscoderTest.java | 3 +-
.../CASScopedStringAttributeTranscoderTest.java | 1 +
.../impl/CASStringAttributeTranscoderTest.java | 1 +
.../idp/cas/flow/impl/AbstractFlowActionTest.java | 8 +-
.../cas/flow/impl/BuildProxyChainActionTest.java | 1 +
.../impl/BuildRelyingPartyContextActionTest.java | 1 +
.../impl/BuildSAMLMetadataContextActionTest.java | 1 +
.../impl/CheckProxyAuthorizationActionTest.java | 1 +
.../cas/flow/impl/GrantProxyTicketActionTest.java | 1 +
.../flow/impl/GrantServiceTicketActionTest.java | 1 +
.../impl/PublishProtocolResponseActionTest.java | 1 +
.../idp/cas/flow/impl/TestContextBuilder.java | 3 +-
.../flow/impl/ValidateProxyCallbackActionTest.java | 4 +-
.../idp/cas/flow/impl/ValidateRenewActionTest.java | 2 +
.../cas/flow/impl/ValidateTicketActionTest.java | 1 +
.../proxy/impl/HttpClientProxyValidatorTest.java | 1 +
.../service/impl/MetadataServiceRegistryTest.java | 1 +
.../session/impl/CASSPSessionSerializerTest.java | 1 +
.../cas/ticket/impl/EncodingTicketServiceTest.java | 1 +
.../cas/ticket/impl/SimpleTicketServiceTest.java | 1 +
.../impl/ProxyGrantingTicketSerializerTest.java | 1 +
.../impl/ProxyTicketSerializerTest.java | 1 +
.../impl/ServiceTicketSerializerTest.java | 5 +-
idp-cli/.gitignore | 1 +
.../net/shibboleth/idp/conf/functions.xml | 4 +-
.../shibboleth/idp/conf/relying-party-system.xml | 2 +-
.../net/shibboleth/idp/conf/security-system.xml | 10 +-
.../net/shibboleth/idp/conf/services-system.xml | 12 +-
.../net/shibboleth/idp/conf/soap-client.xml | 6 +-
.../idp/flows/admin/admin-abstract-beans.xml | 2 +-
.../idp/flows/admin/admin-abstract-flow.xml | 2 +-
.../net/shibboleth/idp/flows/admin/hello-flow.xml | 2 +-
.../idp/flows/admin/resolvertest-beans.xml | 2 +-
.../idp/flows/admin/resolvertest-flow.xml | 2 +-
.../idp/flows/admin/unlock-keys-flow.xml | 4 +-
.../idp/flows/authn/saml-authn-beans.xml | 4 +-
.../idp/flows/cas/cas-abstract-beans.xml | 2 +-
.../idp/flows/intercept/attribute-release-flow.xml | 2 +-
.../idp/flows/intercept/impersonate-flow.xml | 6 +-
.../flows/saml/logout/saml2-logoutprop-beans.xml | 2 +-
.../idp/flows/saml/saml-abstract-beans.xml | 4 +-
.../idp/test/flows/AbstractFlowTest.java | 2 -
.../idp/test/flows/SetupForResolver.java | 10 +-
.../test/flows/c14n/actions/SetupForSAML1C14N.java | 6 +-
.../test/flows/c14n/actions/SetupForSAML2C14N.java | 6 +-
.../idp/test/flows/cas/LoginFlowTest.java | 20 +-
.../cas/LoginFlowTicketCreationErrorTest.java | 1 +
.../idp/test/flows/cas/ProxyFlowTest.java | 1 +
.../idp/test/flows/cas/ProxyValidateFlowTest.java | 3 +-
.../idp/test/flows/cas/SamlValidateFlowTest.java | 4 +-
.../test/flows/cas/ServiceValidateFlowTest.java | 3 +-
.../idp/test/flows/cas/TestProxyValidator.java | 1 +
.../idp/test/flows/cas/ToggleablePredicate.java | 1 +
.../idp/test/flows/cas/ValidateFlowTest.java | 1 +
.../test/flows/exception/ExceptionFlowTest.java | 1 +
.../idp/test/flows/exception/ThrowException.java | 3 +
.../test/flows/interceptor/InterceptFlowTest.java | 1 +
.../idp/test/flows/mapper/TestAfterFilter.java | 6 +-
.../test/flows/saml2/AbstractSAML2SSOFlowTest.java | 1 +
...ropertiesApplicationContextInitializerTest.java | 1 +
.../ar/impl/AbstractAttributeReleaseAction.java | 2 +-
.../logic/impl/AttributeValueLookupFunction.java | 2 +-
.../impl/AbstractConsentAuditExtractorTest.java | 7 +-
.../impl/CurrentConsentIdsAuditExtractorTest.java | 1 +
...CurrentConsentIsApprovedAuditExtractorTest.java | 1 +
.../CurrentConsentValuesAuditExtractorTest.java | 1 +
.../context/impl/AttributeReleaseContextTest.java | 1 +
.../consent/context/impl/ConsentContextTest.java | 1 +
.../impl/AbstractAttributeReleaseActionTest.java | 9 +-
.../impl/AttributeReleaseFlowDescriptorTest.java | 1 +
.../InitializeAttributeReleaseContextTest.java | 1 +
.../impl/PopulateAttributeReleaseContextTest.java | 5 +-
.../flow/ar/impl/ReleaseAttributesTest.java | 3 +-
.../flow/impl/AbstractConsentActionTest.java | 5 +
.../idp/consent/flow/impl/ExtractConsentTest.java | 1 +
.../flow/impl/InitializeConsentContextTest.java | 1 +
.../flow/impl/PopulateConsentContextTest.java | 1 +
.../AbstractConsentIndexedStorageActionTest.java | 1 +
.../impl/CreateGlobalConsentResultTest.java | 4 +-
.../storage/impl/ReadConsentFromStorageTest.java | 1 +
.../flow/storage/impl/RevokeConsentTest.java | 1 +
.../flow/storage/impl/UpdateCounterTest.java | 1 +
.../shibboleth/idp/consent/impl/ConsentTest.java | 1 +
.../consent/logic/impl/AttributePredicateTest.java | 1 +
.../impl/AttributeValueLookupFunctionTest.java | 9 +-
.../impl/AttributeValuesHashFunctionTest.java | 1 +
.../impl/CounterStorageKeyComparatorTest.java | 1 +
.../logic/impl/CounterStorageKeyFunctionTest.java | 1 +
.../impl/FlowDescriptorLookupFunctionTest.java | 1 +
.../logic/impl/FlowIdLookupFunctionTest.java | 1 +
.../impl/GlobalAttributeConsentPredicateTest.java | 1 +
.../logic/impl/IsConsentRequiredPredicateTest.java | 1 +
.../idp/consent/logic/impl/JoinFunctionTest.java | 1 +
.../impl/MessageSourceConsentFunctionTest.java | 1 +
.../impl/PreferExplicitOrderComparatorTest.java | 1 +
.../storage/impl/CollectionSerializerTest.java | 4 +-
.../storage/impl/ConsentSerializerTest.java | 1 +
idp-profile-api/pom.xml | 4 +
.../net/shibboleth/idp/profile/IdPEventIds.java | 2 +-
.../config/logic/DetailedErrorsPredicate.java | 8 +-
.../config/logic/ResolveAttributesPredicate.java | 2 +-
...ntTLSValidationConfigurationLookupFunction.java | 26 +-
.../DecryptionConfigurationLookupFunction.java | 26 +-
.../EncryptionConfigurationLookupFunction.java | 26 +-
...IdentifierGenerationStrategyLookupFunction.java | 24 +-
.../navigate/InboundFlowsLookupFunction.java | 2 +-
.../navigate/OutboundFlowsLookupFunction.java | 2 +-
...ignatureSigningConfigurationLookupFunction.java | 28 +-
...atureValidationConfigurationLookupFunction.java | 28 +-
...pClientSecurityConfigurationLookupFunction.java | 31 +-
...ignatureSigningConfigurationLookupFunction.java | 29 +-
...atureValidationConfigurationLookupFunction.java | 29 +-
.../profile/context/MultiRelyingPartyContext.java | 8 +-
.../idp/profile/context/RelyingPartyContext.java | 228 --------------
.../AbstractRelyingPartyLookupFunction.java | 2 +-
.../RelyingPartyContextLookupByCurrent.java | 2 +-
.../navigate/RelyingPartyContextLookupById.java | 2 +-
.../navigate/RelyingPartyContextLookupByLabel.java | 2 +-
.../navigate/RelyingPartyIdLookupFunction.java | 4 +-
.../navigate/ResponderIdLookupFunction.java | 8 +-
.../AbstractRelyingPartyLookupFunction.java | 2 +-
.../profile/logic/AbstractAttributePredicate.java | 2 +-
.../logic/AbstractRelyingPartyPredicate.java | 2 +-
.../idp/profile/logic/LoopDetectionPredicate.java | 10 +-
.../idp/profile/logic/RelyingPartyIdPredicate.java | 7 +-
.../profile/logic/VerifiedProfilePredicate.java | 4 +-
.../messaging/AbstractRelyingPartyPredicate.java | 2 +-
.../CriteriaRelyingPartyConfigurationResolver.java | 44 ---
.../relyingparty/RelyingPartyConfiguration.java | 117 +------
.../RelyingPartyConfigurationResolver.java | 44 ---
.../profile/logic/DateAttributePredicateTest.java | 3 +-
.../logic/DynamicAttributePredicateTest.java | 3 +-
.../profile/logic/LoopDetectionPredicateTest.java | 5 +-
.../profile/logic/RelyingPartyIdPredicateTest.java | 12 +-
.../idp/profile/logic/ScriptedPredicateTest.java | 9 +-
.../logic/SimpleAttributePredicateTest.java | 4 +-
.../shibboleth/idp/profile/logic/inlineBean.xml | 2 +-
.../net/shibboleth/idp/profile/logic/script.js | 2 +-
idp-profile-impl/pom.xml | 9 +-
.../audit/impl/AttributesAuditExtractor.java | 2 +-
.../idp/profile/impl/FilterAttributes.java | 2 +-
.../idp/profile/impl/ResolveAttributes.java | 2 +-
.../profile/impl/SelectProfileConfiguration.java | 4 +-
.../impl/SelectRelyingPartyConfiguration.java | 73 ++---
.../messaging/impl/SelectProfileConfiguration.java | 4 +-
.../impl/SelectRelyingPartyConfiguration.java | 25 +-
.../impl/CriteriaSelfEntityIDResolver.java | 60 ++--
.../DefaultRelyingPartyConfigurationResolver.java | 339 ---------------------
...gCriteriaRelyingPartyConfigurationResolver.java | 243 ---------------
.../impl/EncryptionCredentialsResolver.java | 10 +-
...ReloadingRelyingPartyConfigurationResolver.java | 113 -------
.../impl/SigningCredentialsResolver.java | 9 +-
.../impl/SelectProfileConfigurationTest.java | 2 +-
.../impl/SelectRelyingPartyConfigurationTest.java | 120 ++++++--
.../impl/FilterFlowsByNonBrowserSupportTest.java | 1 +
.../PopulateProfileInterceptorContextTest.java | 5 +
.../impl/ProfileInterceptorFlowDescriptorTest.java | 10 +-
.../impl/SelectProfileInterceptorFlowTest.java | 2 +-
...WriteProfileInterceptorResultToStorageTest.java | 1 +
...faultRelyingPartyConfigurationResolverTest.java | 210 -------------
.../impl/RelyingPartyConfigurationTest.java | 155 ----------
.../DetailedErrorsProfileConfigPredicate.java | 8 +-
.../logic/IncludeAttributeStatementPredicate.java | 2 +-
.../logic/NotBeforeProfileConfigPredicate.java | 2 +-
.../config/logic/SignAssertionsPredicate.java | 2 +-
.../config/logic/SignRequestsPredicate.java | 2 +-
.../config/logic/SignResponsesPredicate.java | 2 +-
.../ClientTLSArtifactRequestsPredicate.java | 2 +-
.../ClientTLSSOAPLogoutRequestsPredicate.java | 2 +-
.../messaging/SignArtifactRequestsPredicate.java | 2 +-
.../messaging/SignSOAPLogoutRequestsPredicate.java | 2 +-
...itionalAudiencesForAssertionLookupFunction.java | 2 +-
.../navigate/AssertionLifetimeLookupFunction.java | 2 +-
.../AudienceRestrictionsLookupFunction.java | 2 +-
.../QualifiedNameIDFormatsLookupFunction.java | 2 +-
.../navigate/SessionLifetimeLookupFunction.java | 2 +-
.../SAMLMetadataContextLookupFunction.java | 2 +-
.../SAMLMetadataContextLookupFunction.java | 2 +-
.../logic/DefaultNameIdentifierFormatStrategy.java | 8 +-
.../config/logic/CheckAddressPredicate.java | 2 +-
.../logic/IgnoreRequestSignaturesPredicate.java | 2 +-
.../logic/IgnoreScopingProfileConfigPredicate.java | 2 +-
.../profile/config/logic/SOAPErrorPredicate.java | 2 +-
.../SuppressAuthenticatingAuthorityPredicate.java | 2 +-
.../MaximumTimeSinceAuthnLookupFunction.java | 2 +-
.../config/navigate/ProxyCountLookupFunction.java | 2 +-
.../navigate/ProxyRestrictionLookupFunction.java | 2 +-
idp-saml-impl/pom.xml | 8 +
.../impl/EncryptionAlgorithmAuditExtractor.java | 2 +-
.../InitializeRelyingPartyContextFromSAMLPeer.java | 2 +-
.../SAML2AuthnRequestsSignedSecurityHandler.java | 2 +-
...tributeSourcedSAML1NameIdentifierGenerator.java | 2 +-
.../impl/AttributeSourcedSAML2NameIDGenerator.java | 2 +-
.../impl/PersistentSAML2NameIDGenerator.java | 2 +-
.../impl/BaseAddAttributeStatementToAssertion.java | 2 +-
.../impl/InitializeAuthenticationContext.java | 2 +-
.../impl/InitializeOutboundMessageContext.java | 2 +-
.../InitializeOutboundMessageContextForError.java | 2 +-
.../InitializeRelyingPartyContextFromSAMLPeer.java | 2 +-
.../impl/PopulateBindingAndEndpointContexts.java | 2 +-
.../impl/SAMLRelyingPartyIdLookupStrategy.java | 4 +-
.../impl/SAMLVerificationLookupStrategy.java | 4 +-
.../impl/AddAttributeStatementToAssertion.java | 2 +-
.../impl/FilterByQueriedAttributeDesignators.java | 2 +-
.../impl/AddAttributeStatementToAssertion.java | 2 +-
.../saml/saml2/profile/impl/AddAuthnRequest.java | 2 +-
.../profile/impl/FilterByQueriedAttributes.java | 2 +-
.../profile/impl/PopulateEncryptionParameters.java | 2 +-
.../profile/impl/ProcessRequestedAuthnContext.java | 2 +-
.../profile/impl/ValidateSAMLAuthentication.java | 2 +-
.../impl/SAML1SPSessionCreationStrategy.java | 2 +-
.../impl/SAML2SPSessionCreationStrategy.java | 2 +-
.../profile/impl/tests/FilterAttributesTest.java | 2 +-
.../profile/impl/tests/ResolveAttributesTest.java | 39 ++-
... => RelyingPartyConfigurationResolverTest.java} | 115 ++++---
...uteSourcedSAML1NameIdentifierGeneratorTest.java | 21 +-
.../AttributeSourcedSAML2NameIDGeneratorTest.java | 17 +-
.../impl/CryptoTransientNameIDDecoderTest.java | 3 +-
.../CryptoTransientNameIdentifierDecoderTest.java | 3 +-
...oTransientSAML1NameIdentifierGeneratorTest.java | 6 +-
.../CryptoTransientSAML2NameIDGeneratorTest.java | 6 +-
.../nameid/impl/NameIDCanonicalizationTest.java | 1 +
.../impl/NameIdentifierCanonicalizationTest.java | 1 +
.../impl/PersistentSAML2NameIDGeneratorTest.java | 3 +-
.../nameid/impl/StoredPersistentIdDecoderTest.java | 3 +-
...dTransientSAML1NameIdentifierGeneratorTest.java | 6 +-
.../StoredTransientSAML2NameIDGeneratorTest.java | 6 +-
.../saml/nameid/impl/TransformingDecoderTest.java | 1 +
.../idp/saml/nameid/impl/TransientDecoderTest.java | 1 +
.../impl/ExtractSubjectFromRequestTest.java | 1 +
.../FinalizeSAMLSubjectCanonicalizationTest.java | 1 +
.../impl/InitializeAuthenticationContextTest.java | 7 +-
...itializeOutboundMessageContextForErrorTest.java | 3 +-
.../impl/InitializeOutboundMessageContextTest.java | 3 +-
...tializeRelyingPartyContextFromSAMLPeerTest.java | 3 +-
.../PopulateBindingAndEndpointContextsTest.java | 3 +-
.../DefaultNameIdentifierFormatStrategyTest.java | 1 +
.../logic/tests/EntityAttributesPredicateTest.java | 1 +
.../impl/AddAttributeStatementToAssertionTest.java | 2 +-
.../AddAuthenticationStatementToAssertionTest.java | 9 +-
.../FilterByQueriedAttributeDesignatorsTest.java | 9 +-
.../IdPInitiatedSSORequestMessageDecoderTest.java | 1 +
...ultAuthenticationMethodsLookupFunctionTest.java | 1 +
.../tests/ProxyRestrictionLookupFunctionTest.java | 5 +-
.../impl/AddAttributeStatementToAssertionTest.java | 2 +-
.../saml2/profile/impl/AddAuthnRequestTest.java | 8 +-
.../impl/AddAuthnStatementToAssertionTest.java | 2 +-
.../impl/FilterByQueriedAttributesTest.java | 3 +-
.../IdPInitiatedSSORequestMessageDecoderTest.java | 1 +
.../impl/PopulateEncryptionParametersTest.java | 3 +-
.../ProcessAssertionsForAuthenticationTest.java | 64 ++--
.../profile/impl/ProcessLogoutRequestTest.java | 1 +
.../impl/ProcessRequestedAuthnContextTest.java | 3 +-
.../profile/impl/SessionManagerBaseTestCase.java | 1 +
.../impl/PrepareInboundMessageContextTest.java | 1 +
.../session/impl/SAML2SPSessionSerializerTest.java | 1 +
.../impl/BasicSPSessionCreationStrategy.java | 2 +-
.../idp/session/impl/DetectIdentitySwitch.java | 1 -
.../PopulateMultiRPContextFromLogoutContext.java | 2 +-
.../impl/RestoreProfileRequestContextTree.java | 2 +-
.../impl/SaveProfileRequestContextTree.java | 2 +-
.../spring/logic/RelyingPartyIdPredicateTest.java | 6 +-
.../idp/profile/testing/RequestContextBuilder.java | 4 +-
.../profile/testing/SAML1ActionTestingSupport.java | 4 +-
.../profile/testing/SAML2ActionTestingSupport.java | 4 +-
.../profile/testing/SAML1ActionSupportTest.java | 10 +-
.../profile/testing/SAML2ActionSupportTest.java | 6 +-
289 files changed, 951 insertions(+), 2111 deletions(-)
diff --git a/idp-admin-impl/src/main/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTree.java b/idp-admin-impl/src/main/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTree.java
index f369621ff..ac4603b57 100644
--- a/idp-admin-impl/src/main/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTree.java
+++ b/idp-admin-impl/src/main/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTree.java
@@ -29,8 +29,8 @@ import org.slf4j.Logger;
import net.shibboleth.idp.admin.AdministrativeFlowDescriptor;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.ui.context.RelyingPartyUIContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.primitive.NonnullSupplier;
diff --git a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
index 1cdd3e945..e1e1fea54 100644
--- a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
+++ b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/DoStorageOperationTest.java
@@ -44,7 +44,6 @@ import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.primitive.NonnullSupplier;
import net.shibboleth.shared.testing.ConstantSupplier;
/**
diff --git a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTreeTest.java b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTreeTest.java
index fbe19d229..42cb7157c 100644
--- a/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTreeTest.java
+++ b/idp-admin-impl/src/test/java/net/shibboleth/idp/admin/impl/InitializeAdministrativeProfileContextTreeTest.java
@@ -29,11 +29,11 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.admin.BasicAdministrativeFlowDescriptor;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.ui.context.RelyingPartyUIContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.primitive.LangBearingString;
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java
index d9aca52ff..f07d556ba 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java
@@ -23,9 +23,9 @@ import java.util.Collections;
import javax.annotation.Nullable;
import net.shibboleth.idp.authn.config.AuthenticationProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/ForceAuthnProfileConfigPredicate.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/ForceAuthnProfileConfigPredicate.java
index fbebd5e1f..93be7dd09 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/ForceAuthnProfileConfigPredicate.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/ForceAuthnProfileConfigPredicate.java
@@ -20,9 +20,9 @@ package net.shibboleth.idp.authn.config.navigate;
import javax.annotation.Nullable;
import net.shibboleth.idp.authn.config.AuthenticationProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.opensaml.profile.context.ProfileRequestContext;
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java
index 601c3f303..576b0e4b4 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java
@@ -23,9 +23,9 @@ import java.util.Collections;
import javax.annotation.Nullable;
import net.shibboleth.idp.authn.config.AuthenticationProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java
index 2b6d4293e..35a20d487 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/context/AuthenticationContext.java
@@ -40,7 +40,7 @@ import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
import net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry;
import net.shibboleth.idp.authn.principal.PrincipalSupportingComponent;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonNegative;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/principal/ProxyAuthenticationPrincipal.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/principal/ProxyAuthenticationPrincipal.java
index bf5b5a880..70b9cb670 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/principal/ProxyAuthenticationPrincipal.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/principal/ProxyAuthenticationPrincipal.java
@@ -32,8 +32,8 @@ import javax.annotation.Nullable;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.idp.authn.config.AuthenticationProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonNegative;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java
index 8fc889f77..a292735bb 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExternalAuthenticationImpl.java
@@ -38,7 +38,7 @@ import net.shibboleth.idp.authn.ExternalAuthenticationException;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.ExternalAuthenticationContext;
import net.shibboleth.idp.consent.context.ConsentManagementContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FinalizeAuthentication.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FinalizeAuthentication.java
index 651e64e09..4b4274cf3 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FinalizeAuthentication.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FinalizeAuthentication.java
@@ -17,7 +17,6 @@
package net.shibboleth.idp.authn.impl;
-
import java.security.Principal;
import java.util.ArrayList;
import java.util.Collections;
@@ -44,8 +43,8 @@ import net.shibboleth.idp.authn.principal.PrincipalEvalPredicate;
import net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactory;
import net.shibboleth.idp.authn.principal.PrincipalSupportingComponent;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.context.SessionContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.primitive.LoggerFactory;
/**
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java
index 96d0c8ead..8a0c06f81 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java
@@ -34,8 +34,8 @@ import net.shibboleth.idp.authn.config.AuthenticationProfileConfiguration;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategy.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategy.java
index cb31c4980..79855422d 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategy.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategy.java
@@ -27,8 +27,8 @@ import javax.security.auth.Subject;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.ParameterName;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.collection.Pair;
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java
index 16c287ab8..a62749f5c 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/proxy/impl/DiscoveryProfileRequestFunction.java
@@ -32,7 +32,8 @@ import com.google.common.escape.Escaper;
import com.google.common.net.UrlEscapers;
import net.shibboleth.idp.authn.context.AuthenticationContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.collection.Pair;
import net.shibboleth.shared.component.AbstractInitializableComponent;
@@ -113,7 +114,11 @@ public class DiscoveryProfileRequestFunction extends AbstractInitializableCompon
final String baseURL = discoveryURLLookupStrategy.apply(input.getSecond());
Constraint.isNotEmpty(baseURL, "Discovery URL cannot be null or empty");
- final String entityID = rpCtx.getConfiguration().getResponderId(input.getSecond());
+ final RelyingPartyConfiguration rpConfig = rpCtx.getConfiguration();
+ Constraint.isTrue(rpConfig instanceof net.shibboleth.idp.relyingparty.RelyingPartyConfiguration,
+ "RelyingPartyConfiguration was not of expected subclass");
+ final String entityID = ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpConfig).getResponderId(
+ input.getSecond());
final StringBuilder builder = new StringBuilder(baseURL);
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java
index a4ed9f14c..bea1fdb8d 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/FinalizeAuthenticationTest.java
@@ -33,9 +33,9 @@ import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
import net.shibboleth.idp.authn.principal.impl.ExactPrincipalEvalPredicateFactory;
import net.shibboleth.idp.authn.testing.TestPrincipal;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
@@ -44,6 +44,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link FinalizeAuthentication} unit test. */
+ at SuppressWarnings("javadoc")
public class FinalizeAuthenticationTest extends BaseAuthenticationContextTest {
private FinalizeAuthentication action;
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContextTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContextTest.java
index a30d0650c..1b5ca896e 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContextTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContextTest.java
@@ -29,7 +29,7 @@ import net.shibboleth.idp.profile.IdPEventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.MockProfileConfiguration;
@@ -51,6 +51,11 @@ public class InitializeRequestedPrincipalContextTest {
private InitializeRequestedPrincipalContext action;
+ /**
+ * Test setup.
+ *
+ * @throws ComponentInitializationException
+ */
@BeforeMethod
public void setUp() throws ComponentInitializationException {
src = new RequestContextBuilder().buildRequestContext();
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategyTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategyTest.java
index 15af504d3..b2a5740aa 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategyTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/RelyingPartyMapJAASLoginConfigStrategyTest.java
@@ -27,10 +27,11 @@ import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.Pair;
import net.shibboleth.shared.logic.ConstraintViolationException;
+ at SuppressWarnings("javadoc")
public class RelyingPartyMapJAASLoginConfigStrategyTest {
private static final String DEFAULT_JAAS_CONFIG = "ShibUserPassAuth";
@@ -49,7 +50,7 @@ public class RelyingPartyMapJAASLoginConfigStrategyTest {
public void setUp() {
profileRequestContext = new ProfileRequestContext();
- relyingPartyContext = profileRequestContext.getSubcontext(RelyingPartyContext.class, true);
+ relyingPartyContext = profileRequestContext.getOrCreateSubcontext(RelyingPartyContext.class);
relyingPartyContext.setRelyingPartyId(entityID);
rpMap = new HashMap<>();
diff --git a/idp-cas-api/src/main/java/net/shibboleth/idp/cas/config/ConfigLookupFunction.java b/idp-cas-api/src/main/java/net/shibboleth/idp/cas/config/ConfigLookupFunction.java
index f7af1aa7e..ae94f8a8b 100644
--- a/idp-cas-api/src/main/java/net/shibboleth/idp/cas/config/ConfigLookupFunction.java
+++ b/idp-cas-api/src/main/java/net/shibboleth/idp/cas/config/ConfigLookupFunction.java
@@ -21,10 +21,10 @@ import java.util.function.Function;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-
import org.opensaml.profile.context.ProfileRequestContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+
/**
* Lookup function for extracting CAS profile configuration from the profile request context.
*
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextAction.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextAction.java
index 441cd94fd..18d7a9bb8 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextAction.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextAction.java
@@ -33,12 +33,13 @@ import net.shibboleth.idp.cas.protocol.ServiceTicketRequest;
import net.shibboleth.idp.cas.protocol.TicketValidationRequest;
import net.shibboleth.idp.cas.service.Service;
import net.shibboleth.idp.cas.service.ServiceRegistry;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
+
/**
* Creates the {@link RelyingPartyContext} as a child of the {@link ProfileRequestContext}. The component queries
* a configured list of {@link ServiceRegistry} until a result is found, otherwise the relying party is treated as
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextAction.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextAction.java
index d99750847..4f49c17e1 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextAction.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextAction.java
@@ -30,7 +30,7 @@ import net.shibboleth.idp.cas.protocol.ProtocolError;
import net.shibboleth.idp.cas.service.Service;
import net.shibboleth.idp.cas.service.impl.ServiceEntityDescriptor;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
/**
* Builds a {@link SAMLMetadataContext} child of {@link RelyingPartyContext} to facilitate relying party selection
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketAction.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketAction.java
index b2730f369..949910c19 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketAction.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketAction.java
@@ -32,8 +32,6 @@ import org.slf4j.Logger;
import net.shibboleth.shared.primitive.LoggerFactory;
-import com.google.common.base.Predicates;
-
import net.shibboleth.idp.cas.config.ConfigLookupFunction;
import net.shibboleth.idp.cas.config.ProxyConfiguration;
import net.shibboleth.idp.cas.protocol.ProtocolError;
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketAction.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketAction.java
index a31b18be4..fb2c4303b 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketAction.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketAction.java
@@ -46,9 +46,9 @@ import net.shibboleth.idp.cas.ticket.ServiceTicket;
import net.shibboleth.idp.cas.ticket.TicketService;
import net.shibboleth.idp.cas.ticket.TicketState;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.IdPSession;
import net.shibboleth.idp.session.context.SessionContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java
index e1ad6babd..b145aedb1 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java
@@ -52,7 +52,7 @@ import net.shibboleth.idp.cas.protocol.TicketValidationResponse;
import net.shibboleth.idp.cas.ticket.TicketPrincipalLookupFunction;
import net.shibboleth.idp.cas.ticket.TicketState;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java
index 9077877c0..4b569ea08 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASDateTimeAttributeTranscoderTest.java
@@ -46,6 +46,7 @@ import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.MockApplicationContext;
/** {@link CASDateTimeAttributeTranscoder} unit test. */
+ at SuppressWarnings("javadoc")
public class CASDateTimeAttributeTranscoderTest {
private AttributeTranscoderRegistryImpl registry;
@@ -53,9 +54,7 @@ public class CASDateTimeAttributeTranscoderTest {
private final static String ATTR_ID = "foo";
private final static String ATTR_NAME = "bar";
private final static String STRING_SECS = "1659979872";
- private final static String STRING_MSECS = "1659979872969";
private final static String STRING_ISO = "2022-08-08T17:31:12.969Z";
- private final static String STRING_INVALID = "invalid";
@BeforeClass public void setUp() throws ComponentInitializationException {
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java
index 2b769239e..73d9ed3fc 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASScopedStringAttributeTranscoderTest.java
@@ -48,6 +48,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
/** {@link CASScopedStringAttributeTranscoder} unit test. */
+ at SuppressWarnings("javadoc")
public class CASScopedStringAttributeTranscoderTest {
private AttributeTranscoderRegistryImpl registry;
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
index fa0ebf4f2..f45816f44 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
@@ -47,6 +47,7 @@ import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.MockApplicationContext;
/** {@link CASStringAttributeTranscoder} unit test. */
+ at SuppressWarnings("javadoc")
public class CASStringAttributeTranscoderTest {
private AttributeTranscoderRegistryImpl registry;
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/AbstractFlowActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/AbstractFlowActionTest.java
index 3dc573f6f..fdb5615f2 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/AbstractFlowActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/AbstractFlowActionTest.java
@@ -24,7 +24,6 @@ import java.util.Arrays;
import java.util.HashSet;
import javax.crypto.SecretKey;
-import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.SecretKeySpec;
import net.shibboleth.idp.authn.AuthenticationResult;
import net.shibboleth.idp.cas.ticket.ProxyGrantingTicket;
@@ -153,18 +152,21 @@ public abstract class AbstractFlowActionTest extends AbstractTestNGSpringContext
/** Static key. */
private final SecretKey key;
+ /**
+ * Constructor.
+ */
public MockDataSealerKeyStrategy() {
final byte[] bytes = new byte[32];
new SecureRandom().nextBytes(bytes);
key = new SecretKeySpec(bytes, "AES");
}
- @Override
+ /** {@inheritDoc} */
public Pair<String, SecretKey> getDefaultKey() throws KeyException {
return new Pair<>("default", key);
}
- @Override
+ /** {@inheritDoc} */
public SecretKey getKey(final String s) throws KeyException {
return key;
}
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildProxyChainActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildProxyChainActionTest.java
index 9cb671910..6218347f6 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildProxyChainActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildProxyChainActionTest.java
@@ -35,6 +35,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class BuildProxyChainActionTest extends AbstractFlowActionTest {
@Autowired
private BuildProxyChainAction action;
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextActionTest.java
index 26459aea7..6676641b7 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildRelyingPartyContextActionTest.java
@@ -30,6 +30,7 @@ import static org.testng.Assert.*;
import org.opensaml.profile.action.EventException;
+ at SuppressWarnings("javadoc")
public class BuildRelyingPartyContextActionTest extends AbstractFlowActionTest {
@Autowired
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextActionTest.java
index 3ffafd003..7e8831309 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/BuildSAMLMetadataContextActionTest.java
@@ -36,6 +36,7 @@ import static org.testng.Assert.*;
* Unit test for {@link BuildSAMLMetadataContextAction}.
*
*/
+ at SuppressWarnings("javadoc")
public class BuildSAMLMetadataContextActionTest extends AbstractFlowActionTest {
@Autowired
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/CheckProxyAuthorizationActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/CheckProxyAuthorizationActionTest.java
index 9a5699e9f..638dfbd56 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/CheckProxyAuthorizationActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/CheckProxyAuthorizationActionTest.java
@@ -31,6 +31,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class CheckProxyAuthorizationActionTest extends AbstractFlowActionTest {
@Autowired
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketActionTest.java
index 9eae9c8ef..566e8b42b 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantProxyTicketActionTest.java
@@ -33,6 +33,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class GrantProxyTicketActionTest extends AbstractFlowActionTest {
@Autowired
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketActionTest.java
index e5c5b2079..d3506f423 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/GrantServiceTicketActionTest.java
@@ -35,6 +35,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class GrantServiceTicketActionTest extends AbstractFlowActionTest {
@Autowired
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/PublishProtocolResponseActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/PublishProtocolResponseActionTest.java
index eda1f8651..f37e33bb2 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/PublishProtocolResponseActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/PublishProtocolResponseActionTest.java
@@ -31,6 +31,7 @@ import static org.testng.Assert.assertNotNull;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class PublishProtocolResponseActionTest extends AbstractFlowActionTest {
@Test
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/TestContextBuilder.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/TestContextBuilder.java
index ab2c89a7a..8ef88c5ba 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/TestContextBuilder.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/TestContextBuilder.java
@@ -25,10 +25,10 @@ import net.shibboleth.idp.cas.service.Service;
import net.shibboleth.idp.cas.service.ServiceContext;
import net.shibboleth.idp.cas.ticket.Ticket;
import net.shibboleth.idp.cas.ticket.TicketContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.IdPSession;
import net.shibboleth.idp.session.context.SessionContext;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.opensaml.profile.context.ProfileRequestContext;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -42,6 +42,7 @@ import org.springframework.webflow.test.MockRequestContext;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class TestContextBuilder {
/** Root of context tree for our tests. */
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackActionTest.java
index ec056a620..07788ba2a 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateProxyCallbackActionTest.java
@@ -40,6 +40,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class ValidateProxyCallbackActionTest extends AbstractFlowActionTest {
@Test
@@ -87,4 +88,5 @@ public class ValidateProxyCallbackActionTest extends AbstractFlowActionTest {
.build();
return context;
}
-}
+
+}
\ No newline at end of file
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateRenewActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateRenewActionTest.java
index a1b0ace52..04c6d6c05 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateRenewActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateRenewActionTest.java
@@ -34,6 +34,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class ValidateRenewActionTest extends AbstractFlowActionTest {
private static final String TEST_SERVICE = "https://example.com/widget";
@@ -88,4 +89,5 @@ public class ValidateRenewActionTest extends AbstractFlowActionTest {
.build();
assertNull(action.execute(context));
}
+
}
\ No newline at end of file
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateTicketActionTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateTicketActionTest.java
index 068d67c6d..12c864bfa 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateTicketActionTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/flow/impl/ValidateTicketActionTest.java
@@ -43,6 +43,7 @@ import net.shibboleth.shared.component.ComponentInitializationException;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class ValidateTicketActionTest extends AbstractFlowActionTest {
private static final String TEST_SERVICE = "https://example.com/widget";
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java
index d30a2380d..58d1e117b 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java
@@ -52,6 +52,7 @@ import net.shibboleth.idp.cas.service.ServiceContext;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class HttpClientProxyValidatorTest extends AbstractFlowActionTest {
@Autowired
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java
index 40f8788fe..3bedf5038 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/service/impl/MetadataServiceRegistryTest.java
@@ -47,6 +47,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class MetadataServiceRegistryTest {
private ResourceBackedMetadataResolver metadataResolver;
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/session/impl/CASSPSessionSerializerTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/session/impl/CASSPSessionSerializerTest.java
index 6f6b2b04f..b4132e937 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/session/impl/CASSPSessionSerializerTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/session/impl/CASSPSessionSerializerTest.java
@@ -24,6 +24,7 @@ import static org.testng.Assert.assertEquals;
import java.time.Duration;
import java.time.Instant;
+ at SuppressWarnings("javadoc")
public class CASSPSessionSerializerTest {
private CASSPSessionSerializer serializer = new CASSPSessionSerializer(Duration.ZERO);
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/EncodingTicketServiceTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/EncodingTicketServiceTest.java
index f3f192cf2..63375a474 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/EncodingTicketServiceTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/EncodingTicketServiceTest.java
@@ -45,6 +45,7 @@ import static org.testng.Assert.*;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class EncodingTicketServiceTest {
private EncodingTicketService ticketService;
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/SimpleTicketServiceTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/SimpleTicketServiceTest.java
index 4f9ed6ac9..f51d55da2 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/SimpleTicketServiceTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/SimpleTicketServiceTest.java
@@ -36,6 +36,7 @@ import java.time.temporal.ChronoUnit;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class SimpleTicketServiceTest {
private static final String TEST_SESSION_ID = "jHXRo42W0ATPEN+X5Zk1cw==";
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyGrantingTicketSerializerTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyGrantingTicketSerializerTest.java
index 363285e0d..19261fc7d 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyGrantingTicketSerializerTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyGrantingTicketSerializerTest.java
@@ -29,6 +29,7 @@ import java.time.temporal.ChronoUnit;
/**
* Unit test for {@link ProxyGrantingTicketSerializer}.
*/
+ at SuppressWarnings("javadoc")
public class ProxyGrantingTicketSerializerTest {
private ProxyGrantingTicketSerializer serializer = new ProxyGrantingTicketSerializer();
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyTicketSerializerTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyTicketSerializerTest.java
index 8cc3700d1..fb8de7fb8 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyTicketSerializerTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ProxyTicketSerializerTest.java
@@ -29,6 +29,7 @@ import java.time.temporal.ChronoUnit;
/**
* Unit test for {@link ProxyTicketSerializer}.
*/
+ at SuppressWarnings("javadoc")
public class ProxyTicketSerializerTest {
private ProxyTicketSerializer serializer = new ProxyTicketSerializer();
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ServiceTicketSerializerTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ServiceTicketSerializerTest.java
index 38aa87d5b..85c86aa4c 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ServiceTicketSerializerTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/serialization/impl/ServiceTicketSerializerTest.java
@@ -27,12 +27,11 @@ import static org.testng.Assert.*;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
-import java.util.Collections;
-import java.util.Set;
/**
* Unit test for {@link ServiceTicketSerializer}.
*/
+ at SuppressWarnings("javadoc")
public class ServiceTicketSerializerTest {
private ServiceTicketSerializer serializer = new ServiceTicketSerializer();
@@ -100,7 +99,7 @@ public class ServiceTicketSerializerTest {
true);
final TicketState state = new TicketState("idpsess-d2db22058dc178d3b917363859e", "bob",
Instant.now().truncatedTo(ChronoUnit.MILLIS), "Password");
- state.setConsentedAttributeIds(Collections.emptySet());
+ state.setConsentedAttributeIds(CollectionSupport.emptySet());
st1.setTicketState(state);
final String serialized = serializer.serialize(st1);
final ServiceTicket st2 = serializer.deserialize(1, "notused", st1.getId(), serialized, null);
diff --git a/idp-cli/.gitignore b/idp-cli/.gitignore
index ea8c4bf7f..b3229413e 100644
--- a/idp-cli/.gitignore
+++ b/idp-cli/.gitignore
@@ -1 +1,2 @@
/target
+/test-output
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/functions.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/functions.xml
index f16530a07..b6db12bdf 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/functions.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/functions.xml
@@ -73,7 +73,7 @@
<bean id="shibboleth.ChildLookup.RelyingParty"
class="org.opensaml.messaging.context.navigate.ChildContextLookup"
- c:type="#{ T(net.shibboleth.idp.profile.context.RelyingPartyContext) }" />
+ c:type="#{ T(net.shibboleth.profile.context.RelyingPartyContext) }" />
<bean id="shibboleth.ChildLookup.MultiRelyingParty"
class="org.opensaml.messaging.context.navigate.ChildContextLookup"
c:type="#{ T(net.shibboleth.idp.profile.context.MultiRelyingPartyContext) }" />
@@ -103,7 +103,7 @@
c:createContext="true" />
<bean id="shibboleth.ChildLookupOrCreate.RelyingPartyContext"
class="org.opensaml.messaging.context.navigate.ChildContextLookup"
- c:type="#{ T(net.shibboleth.idp.profile.context.RelyingPartyContext) }"
+ c:type="#{ T(net.shibboleth.profile.context.RelyingPartyContext) }"
c:createContext="true" />
<bean id="shibboleth.ChildLookupOrCreate.RelyingPartyUIContext"
class="org.opensaml.messaging.context.navigate.ChildContextLookup"
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml
index 07e46af7a..1ce4f0207 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/relying-party-system.xml
@@ -18,7 +18,7 @@
<bean id="entityID" class="java.lang.String" c:_0="%{idp.entityID}" />
<!-- Pulls together the various components that feed the resolver. -->
- <bean class="net.shibboleth.idp.relyingparty.impl.DefaultRelyingPartyConfigurationResolver"
+ <bean class="net.shibboleth.profile.relyingparty.impl.DefaultRelyingPartyConfigurationResolver"
p:unverifiedConfiguration-ref="shibboleth.UnverifiedRelyingParty"
p:defaultConfiguration-ref="shibboleth.DefaultRelyingParty"
p:relyingPartyConfigurations-ref="shibboleth.RelyingPartyOverrides"
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/security-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/security-system.xml
index 3d3c66cd4..d77cb8d79 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/security-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/security-system.xml
@@ -66,19 +66,19 @@
<bean id="shibboleth.SignatureValidationConfigurationLookup" lazy-init="true"
class="net.shibboleth.idp.profile.config.navigate.SignatureValidationConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="shibboleth.SignatureSigningConfigurationLookup" lazy-init="true"
class="net.shibboleth.idp.profile.config.navigate.SignatureSigningConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="shibboleth.DecryptionConfigurationLookup" lazy-init="true"
class="net.shibboleth.idp.profile.config.navigate.DecryptionConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="shibboleth.EncryptionConfigurationLookup" lazy-init="true"
class="net.shibboleth.idp.profile.config.navigate.EncryptionConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="shibboleth.ClientTLSValidationConfigurationLookup" lazy-init="true"
class="net.shibboleth.idp.profile.config.navigate.ClientTLSValidationConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<!-- Beans that implement the mashing of security configurations into final parameter sets. -->
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml
index 9eb2afbf5..55a087d62 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml
@@ -134,10 +134,10 @@
p:serviceConfigurations-ref="ExtendedRelyingPartyResolverResources"
p:failFast="%{idp.service.relyingparty.failFast:%{idp.service.failFast:false}}"
p:reloadCheckDelay="%{idp.service.relyingparty.checkInterval:PT0S}">
- <constructor-arg name="claz" value="net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver" />
+ <constructor-arg name="claz" value="net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver" />
<constructor-arg name="strategy">
<bean class="net.shibboleth.shared.spring.service.ClassBasedServiceStrategy"
- c:serviceableClaz="net.shibboleth.idp.relyingparty.impl.DefaultRelyingPartyConfigurationResolver" />
+ c:serviceableClaz="net.shibboleth.profile.relyingparty.impl.DefaultRelyingPartyConfigurationResolver" />
</constructor-arg>
</bean>
<!-- Auto-append system config file to resource set. -->
@@ -229,14 +229,6 @@
These are proxies/facades that expose a service-unaware interface to client components.
Services without such facades are being consumed directly in a service-aware way.
-->
-
- <bean id="shibboleth.RelyingPartyConfigurationResolver"
- class="net.shibboleth.idp.relyingparty.impl.ReloadingRelyingPartyConfigurationResolver"
- c:resolverService-ref="shibboleth.RelyingPartyResolverService" />
-
- <bean id="shibboleth.CriteriaRelyingPartyConfigurationResolver"
- class="net.shibboleth.idp.relyingparty.impl.DelegatingCriteriaRelyingPartyConfigurationResolver"
- p:delegate-ref="shibboleth.RelyingPartyConfigurationResolver" />
<bean id="shibboleth.MetadataResolver"
class="net.shibboleth.idp.saml.metadata.impl.ReloadableMetadataResolver"
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/soap-client.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/soap-client.xml
index 22cc14767..02ec80050 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/soap-client.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/soap-client.xml
@@ -19,13 +19,13 @@
<bean id="shibboleth.MessageContext.SignatureValidationConfigurationLookup"
class="net.shibboleth.idp.profile.config.navigate.messaging.SignatureValidationConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="shibboleth.MessageContext.SignatureSigningConfigurationLookup"
class="net.shibboleth.idp.profile.config.navigate.messaging.SignatureSigningConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="shibboleth.MessageContext.HttpClientSecurityConfigurationLookup"
class="net.shibboleth.idp.profile.config.navigate.messaging.HttpClientSecurityConfigurationLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<!-- SOAP client and pipeline factory definitions. -->
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-beans.xml
index c5e315417..998c07f32 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-beans.xml
@@ -85,7 +85,7 @@
class="net.shibboleth.idp.profile.context.navigate.SpringExpressionContextLookupFunction"
c:inClass="#{T(org.opensaml.profile.context.ProfileRequestContext)}"
c:outputType="#{T(java.lang.String)}"
- c:expression="#input.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).getProfileConfig().getPolicyName(#input)" />
+ c:expression="#input.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getProfileConfig().getPolicyName(#input)" />
<!-- Default operation/resource suppliers for access checks. -->
<bean id="DefaultOperationLookupStrategy" parent="shibboleth.Functions.Constant">
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-flow.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-flow.xml
index 1129177de..d9ccc63dc 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-flow.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/admin-abstract-flow.xml
@@ -18,7 +18,7 @@
<transition on="proceed" to="CheckIfAuthenticationNeeded" />
<on-exit>
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext))" result="flowScope.relyingPartyContext" />
+ <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext))" result="flowScope.relyingPartyContext" />
</on-exit>
</action-state>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/hello-flow.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/hello-flow.xml
index 9c0ac558b..aba96d022 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/hello-flow.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/hello-flow.xml
@@ -32,7 +32,7 @@
<evaluate expression="environment" result="requestScope.environment" />
<evaluate expression="opensamlProfileRequestContext" result="requestScope.profileRequestContext" />
<evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.authn.context.SubjectContext))" result="requestScope.subjectContext" />
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).getSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext))" result="requestScope.attributeContext" />
+ <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext))" result="requestScope.attributeContext" />
<evaluate expression="T(net.shibboleth.shared.codec.HTMLEncoder)" result="requestScope.encoder" />
<evaluate expression="flowRequestContext.getExternalContext().getNativeRequest()" result="requestScope.request" />
<evaluate expression="flowRequestContext.getExternalContext().getNativeResponse()" result="requestScope.response" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-beans.xml
index f1309e399..f31314a8b 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-beans.xml
@@ -91,7 +91,7 @@
<bean id="SelectRelyingPartyConfiguration"
class="net.shibboleth.idp.profile.impl.SelectRelyingPartyConfiguration" scope="prototype"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="PostLookupPopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
p:fieldExtractors="#{getObject('shibboleth.PostLookupAuditExtractors') ?: getObject('shibboleth.DefaultPostLookupAuditExtractors')}" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-flow.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-flow.xml
index 119c697f5..750503a3b 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-flow.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/resolvertest-flow.xml
@@ -99,7 +99,7 @@
<evaluate expression="WriteAuditLog" />
<evaluate expression="environment" result="requestScope.environment" />
<evaluate expression="opensamlProfileRequestContext" result="requestScope.profileRequestContext" />
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext), true).getSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext))" result="requestScope.attributeContext" />
+ <evaluate expression="opensamlProfileRequestContext.getOrCreateSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext))" result="requestScope.attributeContext" />
<evaluate expression="T(org.opensaml.core.xml.util.XMLObjectSupport)" result="requestScope.XMLObjectSupport" />
<evaluate expression="T(net.shibboleth.shared.xml.SerializeSupport)" result="requestScope.SerializeSupport" />
<evaluate expression="T(net.shibboleth.shared.codec.HTMLEncoder)" result="requestScope.encoder" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/unlock-keys-flow.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/unlock-keys-flow.xml
index c88ec1bff..7f79ddf3e 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/unlock-keys-flow.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/admin/unlock-keys-flow.xml
@@ -28,7 +28,7 @@
</action-state>
<decision-state id="CheckIfDone">
- <if test="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).getProfileConfig().isFlowExecuted()"
+ <if test="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getProfileConfig().isFlowExecuted()"
then="end" else="PromptForPasswords" />
</decision-state>
@@ -59,7 +59,7 @@
<end-state id="end" view="admin/unlock-keys">
<on-entry>
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).getProfileConfig().setFlowExecuted(true)" />
+ <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getProfileConfig().setFlowExecuted(true)" />
<evaluate expression="WriteAuditLog" />
<evaluate expression="environment" result="requestScope.environment" />
<evaluate expression="opensamlProfileRequestContext" result="requestScope.profileRequestContext" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/saml-authn-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/saml-authn-beans.xml
index 8c450adef..999773682 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/saml-authn-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/saml-authn-beans.xml
@@ -95,7 +95,7 @@
<bean id="SelectRelyingPartyConfiguration"
class="net.shibboleth.idp.profile.impl.SelectRelyingPartyConfiguration" scope="prototype"
p:profileContextLookupStrategy-ref="shibboleth.ChildLookup.ProxyProfileRequestContext"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="PostLookupPopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
p:profileContextLookupStrategy-ref="shibboleth.ChildLookup.ProxyProfileRequestContext"
@@ -157,7 +157,7 @@
p:issuerLookupStrategy-ref="shibboleth.ResponderIdLookup.Simple">
<property name="identifierGeneratorLookupStrategy">
<bean class="net.shibboleth.idp.profile.config.navigate.IdentifierGenerationStrategyLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver"
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService"
p:defaultIdentifierGenerationStrategy-ref="shibboleth.DefaultIdentifierGenerationStrategy" />
</property>
</bean>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/cas/cas-abstract-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/cas/cas-abstract-beans.xml
index 5e6886ad9..86fc5727f 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/cas/cas-abstract-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/cas/cas-abstract-beans.xml
@@ -64,7 +64,7 @@
<bean id="SelectRelyingPartyConfiguration"
class="net.shibboleth.idp.profile.impl.SelectRelyingPartyConfiguration" scope="prototype"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="PopulateSubjectContext"
class="net.shibboleth.idp.profile.impl.PopulateSubjectContext" scope="prototype"
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/attribute-release-flow.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/attribute-release-flow.xml
index a480c5572..5f6c8b0b2 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/attribute-release-flow.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/attribute-release-flow.xml
@@ -192,7 +192,7 @@
<decision-state id="TestForDoNotRememberConsent">
<on-entry>
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).getSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext)).setConsented(requestParameters._shib_idp_consentOptions == '_shib_idp_doNotRememberConsent') " />
+ <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext)).setConsented(requestParameters._shib_idp_consentOptions == '_shib_idp_doNotRememberConsent') " />
</on-entry>
<if test="requestParameters._shib_idp_consentOptions == '_shib_idp_doNotRememberConsent'"
then="ReleaseAttributes" else="CreateResult" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/impersonate-flow.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/impersonate-flow.xml
index 41e8475ba..f97451464 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/impersonate-flow.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/impersonate-flow.xml
@@ -52,9 +52,9 @@
<action-state id="DoImpersonate">
<on-entry>
<!-- Clear existing attribute state. -->
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).removeSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext))" />
+ <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).removeSubcontext(T(net.shibboleth.idp.attribute.context.AttributeContext))" />
<!-- Log the impersonation. -->
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).getRelyingPartyId()" result="requestScope.relyingPartyId" />
+ <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getRelyingPartyId()" result="requestScope.relyingPartyId" />
<evaluate expression="T(org.slf4j.LoggerFactory).getLogger('net.shibboleth.idp.profile.interceptor').info('Impersonation by principal ''{}'' as ''{}'' to relying party ''{}''', new Object[]{subjectContext.getPrincipalName(), principalToSpoof, relyingPartyId})" />
<!-- Swap identities. -->
<evaluate expression="subjectContext.setImpersonatingPrincipalName(subjectContext.getPrincipalName())" />
@@ -72,7 +72,7 @@
<end-state id="ImpersonationViolation">
<on-entry>
<!-- Log violation. -->
- <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.profile.context.RelyingPartyContext)).getRelyingPartyId()" result="requestScope.relyingPartyId" />
+ <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.profile.context.RelyingPartyContext)).getRelyingPartyId()" result="requestScope.relyingPartyId" />
<evaluate expression="T(org.slf4j.LoggerFactory).getLogger('net.shibboleth.idp.profile.interceptor').warn('Unauthorized impersonation attempt by principal ''{}'' as ''{}'' to relying party ''{}''', new Object[]{subjectContext.getPrincipalName(), principalToSpoof, relyingPartyId})" />
</on-entry>
</end-state>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/logout/saml2-logoutprop-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/logout/saml2-logoutprop-beans.xml
index 8e635832a..d3bddee01 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/logout/saml2-logoutprop-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/logout/saml2-logoutprop-beans.xml
@@ -64,7 +64,7 @@
p:issuerLookupStrategy-ref="shibboleth.ResponderIdLookup.Simple">
<property name="identifierGeneratorLookupStrategy">
<bean class="net.shibboleth.idp.profile.config.navigate.IdentifierGenerationStrategyLookupFunction"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver"
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService"
p:defaultIdentifierGenerationStrategy-ref="shibboleth.DefaultIdentifierGenerationStrategy" />
</property>
</bean>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/saml-abstract-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/saml-abstract-beans.xml
index c564090f2..407096c98 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/saml-abstract-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/saml/saml-abstract-beans.xml
@@ -91,7 +91,7 @@
<bean id="SelectRelyingPartyConfiguration"
class="net.shibboleth.idp.profile.impl.SelectRelyingPartyConfiguration" scope="prototype"
- p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
<bean id="PostLookupPopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
p:fieldExtractors="#{getObject('shibboleth.PostLookupAuditExtractors') ?: getObject('shibboleth.DefaultPostLookupAuditExtractors')}" />
@@ -346,6 +346,6 @@
<bean id="ArtifactSupport.SelfEntityIDResolver"
class="net.shibboleth.idp.relyingparty.impl.CriteriaSelfEntityIDResolver"
- p:relyingPartyConfigurationResolver-ref="shibboleth.CriteriaRelyingPartyConfigurationResolver" />
+ p:relyingPartyConfigurationResolver-ref="shibboleth.RelyingPartyResolverService" />
</beans>
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java
index 859e8777b..7afffce3f 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java
@@ -84,8 +84,6 @@ import net.shibboleth.shared.spring.security.factory.X509CertificateFactoryBean;
import net.shibboleth.shared.testing.InMemoryDirectory;
import net.shibboleth.shared.xml.ParserPool;
-import static org.testng.Assert.assertEquals;
-
/**
* Abstract flow test.
*/
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/SetupForResolver.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/SetupForResolver.java
index b17b14607..133982721 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/SetupForResolver.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/SetupForResolver.java
@@ -22,8 +22,8 @@ import javax.annotation.Nonnull;
import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.opensaml.profile.action.ActionSupport;
@@ -34,15 +34,13 @@ public class SetupForResolver extends AbstractProfileAction {
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
- SubjectContext sc = profileRequestContext.getSubcontext(SubjectContext.class, true);
-
+ final SubjectContext sc = profileRequestContext.getSubcontext(SubjectContext.class, true);
sc.setPrincipalName("PETER_THE_PRINCIPAL");
- RelyingPartyContext rpContext = profileRequestContext.getSubcontext(RelyingPartyContext.class, true);
-
+ final RelyingPartyContext rpContext = profileRequestContext.getOrCreateSubcontext(RelyingPartyContext.class);
rpContext.setRelyingPartyId(AbstractFlowTest.SP_ENTITY_ID);
- RelyingPartyConfiguration config = new RelyingPartyConfiguration();
+ final RelyingPartyConfiguration config = new RelyingPartyConfiguration();
config.setId("test");
config.setResponderId(AbstractFlowTest.IDP_ENTITY_ID);
try {
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java
index 1c2bdd17a..ccb6409d0 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java
@@ -37,10 +37,11 @@ import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.idp.saml.authn.principal.NameIdentifierPrincipal;
import net.shibboleth.idp.saml.nameid.impl.TransientSAML1NameIdentifierGenerator;
import net.shibboleth.idp.saml.xml.SAMLConstants;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.primitive.StringSupport;
/**
@@ -120,7 +121,8 @@ public class SetupForSAML1C14N extends AbstractProfileAction {
profileRequestContext.getSubcontext(SubjectCanonicalizationContext.class, true);
scc.setSubject(sub);
scc.setRequesterId(rpc.getRelyingPartyId());
- scc.setResponderId(rpc.getConfiguration().getResponderId(profileRequestContext));
+ final RelyingPartyConfiguration rpConfig = (RelyingPartyConfiguration) rpc.getConfiguration();
+ scc.setResponderId(rpConfig.getResponderId(profileRequestContext));
}
}
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java
index c0cd640ea..36a1de5d9 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java
@@ -38,9 +38,10 @@ import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.idp.saml.authn.principal.NameIDPrincipal;
import net.shibboleth.idp.saml.nameid.impl.TransientSAML2NameIDGenerator;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.primitive.StringSupport;
/**
@@ -119,7 +120,8 @@ public class SetupForSAML2C14N extends AbstractProfileAction {
profileRequestContext.getSubcontext(SubjectCanonicalizationContext.class, true);
scc.setSubject(sub);
scc.setRequesterId(rpc.getRelyingPartyId());
- scc.setResponderId(rpc.getConfiguration().getResponderId(profileRequestContext));
+ final RelyingPartyConfiguration rpConfig = (RelyingPartyConfiguration) rpc.getConfiguration();
+ scc.setResponderId(rpConfig.getResponderId(profileRequestContext));
}
}
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java
index e76a060a7..f5ebb1891 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java
@@ -31,6 +31,7 @@ import java.util.regex.Pattern;
import javax.annotation.Nonnull;
import org.opensaml.profile.context.ProfileRequestContext;
+import org.opensaml.profile.criterion.ProfileRequestContextCriterion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.mock.web.MockHttpServletResponse;
@@ -51,15 +52,17 @@ import net.shibboleth.idp.cas.config.LoginConfiguration;
import net.shibboleth.idp.cas.ticket.Ticket;
import net.shibboleth.idp.cas.ticket.TicketService;
import net.shibboleth.idp.consent.context.ConsentContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.idp.session.IdPSession;
import net.shibboleth.idp.session.criterion.SessionIdCriterion;
import net.shibboleth.idp.session.impl.StorageBackedSessionManager;
import net.shibboleth.idp.test.flows.AbstractFlowTest;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.relyingparty.VerifiedProfileCriterion;
import net.shibboleth.shared.net.URISupport;
import net.shibboleth.shared.resolver.CriteriaSet;
+import net.shibboleth.shared.service.ReloadableService;
/**
* Tests the flow behind the <code>/login</code> endpoint.
@@ -69,6 +72,7 @@ import net.shibboleth.shared.resolver.CriteriaSet;
@ContextConfiguration(locations = {
"/test/test-cas-beans.xml"
})
+ at SuppressWarnings("javadoc")
public class LoginFlowTest extends AbstractFlowTest {
/** Flow id. */
@@ -83,9 +87,8 @@ public class LoginFlowTest extends AbstractFlowTest {
private StorageBackedSessionManager sessionManager;
@Autowired
- @Qualifier("shibboleth.RelyingPartyConfigurationResolver")
- private RelyingPartyConfigurationResolver relyingPartyConfigurationResolver;
-
+ @Qualifier("shibboleth.RelyingPartyResolverService")
+ private ReloadableService<RelyingPartyConfigurationResolver> relyingPartyConfigurationResolver;
@BeforeMethod
public void setUp() throws Exception {
@@ -277,7 +280,10 @@ public class LoginFlowTest extends AbstractFlowTest {
private void setPostAuthenticationFlows(final List<String> flowIdentifiers) throws Exception {
final ProfileRequestContext prc = new ProfileRequestContext();
prc.setProfileId(LoginConfiguration.PROFILE_ID);
- final RelyingPartyConfiguration rpConfig = relyingPartyConfigurationResolver.resolveSingle(prc);
+ final RelyingPartyConfiguration rpConfig =
+ relyingPartyConfigurationResolver.getServiceableComponent().getComponent().resolveSingle(
+ new CriteriaSet(new ProfileRequestContextCriterion(prc),
+ new VerifiedProfileCriterion(true)));
if (rpConfig == null) {
throw new IllegalStateException("Relying party configuration not found");
}
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTicketCreationErrorTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTicketCreationErrorTest.java
index 6f25a7e7d..52fe7060a 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTicketCreationErrorTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTicketCreationErrorTest.java
@@ -40,6 +40,7 @@ import net.shibboleth.idp.test.flows.AbstractFlowTest;
"/test/test-cas-beans.xml",
"/test/test-cas-error-beans.xml",
})
+ at SuppressWarnings("javadoc")
public class LoginFlowTicketCreationErrorTest extends AbstractFlowTest {
/** Flow id. */
@Nonnull
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyFlowTest.java
index fe7a20890..b5c1548e6 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyFlowTest.java
@@ -48,6 +48,7 @@ import java.time.temporal.ChronoUnit;
@ContextConfiguration(locations = {
"/test/test-cas-beans.xml",
})
+ at SuppressWarnings("javadoc")
public class ProxyFlowTest extends AbstractFlowTest {
/** Flow id. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyValidateFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyValidateFlowTest.java
index cab196c0c..f383865fb 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyValidateFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ProxyValidateFlowTest.java
@@ -25,7 +25,6 @@ import net.shibboleth.idp.cas.ticket.ServiceTicket;
import net.shibboleth.idp.cas.ticket.TicketIdentifierGenerationStrategy;
import net.shibboleth.idp.cas.ticket.TicketService;
import net.shibboleth.idp.cas.ticket.TicketState;
-import net.shibboleth.idp.cas.ticket.impl.EncodingTicketService;
import net.shibboleth.idp.session.IdPSession;
import net.shibboleth.idp.session.SessionManager;
import net.shibboleth.idp.test.flows.AbstractFlowTest;
@@ -34,7 +33,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.webflow.executor.FlowExecutionResult;
-import org.testng.SkipException;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
@@ -49,6 +47,7 @@ import java.time.Instant;
@ContextConfiguration(locations = {
"/test/test-cas-beans.xml",
})
+ at SuppressWarnings("javadoc")
public class ProxyValidateFlowTest extends AbstractFlowTest {
/** Flow id. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/SamlValidateFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/SamlValidateFlowTest.java
index 8acafbcfa..29ddc7f27 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/SamlValidateFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/SamlValidateFlowTest.java
@@ -21,10 +21,10 @@ import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.cas.ticket.ServiceTicket;
import net.shibboleth.idp.cas.ticket.TicketService;
import net.shibboleth.idp.cas.ticket.TicketState;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.IdPSession;
import net.shibboleth.idp.session.SessionManager;
import net.shibboleth.idp.test.flows.AbstractFlowTest;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.CollectionSupport;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -40,7 +40,6 @@ import javax.annotation.Nonnull;
import static org.testng.Assert.*;
import java.time.Instant;
-import java.util.Set;
/**
* Tests the flow behind the <code>/samlValidate</code> endpoint.
@@ -50,6 +49,7 @@ import java.util.Set;
@ContextConfiguration(locations = {
"/test/test-cas-beans.xml",
})
+ at SuppressWarnings("javadoc")
public class SamlValidateFlowTest extends AbstractFlowTest {
/** Flow id. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ServiceValidateFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ServiceValidateFlowTest.java
index e2a460ea7..ef12142e6 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ServiceValidateFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ServiceValidateFlowTest.java
@@ -38,12 +38,12 @@ import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.cas.ticket.ServiceTicket;
import net.shibboleth.idp.cas.ticket.TicketService;
import net.shibboleth.idp.cas.ticket.TicketState;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.IdPSession;
import net.shibboleth.idp.session.SessionManager;
import net.shibboleth.idp.session.SessionResolver;
import net.shibboleth.idp.session.criterion.SessionIdCriterion;
import net.shibboleth.idp.test.flows.AbstractFlowTest;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.resolver.CriteriaSet;
@@ -55,6 +55,7 @@ import net.shibboleth.shared.resolver.CriteriaSet;
@ContextConfiguration(locations = {
"/test/test-cas-beans.xml",
})
+ at SuppressWarnings("javadoc")
public class ServiceValidateFlowTest extends AbstractFlowTest {
/** Flow id. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java
index 85e2b0d41..bc54b3647 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/TestProxyValidator.java
@@ -31,6 +31,7 @@ import java.net.URI;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class TestProxyValidator extends HttpClientProxyValidator {
/** Validation repsonse HTTP status code to return. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ToggleablePredicate.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ToggleablePredicate.java
index b2e359bc5..851349d9d 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ToggleablePredicate.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ToggleablePredicate.java
@@ -28,6 +28,7 @@ import org.opensaml.profile.context.ProfileRequestContext;
*
* @author Marvin S. Addison
*/
+ at SuppressWarnings("javadoc")
public class ToggleablePredicate implements Predicate<ProfileRequestContext> {
private boolean result;
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ValidateFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ValidateFlowTest.java
index 53924f4d8..da82fa483 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ValidateFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/ValidateFlowTest.java
@@ -48,6 +48,7 @@ import java.time.Instant;
@ContextConfiguration(locations = {
"/test/test-cas-beans.xml",
})
+ at SuppressWarnings("javadoc")
public class ValidateFlowTest extends AbstractFlowTest {
/** Flow id. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ExceptionFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ExceptionFlowTest.java
index 4b53fa23e..8cb1d39b6 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ExceptionFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ExceptionFlowTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.Test;
/** Tests for the profile interceptor flow. */
@ContextConfiguration(locations = {"classpath:/exception/test-webflow-config.xml",})
+ at SuppressWarnings("javadoc")
public class ExceptionFlowTest extends AbstractFlowTest {
@Nonnull public final static String TEST_EXCEPTION_FLOW_ID = "test-exception-flow";
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ThrowException.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ThrowException.java
index ab92bf19c..ca6071089 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ThrowException.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/exception/ThrowException.java
@@ -25,6 +25,9 @@ import net.shibboleth.idp.profile.context.SpringRequestContext;
import org.opensaml.profile.context.ProfileRequestContext;
import org.springframework.mock.web.MockHttpServletResponse;
+/**
+ * Test action that throws exception.
+ */
public class ThrowException extends AbstractProfileAction {
final boolean commitResponse;
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/interceptor/InterceptFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/interceptor/InterceptFlowTest.java
index 2f12e4e99..c0aa50322 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/interceptor/InterceptFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/interceptor/InterceptFlowTest.java
@@ -38,6 +38,7 @@ import org.testng.annotations.Test;
/** Tests for the profile interceptor flow. */
@ContextConfiguration(locations = {"classpath:/intercept/test-webflow-config.xml",})
+ at SuppressWarnings("javadoc")
public class InterceptFlowTest extends AbstractFlowTest {
/** Flow id. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/mapper/TestAfterFilter.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/mapper/TestAfterFilter.java
index 4bd9ed548..2c0a009f0 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/mapper/TestAfterFilter.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/mapper/TestAfterFilter.java
@@ -21,7 +21,7 @@ import javax.annotation.Nonnull;
import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.opensaml.profile.context.ProfileRequestContext;
import org.testng.Assert;
@@ -35,9 +35,9 @@ public class TestAfterFilter extends AbstractProfileAction {
protected void doExecute(
@Nonnull final ProfileRequestContext profileRequestContext) {
- RelyingPartyContext rpc = profileRequestContext.getSubcontext(RelyingPartyContext.class);
+ final RelyingPartyContext rpc = profileRequestContext.getSubcontext(RelyingPartyContext.class);
- AttributeContext ac = rpc.getSubcontext(AttributeContext.class);
+ final AttributeContext ac = rpc.getSubcontext(AttributeContext.class);
Assert.assertNull(ac.getIdPAttributes().get("IdPNotOK"));
Assert.assertNull(ac.getIdPAttributes().get("IdPEA1"));
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/AbstractSAML2SSOFlowTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/AbstractSAML2SSOFlowTest.java
index 881aeedcd..1dcbc8f14 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/AbstractSAML2SSOFlowTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml2/AbstractSAML2SSOFlowTest.java
@@ -55,6 +55,7 @@ import net.shibboleth.shared.net.URLBuilder;
/**
* Abstract SAML 2 SSO flow test.
*/
+ at SuppressWarnings("javadoc")
public abstract class AbstractSAML2SSOFlowTest extends AbstractSAML2FlowTest {
/** Class logger. */
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java b/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java
index 6be6a05e6..e0bd403c7 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/spring/IdPPropertiesApplicationContextInitializerTest.java
@@ -36,6 +36,7 @@ import net.shibboleth.idp.spring.IdPPropertiesApplicationContextInitializer;
import net.shibboleth.shared.logic.ConstraintViolationException;
/** {@link IdPPropertiesApplicationContextInitializer} unit test. */
+ at SuppressWarnings("javadoc")
public class IdPPropertiesApplicationContextInitializerTest {
private MockServletContext sc;
diff --git a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java
index 029135fa4..3a50535f1 100644
--- a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java
+++ b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseAction.java
@@ -33,7 +33,7 @@ import net.shibboleth.idp.consent.context.AttributeReleaseContext;
import net.shibboleth.idp.consent.flow.impl.AbstractConsentAction;
import net.shibboleth.idp.profile.IdPEventIds;
import net.shibboleth.idp.profile.context.ProfileInterceptorContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunction.java b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunction.java
index 628ba2088..500980139 100644
--- a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunction.java
+++ b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunction.java
@@ -32,7 +32,7 @@ import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/AbstractConsentAuditExtractorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/AbstractConsentAuditExtractorTest.java
index a0e117b35..ab6068624 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/AbstractConsentAuditExtractorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/AbstractConsentAuditExtractorTest.java
@@ -27,7 +27,7 @@ import org.springframework.webflow.execution.RequestContext;
import org.testng.annotations.BeforeMethod;
/**
- *
+ * Base class for audit extractor tests.
*/
public class AbstractConsentAuditExtractorTest {
@@ -35,6 +35,11 @@ public class AbstractConsentAuditExtractorTest {
protected ProfileRequestContext prc;
+ /**
+ * Set up for tests.
+ *
+ * @throws Exception
+ */
@BeforeMethod public void setUp() throws Exception {
src = new RequestContextBuilder().buildRequestContext();
prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIdsAuditExtractorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIdsAuditExtractorTest.java
index ec9c301b5..ee1d292ad 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIdsAuditExtractorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIdsAuditExtractorTest.java
@@ -27,6 +27,7 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.consent.context.ConsentContext;
/** {@link CurrentConsentIdsAuditExtractor} unit test. */
+ at SuppressWarnings("javadoc")
public class CurrentConsentIdsAuditExtractorTest extends AbstractConsentAuditExtractorTest {
private CurrentConsentIdsAuditExtractor extractor;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIsApprovedAuditExtractorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIsApprovedAuditExtractorTest.java
index 3f4072595..5c5fb2e86 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIsApprovedAuditExtractorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentIsApprovedAuditExtractorTest.java
@@ -27,6 +27,7 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.consent.context.ConsentContext;
/** {@link CurrentConsentIsApprovedAuditExtractor} unit test. */
+ at SuppressWarnings("javadoc")
public class CurrentConsentIsApprovedAuditExtractorTest extends AbstractConsentAuditExtractorTest {
private CurrentConsentIsApprovedAuditExtractor extractor;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentValuesAuditExtractorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentValuesAuditExtractorTest.java
index 2ecf289b7..fb7257cdc 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentValuesAuditExtractorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/audit/impl/CurrentConsentValuesAuditExtractorTest.java
@@ -27,6 +27,7 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.consent.context.ConsentContext;
/** {@link CurrentConsentValuesAuditExtractor} unit test. */
+ at SuppressWarnings("javadoc")
public class CurrentConsentValuesAuditExtractorTest extends AbstractConsentAuditExtractorTest {
private CurrentConsentValuesAuditExtractor extractor;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/AttributeReleaseContextTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/AttributeReleaseContextTest.java
index 1fe83115b..2c912417d 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/AttributeReleaseContextTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/AttributeReleaseContextTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link AttributeReleaseContext} unit test. */
+ at SuppressWarnings("javadoc")
public class AttributeReleaseContextTest {
private AttributeReleaseContext ctx;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/ConsentContextTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/ConsentContextTest.java
index ecba0d731..ab6e7497e 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/ConsentContextTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/context/impl/ConsentContextTest.java
@@ -28,6 +28,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link ConsentContext} unit test. */
+ at SuppressWarnings("javadoc")
public class ConsentContextTest {
private ConsentContext ctx;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseActionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseActionTest.java
index 101d64b57..9d63e08c1 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseActionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AbstractAttributeReleaseActionTest.java
@@ -22,17 +22,22 @@ import net.shibboleth.idp.consent.context.AttributeReleaseContext;
import net.shibboleth.idp.consent.flow.impl.AbstractConsentActionTest;
import net.shibboleth.idp.consent.impl.ConsentTestingSupport;
import net.shibboleth.idp.profile.context.ProfileInterceptorContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.testng.annotations.BeforeMethod;
/** {@link AbstractAttributeReleaseAction} unit test. */
public abstract class AbstractAttributeReleaseActionTest extends AbstractConsentActionTest {
+ /**
+ * Set up tests.
+ *
+ * @throws Exception
+ */
@BeforeMethod public void setUpAttributeReleaseAction() throws Exception {
final AttributeContext attributeCtx = new AttributeContext();
attributeCtx.setIdPAttributes(ConsentTestingSupport.newAttributeMap().values());
- prc.getSubcontext(RelyingPartyContext.class, true).addSubcontext(attributeCtx);
+ prc.getOrCreateSubcontext(RelyingPartyContext.class).addSubcontext(attributeCtx);
prc.addSubcontext(new AttributeReleaseContext(), true);
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AttributeReleaseFlowDescriptorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AttributeReleaseFlowDescriptorTest.java
index 193e77c59..90608a70f 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AttributeReleaseFlowDescriptorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/AttributeReleaseFlowDescriptorTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link AttributeReleaseFlowDescriptor} unit test. */
+ at SuppressWarnings("javadoc")
public class AttributeReleaseFlowDescriptorTest {
private AttributeReleaseFlowDescriptor descriptor;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/InitializeAttributeReleaseContextTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/InitializeAttributeReleaseContextTest.java
index dfb2383d2..d3ed1590f 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/InitializeAttributeReleaseContextTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/InitializeAttributeReleaseContextTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link InitializeAttributeReleaseContext} unit test. */
+ at SuppressWarnings("javadoc")
public class InitializeAttributeReleaseContextTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java
index 8e000e7a1..bd49ace59 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/PopulateAttributeReleaseContextTest.java
@@ -35,8 +35,8 @@ import net.shibboleth.idp.consent.context.AttributeReleaseContext;
import net.shibboleth.idp.consent.impl.ConsentTestingSupport;
import net.shibboleth.idp.consent.logic.impl.PreferExplicitOrderComparator;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
@@ -46,6 +46,7 @@ import org.testng.annotations.Test;
import com.google.common.collect.Ordering;
/** {@link PopulateAttributeReleaseContext} unit test. */
+ at SuppressWarnings("javadoc")
public class PopulateAttributeReleaseContextTest extends AbstractAttributeReleaseActionTest {
@Test(expectedExceptions = ComponentInitializationException.class) public void testMissingPredicate()
@@ -153,7 +154,7 @@ public class PopulateAttributeReleaseContextTest extends AbstractAttributeReleas
ActionTestingSupport.assertProceedEvent(event);
- final AttributeReleaseContext arc = prc.getSubcontext(AttributeReleaseContext.class, false);
+ final AttributeReleaseContext arc = prc.getSubcontext(AttributeReleaseContext.class);
Assert.assertNotNull(arc);
Assert.assertEquals(arc.getConsentableAttributes(), orderedAttributes);
}
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/ReleaseAttributesTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/ReleaseAttributesTest.java
index d10f143bc..015f179c3 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/ReleaseAttributesTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/ar/impl/ReleaseAttributesTest.java
@@ -26,8 +26,8 @@ import net.shibboleth.idp.consent.Consent;
import net.shibboleth.idp.consent.context.AttributeReleaseContext;
import net.shibboleth.idp.consent.context.ConsentContext;
import net.shibboleth.idp.consent.impl.ConsentTestingSupport;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.springframework.webflow.execution.Event;
import org.testng.Assert;
@@ -35,6 +35,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link ReleaseAttributes} unit test. */
+ at SuppressWarnings("javadoc")
public class ReleaseAttributesTest extends AbstractAttributeReleaseActionTest {
private AttributeReleaseContext arc;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/AbstractConsentActionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/AbstractConsentActionTest.java
index 967367b63..94f5468e5 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/AbstractConsentActionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/AbstractConsentActionTest.java
@@ -37,6 +37,11 @@ public abstract class AbstractConsentActionTest {
protected AbstractConsentAction action;
+ /**
+ * Set up for tests.
+ *
+ * @throws Exception
+ */
@BeforeMethod public void setUp() throws Exception {
src = new RequestContextBuilder().buildRequestContext();
prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java
index 2d075020a..7d7e54fa2 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/ExtractConsentTest.java
@@ -31,6 +31,7 @@ import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.shared.testing.ConstantSupplier;
/** {@link ExtractConsent} unit test. */
+ at SuppressWarnings("javadoc")
public class ExtractConsentTest extends AbstractConsentActionTest {
@BeforeMethod public void setUpCurrentConsents() throws Exception {
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/InitializeConsentContextTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/InitializeConsentContextTest.java
index 409525d51..fe706e8de 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/InitializeConsentContextTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/InitializeConsentContextTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link InitializeConsentContext} unit test. */
+ at SuppressWarnings("javadoc")
public class InitializeConsentContextTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/PopulateConsentContextTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/PopulateConsentContextTest.java
index 2391aaf08..c265f9678 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/PopulateConsentContextTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/impl/PopulateConsentContextTest.java
@@ -28,6 +28,7 @@ import org.testng.Assert;
import org.testng.annotations.Test;
/** {@link PopulateConsentContext} unit test. */
+ at SuppressWarnings("javadoc")
public class PopulateConsentContextTest extends AbstractConsentActionTest {
@Test(expectedExceptions = ConstraintViolationException.class) public void testNullCurrentConsentsFunction()
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/AbstractConsentIndexedStorageActionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/AbstractConsentIndexedStorageActionTest.java
index c027dd907..5399d2683 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/AbstractConsentIndexedStorageActionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/AbstractConsentIndexedStorageActionTest.java
@@ -30,6 +30,7 @@ import org.testng.Assert;
import org.testng.annotations.Test;
/** {@link AbstractConsentIndexedStorageAction} unit test. */
+ at SuppressWarnings("javadoc")
public abstract class AbstractConsentIndexedStorageActionTest extends AbstractConsentStorageActionTest {
protected void populateAction() throws Exception {
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/CreateGlobalConsentResultTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/CreateGlobalConsentResultTest.java
index d67148057..3d42dac08 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/CreateGlobalConsentResultTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/CreateGlobalConsentResultTest.java
@@ -31,6 +31,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link CreateGlobalConsentResult} unit test. */
+ at SuppressWarnings("javadoc")
public class CreateGlobalConsentResultTest extends AbstractConsentIndexedStorageActionTest {
@BeforeMethod public void setUpAction() throws Exception {
@@ -61,4 +62,5 @@ public class CreateGlobalConsentResultTest extends AbstractConsentIndexedStorage
Assert.assertNull(globalConsent.getValue());
Assert.assertTrue(globalConsent.isApproved());
}
-}
+
+}
\ No newline at end of file
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/ReadConsentFromStorageTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/ReadConsentFromStorageTest.java
index 93c3ba492..439d6b6c8 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/ReadConsentFromStorageTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/ReadConsentFromStorageTest.java
@@ -28,6 +28,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link ReadConsentFromStorage} unit test. */
+ at SuppressWarnings("javadoc")
public class ReadConsentFromStorageTest extends AbstractConsentStorageActionTest {
@BeforeMethod public void setUpAction() throws Exception {
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/RevokeConsentTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/RevokeConsentTest.java
index 864d32e73..9011cc0bd 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/RevokeConsentTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/RevokeConsentTest.java
@@ -29,6 +29,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link RevokeConsent} unit test. */
+ at SuppressWarnings("javadoc")
public class RevokeConsentTest extends AbstractConsentIndexedStorageActionTest {
@BeforeMethod public void setUpAction() throws Exception {
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/UpdateCounterTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/UpdateCounterTest.java
index 64ee06eb2..92d9f1166 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/UpdateCounterTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/flow/storage/impl/UpdateCounterTest.java
@@ -26,6 +26,7 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
/** {@link UpdateCounter} unit test. */
+ at SuppressWarnings("javadoc")
public class UpdateCounterTest extends AbstractConsentStorageActionTest {
@BeforeMethod public void setUpAction() throws Exception {
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/impl/ConsentTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/impl/ConsentTest.java
index b446aa79f..d981f6615 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/impl/ConsentTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/impl/ConsentTest.java
@@ -25,6 +25,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link Consent} unit test. */
+ at SuppressWarnings("javadoc")
public class ConsentTest {
private Consent consent;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributePredicateTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributePredicateTest.java
index 5ff7f92e4..0f09dbf3b 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributePredicateTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributePredicateTest.java
@@ -28,6 +28,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link AttributePredicate} unit test. */
+ at SuppressWarnings("javadoc")
public class AttributePredicateTest {
private AttributePredicate p;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunctionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunctionTest.java
index 892366091..02dd15c52 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunctionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValueLookupFunctionTest.java
@@ -25,9 +25,9 @@ import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.consent.impl.ConsentTestingSupport;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.ConstraintViolationException;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -37,6 +37,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link AttributeValueLookupFunction} unit test. */
+ at SuppressWarnings("javadoc")
public class AttributeValueLookupFunctionTest {
private AttributeValueLookupFunction function;
@@ -60,7 +61,7 @@ public class AttributeValueLookupFunctionTest {
unfilteredAttributes.put(attribute4.getId(), attribute4);
attributeCtx.setUnfilteredIdPAttributes(unfilteredAttributes.values());
- prc.getSubcontext(RelyingPartyContext.class, true).addSubcontext(attributeCtx);
+ prc.getOrCreateSubcontext(RelyingPartyContext.class).addSubcontext(attributeCtx);
}
@Test(expectedExceptions = ConstraintViolationException.class) public void testEmptyConstructor() {
@@ -90,7 +91,7 @@ public class AttributeValueLookupFunctionTest {
@Test public void testAttributeWithNoValues() {
final AttributeContext attributeCtx =
- prc.getSubcontext(RelyingPartyContext.class, true).getSubcontext(AttributeContext.class);
+ prc.getOrCreateSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class);
attributeCtx.setIdPAttributes(Collections.singleton(new IdPAttribute("EmptyAttribute")));
function = new AttributeValueLookupFunction("EmptyAttribute");
@@ -104,7 +105,7 @@ public class AttributeValueLookupFunctionTest {
byteAttribute.setValues(Collections.singletonList(new ByteAttributeValue(data)));
final AttributeContext attributeCtx =
- prc.getSubcontext(RelyingPartyContext.class, true).getSubcontext(AttributeContext.class);
+ prc.getOrCreateSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class);
attributeCtx.setIdPAttributes(Collections.singleton(byteAttribute));
function = new AttributeValueLookupFunction("ByteAttribute");
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunctionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunctionTest.java
index 4b77e21e7..3b566d599 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunctionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunctionTest.java
@@ -38,6 +38,7 @@ import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
import net.shibboleth.idp.consent.impl.ConsentTestingSupport;
/** {@link AttributeValuesHashFunction} unit test. */
+ at SuppressWarnings("javadoc")
public class AttributeValuesHashFunctionTest extends XMLObjectBaseTestCase {
private AttributeValuesHashFunction function;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyComparatorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyComparatorTest.java
index 166c6808d..3ffe7fdc3 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyComparatorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyComparatorTest.java
@@ -28,6 +28,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit tests for {@link CounterStorageKeyComparator}. */
+ at SuppressWarnings("javadoc")
public class CounterStorageKeyComparatorTest {
private CounterStorageKeyComparator c;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyFunctionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyFunctionTest.java
index e3f7cd42e..5da2ca6cc 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyFunctionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/CounterStorageKeyFunctionTest.java
@@ -40,6 +40,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit tests for {@link CounterStorageKeyFunction}. */
+ at SuppressWarnings("javadoc")
public class CounterStorageKeyFunctionTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowDescriptorLookupFunctionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowDescriptorLookupFunctionTest.java
index c5a883e26..437b894ac 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowDescriptorLookupFunctionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowDescriptorLookupFunctionTest.java
@@ -33,6 +33,7 @@ import org.testng.annotations.Test;
/**
* {@link FlowDescriptorLookupFunction} unit test.
*/
+ at SuppressWarnings("javadoc")
public class FlowDescriptorLookupFunctionTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowIdLookupFunctionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowIdLookupFunctionTest.java
index 46c7dbd23..9c8b9d4a2 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowIdLookupFunctionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/FlowIdLookupFunctionTest.java
@@ -28,6 +28,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link FlowIdLookupFunction} unit test. */
+ at SuppressWarnings("javadoc")
public class FlowIdLookupFunctionTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java
index 0ec957675..b1a7b48b0 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link GlobalAttributeConsentPredicate} unit test. */
+ at SuppressWarnings("javadoc")
public class GlobalAttributeConsentPredicateTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/IsConsentRequiredPredicateTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/IsConsentRequiredPredicateTest.java
index 3008bbf8a..69ac3bf12 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/IsConsentRequiredPredicateTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/IsConsentRequiredPredicateTest.java
@@ -35,6 +35,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link IsConsentRequiredPredicate} unit test. */
+ at SuppressWarnings("javadoc")
public class IsConsentRequiredPredicateTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/JoinFunctionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/JoinFunctionTest.java
index 58247e86e..71ee296ab 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/JoinFunctionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/JoinFunctionTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link JoinFunction} unit test. */
+ at SuppressWarnings("javadoc")
public class JoinFunctionTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/MessageSourceConsentFunctionTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/MessageSourceConsentFunctionTest.java
index 789ceb4c5..fa7dd1d77 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/MessageSourceConsentFunctionTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/MessageSourceConsentFunctionTest.java
@@ -40,6 +40,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link MessageSourceConsentFunction} unit test. */
+ at SuppressWarnings("javadoc")
public class MessageSourceConsentFunctionTest {
private RequestContext src;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/PreferExplicitOrderComparatorTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/PreferExplicitOrderComparatorTest.java
index 7945524ca..67b58830e 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/PreferExplicitOrderComparatorTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/PreferExplicitOrderComparatorTest.java
@@ -28,6 +28,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link PreferExplicitOrderComparator} unit test. */
+ at SuppressWarnings("javadoc")
public class PreferExplicitOrderComparatorTest {
private Comparator<String> c;
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/CollectionSerializerTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/CollectionSerializerTest.java
index 1c346ce2b..0947508de 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/CollectionSerializerTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/CollectionSerializerTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.Test;
import net.shibboleth.shared.logic.ConstraintViolationException;
/** Unit tests for {@link CollectionSerializer}. */
+ at SuppressWarnings("javadoc")
public class CollectionSerializerTest {
protected CollectionSerializer serializer;
@@ -60,4 +61,5 @@ public class CollectionSerializerTest {
final Collection<String> deserialized = serializer.deserialize(-1, "context", "key", serialized, null);
Assert.assertEquals(deserialized, collection);
}
-}
+
+}
\ No newline at end of file
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/ConsentSerializerTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/ConsentSerializerTest.java
index 7dd6fea17..0b96bcc89 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/ConsentSerializerTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/storage/impl/ConsentSerializerTest.java
@@ -40,6 +40,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit tests for {@link ConsentSerializer}. */
+ at SuppressWarnings("javadoc")
public class ConsentSerializerTest {
/** Class logger. */
diff --git a/idp-profile-api/pom.xml b/idp-profile-api/pom.xml
index 46fd9c61c..18cc02fae 100644
--- a/idp-profile-api/pom.xml
+++ b/idp-profile-api/pom.xml
@@ -60,6 +60,10 @@
<groupId>${shib-shared.groupId}</groupId>
<artifactId>shib-security</artifactId>
</dependency>
+ <dependency>
+ <groupId>${shib-shared.groupId}</groupId>
+ <artifactId>shib-service</artifactId>
+ </dependency>
<dependency>
<groupId>${shib-shared.groupId}</groupId>
<artifactId>shib-spring</artifactId>
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/IdPEventIds.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/IdPEventIds.java
index c2f2bd140..e2731611f 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/IdPEventIds.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/IdPEventIds.java
@@ -19,9 +19,9 @@ package net.shibboleth.idp.profile;
import javax.annotation.Nonnull;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
// TODO: move attribute related events into that module?
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/DetailedErrorsPredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/DetailedErrorsPredicate.java
index f729c8b82..e8717e772 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/DetailedErrorsPredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/DetailedErrorsPredicate.java
@@ -19,9 +19,9 @@ package net.shibboleth.idp.profile.config.logic;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -36,8 +36,8 @@ public class DetailedErrorsPredicate extends AbstractRelyingPartyPredicate {
final RelyingPartyContext rpc = getRelyingPartyContextLookupStrategy().apply(input);
if (rpc != null) {
final RelyingPartyConfiguration config = rpc.getConfiguration();
- if (config != null) {
- return config.isDetailedErrors(input);
+ if (config instanceof net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) {
+ return ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) config).isDetailedErrors(input);
}
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/ResolveAttributesPredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/ResolveAttributesPredicate.java
index 6dcb172ec..8a0c400f0 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/ResolveAttributesPredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/logic/ResolveAttributesPredicate.java
@@ -19,10 +19,10 @@ package net.shibboleth.idp.profile.config.logic;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.profile.config.AttributeResolvingProfileConfiguration;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.opensaml.profile.context.ProfileRequestContext;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/ClientTLSValidationConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/ClientTLSValidationConfigurationLookupFunction.java
index 73b6cb4c2..95584a76f 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/ClientTLSValidationConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/ClientTLSValidationConfigurationLookupFunction.java
@@ -23,9 +23,11 @@ import java.util.List;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -41,14 +43,15 @@ public class ClientTLSValidationConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<ClientTLSValidationConfiguration>> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
-
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
+
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
@@ -71,10 +74,15 @@ public class ClientTLSValidationConfigurationLookupFunction
// Check for a per-profile default (relying party independent) config.
if (input != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig =
- rpResolver.getDefaultSecurityConfiguration(input.getProfileId());
- if (defaultConfig != null && defaultConfig.getClientTLSValidationConfiguration() != null) {
- configs.add(defaultConfig.getClientTLSValidationConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(
+ input.getProfileId());
+ if (defaultConfig != null && defaultConfig.getClientTLSValidationConfiguration() != null) {
+ configs.add(defaultConfig.getClientTLSValidationConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/DecryptionConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/DecryptionConfigurationLookupFunction.java
index 549a3516b..e0499f281 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/DecryptionConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/DecryptionConfigurationLookupFunction.java
@@ -23,9 +23,11 @@ import java.util.List;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.security.config.SecurityConfiguration;
@@ -42,14 +44,15 @@ public class DecryptionConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<DecryptionConfiguration>> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
-
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
+
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
@@ -72,10 +75,15 @@ public class DecryptionConfigurationLookupFunction
// Check for a per-profile default (relying party independent) config.
if (input != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig =
- rpResolver.getDefaultSecurityConfiguration(input.getProfileId());
- if (defaultConfig instanceof XMLSecurityConfiguration xsc && xsc.getDecryptionConfiguration() != null) {
- configs.add(xsc.getDecryptionConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(
+ input.getProfileId());
+ if (defaultConfig instanceof XMLSecurityConfiguration xsc && xsc.getDecryptionConfiguration() != null) {
+ configs.add(xsc.getDecryptionConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/EncryptionConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/EncryptionConfigurationLookupFunction.java
index ea120e6a2..fb95abedd 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/EncryptionConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/EncryptionConfigurationLookupFunction.java
@@ -23,9 +23,11 @@ import java.util.List;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.security.config.SecurityConfiguration;
@@ -42,14 +44,15 @@ public class EncryptionConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<EncryptionConfiguration>> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
-
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
+
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
@@ -72,10 +75,15 @@ public class EncryptionConfigurationLookupFunction
// Check for a per-profile default (relying party independent) config.
if (input != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig =
- rpResolver.getDefaultSecurityConfiguration(input.getProfileId());
- if (defaultConfig instanceof XMLSecurityConfiguration xsc && xsc.getEncryptionConfiguration() != null) {
- configs.add(xsc.getEncryptionConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(
+ input.getProfileId());
+ if (defaultConfig instanceof XMLSecurityConfiguration xsc && xsc.getEncryptionConfiguration() != null) {
+ configs.add(xsc.getEncryptionConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/IdentifierGenerationStrategyLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/IdentifierGenerationStrategyLookupFunction.java
index 35610eba2..18e0df818 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/IdentifierGenerationStrategyLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/IdentifierGenerationStrategyLookupFunction.java
@@ -20,10 +20,12 @@ package net.shibboleth.idp.profile.config.navigate;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.shared.security.IdentifierGenerationStrategy;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.security.config.SecurityConfiguration;
@@ -38,7 +40,7 @@ public class IdentifierGenerationStrategyLookupFunction
extends AbstractRelyingPartyLookupFunction<IdentifierGenerationStrategy> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
/** Default strategy to return. */
@Nullable private IdentifierGenerationStrategy defaultGenerator;
@@ -48,7 +50,8 @@ public class IdentifierGenerationStrategyLookupFunction
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
@@ -79,10 +82,15 @@ public class IdentifierGenerationStrategyLookupFunction
// Check for a per-profile default (relying party independent) config.
if (input != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig =
- rpResolver.getDefaultSecurityConfiguration(input.getProfileId());
- if (defaultConfig != null && defaultConfig.getIdGenerator() != null) {
- return defaultConfig.getIdGenerator();
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(
+ input.getProfileId());
+ if (defaultConfig != null && defaultConfig.getIdGenerator() != null) {
+ return defaultConfig.getIdGenerator();
+ }
+ } catch (final ServiceException e) {
+
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/InboundFlowsLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/InboundFlowsLookupFunction.java
index de0a17b4a..8e3587c32 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/InboundFlowsLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/InboundFlowsLookupFunction.java
@@ -23,8 +23,8 @@ import java.util.Collections;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.config.InterceptorAwareProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotLive;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/OutboundFlowsLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/OutboundFlowsLookupFunction.java
index 4506e5cc8..cf128e11e 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/OutboundFlowsLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/OutboundFlowsLookupFunction.java
@@ -23,8 +23,8 @@ import java.util.Collections;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.config.InterceptorAwareProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotLive;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureSigningConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureSigningConfigurationLookupFunction.java
index f230ec673..532338353 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureSigningConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureSigningConfigurationLookupFunction.java
@@ -23,9 +23,11 @@ import java.util.List;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.security.config.SecurityConfiguration;
@@ -42,14 +44,15 @@ public class SignatureSigningConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<SignatureSigningConfiguration>> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
-
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
+
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
@@ -72,11 +75,16 @@ public class SignatureSigningConfigurationLookupFunction
// Check for a per-profile default (relying party independent) config.
if (input != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig =
- rpResolver.getDefaultSecurityConfiguration(input.getProfileId());
- if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
- xsc.getSignatureSigningConfiguration() != null) {
- configs.add(xsc.getSignatureSigningConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(
+ input.getProfileId());
+ if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
+ xsc.getSignatureSigningConfiguration() != null) {
+ configs.add(xsc.getSignatureSigningConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureValidationConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureValidationConfigurationLookupFunction.java
index f39d83ade..95ca2f8fa 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureValidationConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/SignatureValidationConfigurationLookupFunction.java
@@ -23,9 +23,11 @@ import java.util.List;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.security.config.SecurityConfiguration;
@@ -40,16 +42,17 @@ import org.opensaml.xmlsec.SecurityConfigurationSupport;
*/
public class SignatureValidationConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<SignatureValidationConfiguration>> {
-
+
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
@@ -72,11 +75,16 @@ public class SignatureValidationConfigurationLookupFunction
// Check for a per-profile default (relying party independent) config.
if (input != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig =
- rpResolver.getDefaultSecurityConfiguration(input.getProfileId());
- if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
- xsc.getSignatureValidationConfiguration() != null) {
- configs.add(xsc.getSignatureValidationConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(
+ input.getProfileId());
+ if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
+ xsc.getSignatureValidationConfiguration() != null) {
+ configs.add(xsc.getSignatureValidationConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/HttpClientSecurityConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/HttpClientSecurityConfigurationLookupFunction.java
index 29410f0df..f85b569f8 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/HttpClientSecurityConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/HttpClientSecurityConfigurationLookupFunction.java
@@ -28,9 +28,11 @@ import org.opensaml.security.httpclient.HttpClientSecurityConfiguration;
import org.opensaml.security.httpclient.HttpClientSecuritySupport;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.messaging.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
/**
* A {@link MessageContext} function that returns a {@link HttpClientSecurityConfiguration} list
@@ -42,19 +44,20 @@ public class HttpClientSecurityConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<HttpClientSecurityConfiguration>> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
-
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
+
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
+// Checkstyle: CyclomaticComplexity OFF
/** {@inheritDoc} */
- @Override
@Nullable public List<HttpClientSecurityConfiguration> apply(@Nullable final MessageContext input) {
final List<HttpClientSecurityConfiguration> configs = new ArrayList<>();
@@ -64,7 +67,7 @@ public class HttpClientSecurityConfigurationLookupFunction
final ProfileConfiguration pc = rpc.getProfileConfig();
if (pc != null) {
final SecurityConfiguration sc =
- pc.getSecurityConfiguration(this.getProfileRequestContextLookupStrategy().apply(input));
+ pc.getSecurityConfiguration(getProfileRequestContextLookupStrategy().apply(input));
if (sc != null && sc.getHttpClientSecurityConfiguration() != null) {
configs.add(sc.getHttpClientSecurityConfiguration());
}
@@ -74,9 +77,14 @@ public class HttpClientSecurityConfigurationLookupFunction
if (pc != null) {
final String id = pc.getId();
if (id != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig = rpResolver.getDefaultSecurityConfiguration(id);
- if (defaultConfig != null && defaultConfig.getHttpClientSecurityConfiguration() != null) {
- configs.add(defaultConfig.getHttpClientSecurityConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(id);
+ if (defaultConfig != null && defaultConfig.getHttpClientSecurityConfiguration() != null) {
+ configs.add(defaultConfig.getHttpClientSecurityConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
}
@@ -86,5 +94,6 @@ public class HttpClientSecurityConfigurationLookupFunction
return configs;
}
-
+// Checkstyle: CyclomaticComplexity ON
+
}
\ No newline at end of file
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureSigningConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureSigningConfigurationLookupFunction.java
index 0a836b281..b9508b48c 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureSigningConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureSigningConfigurationLookupFunction.java
@@ -29,9 +29,11 @@ import org.opensaml.xmlsec.SignatureSigningConfiguration;
import org.opensaml.xmlsec.config.XMLSecurityConfiguration;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.messaging.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
/**
* A {@link MessageContext} function that returns a {@link SignatureSigningConfiguration} list
@@ -43,19 +45,20 @@ public class SignatureSigningConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<SignatureSigningConfiguration>> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
-
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
+
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
+// Checkstyle: CyclomaticComplexity OFF
/** {@inheritDoc} */
- @Override
@Nullable public List<SignatureSigningConfiguration> apply(@Nullable final MessageContext input) {
final List<SignatureSigningConfiguration> configs = new ArrayList<>();
@@ -75,10 +78,15 @@ public class SignatureSigningConfigurationLookupFunction
if (pc != null) {
final String id = pc.getId();
if (id != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig = rpResolver.getDefaultSecurityConfiguration(id);
- if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
- xsc.getSignatureSigningConfiguration() != null) {
- configs.add(xsc.getSignatureSigningConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(id);
+ if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
+ xsc.getSignatureSigningConfiguration() != null) {
+ configs.add(xsc.getSignatureSigningConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
}
@@ -88,5 +96,6 @@ public class SignatureSigningConfigurationLookupFunction
return configs;
}
+// Checkstyle: CyclomaticComplexity ON
}
\ No newline at end of file
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureValidationConfigurationLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureValidationConfigurationLookupFunction.java
index ced6eb5ea..bd2b486fc 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureValidationConfigurationLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/navigate/messaging/SignatureValidationConfigurationLookupFunction.java
@@ -29,9 +29,11 @@ import org.opensaml.xmlsec.SignatureValidationConfiguration;
import org.opensaml.xmlsec.config.XMLSecurityConfiguration;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
import net.shibboleth.idp.profile.context.navigate.messaging.AbstractRelyingPartyLookupFunction;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
/**
* A {@link MessageContext} function that returns a {@link SignatureValidationConfiguration} list
@@ -43,19 +45,20 @@ public class SignatureValidationConfigurationLookupFunction
extends AbstractRelyingPartyLookupFunction<List<SignatureValidationConfiguration>> {
/** A resolver for default security configurations. */
- @Nullable private RelyingPartyConfigurationResolver rpResolver;
-
+ @Nullable private ReloadableService<RelyingPartyConfigurationResolver> rpResolver;
+
/**
* Set the resolver for default security configurations.
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nullable final RelyingPartyConfigurationResolver resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
rpResolver = resolver;
}
+// Checkstyle: CyclomaticComplexity OFF
/** {@inheritDoc} */
- @Override
@Nullable public List<SignatureValidationConfiguration> apply(@Nullable final MessageContext input) {
final List<SignatureValidationConfiguration> configs = new ArrayList<>();
@@ -75,10 +78,15 @@ public class SignatureValidationConfigurationLookupFunction
if (pc != null) {
final String id = pc.getId();
if (id != null && rpResolver != null) {
- final SecurityConfiguration defaultConfig = rpResolver.getDefaultSecurityConfiguration(id);
- if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
- xsc.getSignatureValidationConfiguration() != null) {
- configs.add(xsc.getSignatureValidationConfiguration());
+ try {
+ final SecurityConfiguration defaultConfig =
+ rpResolver.getServiceableComponent().getComponent().getDefaultSecurityConfiguration(id);
+ if (defaultConfig instanceof XMLSecurityConfiguration xsc &&
+ xsc.getSignatureValidationConfiguration() != null) {
+ configs.add(xsc.getSignatureValidationConfiguration());
+ }
+ } catch (final ServiceException e) {
+
}
}
}
@@ -88,5 +96,6 @@ public class SignatureValidationConfigurationLookupFunction
return configs;
}
+// Checkstyle: CyclomaticComplexity ON
}
\ No newline at end of file
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/MultiRelyingPartyContext.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/MultiRelyingPartyContext.java
index 43d188c31..76cd2156f 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/MultiRelyingPartyContext.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/MultiRelyingPartyContext.java
@@ -20,23 +20,23 @@ package net.shibboleth.idp.profile.context;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.StringSupport;
import org.opensaml.messaging.context.BaseContext;
import com.google.common.collect.ArrayListMultimap;
-//import com.google.common.collect.ImmutableList;
import com.google.common.collect.ListMultimap;
/**
@@ -72,7 +72,7 @@ public final class MultiRelyingPartyContext extends BaseContext {
* @return immutable collection of RP contexts
*/
@Nonnull @NonnullElements @NotLive @Unmodifiable public Collection<RelyingPartyContext> getRelyingPartyContexts() {
- return List.copyOf(relyingPartyIdMap.values());
+ return CollectionSupport.copyToList(relyingPartyIdMap.values());
}
/**
@@ -84,7 +84,7 @@ public final class MultiRelyingPartyContext extends BaseContext {
*/
@Nonnull @NonnullElements @NotLive @Unmodifiable public Collection<RelyingPartyContext> getRelyingPartyContexts(
@Nonnull @NotEmpty final String label) {
- return List.copyOf(relyingPartyLabelMap.get(
+ return CollectionSupport.copyToList(relyingPartyLabelMap.get(
Constraint.isNotNull(StringSupport.trimOrNull(label), "Label cannot be null or empty")));
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/RelyingPartyContext.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/RelyingPartyContext.java
deleted file mode 100644
index 1b7a0c8bd..000000000
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/RelyingPartyContext.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.profile.context;
-
-import java.util.function.Function;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.StringSupport;
-
-import org.opensaml.messaging.context.BaseContext;
-
-/**
- * {@link BaseContext} containing relying party specific information, usually a
- * subcontext of {@link org.opensaml.profile.context.ProfileRequestContext}.
- */
-public final class RelyingPartyContext extends BaseContext {
-
- /** Optional flag indicating whether verification was done. */
- @Nullable private Boolean verified;
-
- /** The identifier for the relying party. */
- @Nullable private String relyingPartyId;
-
- /** A pointer to a context tree containing identifying material for the relying party. */
- @Nullable private BaseContext relyingPartyIdContextTree;
-
- /** A lookup strategy for deriving verification based on the context. */
- @Nullable private Function<RelyingPartyContext,Boolean> verificationLookupStrategy;
-
- /** A lookup strategy for deriving a relying party ID based on contained information. */
- @Nullable private Function<RelyingPartyContext,String> relyingPartyIdLookupStrategy;
-
- /** The relying party configuration. */
- @Nullable private RelyingPartyConfiguration relyingPartyConfiguration;
-
- /** Profile configuration that is in use. */
- @Nullable private ProfileConfiguration profileConfiguration;
-
- /**
- * Get whether the relying party was verified in some fashion.
- *
- * @return true iff the relying party's identity was verified
- */
- public boolean isVerified() {
- if (verified != null) {
- return verified;
- } else if (verificationLookupStrategy != null) {
- final Boolean flag = verificationLookupStrategy.apply(this);
- if (flag != null) {
- return flag;
- }
- }
- return false;
- }
-
- /**
- * Set whether the relying party was verified in some fashion.
- *
- * @param flag explicit value for the verified setting
- *
- * @return this context
- */
- @Nonnull public RelyingPartyContext setVerified(@Nullable final Boolean flag) {
- verified = flag;
- return this;
- }
-
- /**
- * Get the unique identifier of the relying party.
- *
- * @return unique identifier of the relying party
- */
- @Nullable public String getRelyingPartyId() {
-
- if (relyingPartyId != null) {
- return relyingPartyId;
- } else if (relyingPartyIdLookupStrategy != null) {
- return relyingPartyIdLookupStrategy.apply(this);
- } else {
- return null;
- }
- }
-
-
- /**
- * Set the unique identifier of the relying party.
- *
- * @param rpId the relying party identifier, or null
- *
- * @return this context
- */
- @Nonnull public RelyingPartyContext setRelyingPartyId(@Nullable final String rpId) {
- relyingPartyId = StringSupport.trimOrNull(rpId);
- return this;
- }
-
- /**
- * Get the context tree containing identifying information for this relying party.
- *
- * <p>The subtree root may, but need not, be an actual subcontext of this context.</p>
- *
- * @return context tree
- */
- @Nullable public BaseContext getRelyingPartyIdContextTree() {
- return relyingPartyIdContextTree;
- }
-
- /**
- * Set the context tree containing identifying information for this relying party.
- *
- * <p>The subtree root may, but need not, be an actual subcontext of this context.</p>
- *
- * @param root root of context tree
- *
- * @return this context
- */
- @Nonnull public RelyingPartyContext setRelyingPartyIdContextTree(@Nullable final BaseContext root) {
- relyingPartyIdContextTree = root;
- return this;
- }
-
- /**
- * Get the lookup strategy for a non-explicit verification determination.
- *
- * @return lookup strategy
- */
- @Nullable Function<RelyingPartyContext,Boolean> getVerificationLookupStrategy() {
- return verificationLookupStrategy;
- }
-
- /**
- * Set the lookup strategy for a non-explicit verification determination.
- *
- * @param strategy lookup strategy
- *
- * @return this context
- */
- @Nonnull public RelyingPartyContext setVerificationLookupStrategy(
- @Nonnull final Function<RelyingPartyContext,Boolean> strategy) {
- verificationLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy cannot be null");
- return this;
- }
-
- /**
- * Get the lookup strategy for a non-explicit relying party ID.
- *
- * @return lookup strategy
- */
- @Nullable Function<RelyingPartyContext,String> getRelyingPartyIdLookupStrategy() {
- return relyingPartyIdLookupStrategy;
- }
-
- /**
- * Set the lookup strategy for a non-explicit relying party ID.
- *
- * @param strategy lookup strategy
- *
- * @return this context
- */
- @Nonnull public RelyingPartyContext setRelyingPartyIdLookupStrategy(
- @Nonnull final Function<RelyingPartyContext,String> strategy) {
- relyingPartyIdLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy cannot be null");
- return this;
- }
-
- /**
- * Get the relying party configuration.
- *
- * @return the relying party configuration, or null
- */
- @Nullable public RelyingPartyConfiguration getConfiguration() {
- return relyingPartyConfiguration;
- }
-
- /**
- * Set the configuration to use when processing requests for this relying party.
- *
- * @param config configuration to use when processing requests for this relying party, or null
- *
- * @return this context
- */
- @Nonnull public RelyingPartyContext setConfiguration(@Nullable final RelyingPartyConfiguration config) {
- relyingPartyConfiguration = config;
- return this;
- }
-
- /**
- * Get the configuration for the request profile currently being processed.
- *
- * @return profile configuration for the request profile currently being processed, or null
- */
- @Nullable public ProfileConfiguration getProfileConfig() {
- return profileConfiguration;
- }
-
- /**
- * Set the configuration for the request profile currently being processed.
- *
- * @param config configuration for the request profile currently being processed, or null
- *
- * @return this context
- */
- @Nonnull public RelyingPartyContext setProfileConfig(@Nullable final ProfileConfiguration config) {
- profileConfiguration = config;
- return this;
- }
-
-}
\ No newline at end of file
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/AbstractRelyingPartyLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/AbstractRelyingPartyLookupFunction.java
index ecca762d6..e131e01b8 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/AbstractRelyingPartyLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/AbstractRelyingPartyLookupFunction.java
@@ -21,7 +21,7 @@ import java.util.function.Function;
import javax.annotation.Nonnull;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByCurrent.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByCurrent.java
index 04f73891a..fad43fda1 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByCurrent.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByCurrent.java
@@ -22,7 +22,7 @@ import javax.annotation.Nullable;
import org.opensaml.messaging.context.navigate.ContextDataLookupFunction;
import net.shibboleth.idp.profile.context.MultiRelyingPartyContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
/** A function that returns {@link MultiRelyingPartyContext#getCurrentRelyingPartyContext()}. */
public class RelyingPartyContextLookupByCurrent
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupById.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupById.java
index 4b36589d4..bca385669 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupById.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupById.java
@@ -23,7 +23,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.idp.profile.context.MultiRelyingPartyContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.ParameterName;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.logic.Constraint;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByLabel.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByLabel.java
index 770e7d072..8d6c85072 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByLabel.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyContextLookupByLabel.java
@@ -24,7 +24,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.idp.profile.context.MultiRelyingPartyContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.ParameterName;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.logic.Constraint;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyIdLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyIdLookupFunction.java
index 3e67d56c3..b7898e398 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyIdLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/RelyingPartyIdLookupFunction.java
@@ -19,10 +19,10 @@ package net.shibboleth.idp.profile.context.navigate;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-
import org.opensaml.profile.context.ProfileRequestContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+
/**
* A function that returns {@link RelyingPartyContext#getRelyingPartyId()} from a
* {@link RelyingPartyContext} obtained via a lookup function, by default a child of the {@link ProfileRequestContext}.
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/ResponderIdLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/ResponderIdLookupFunction.java
index 53e1ec203..0d95b8322 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/ResponderIdLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/ResponderIdLookupFunction.java
@@ -21,8 +21,8 @@ import javax.annotation.Nullable;
import net.shibboleth.profile.config.OverriddenIssuerProfileConfiguration;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -52,8 +52,8 @@ public class ResponderIdLookupFunction extends AbstractRelyingPartyLookupFunctio
}
final RelyingPartyConfiguration rpConfig = rpc.getConfiguration();
- if (rpConfig != null) {
- return rpConfig.getResponderId(input);
+ if (rpConfig instanceof net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) {
+ return ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpConfig).getResponderId(input);
}
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/messaging/AbstractRelyingPartyLookupFunction.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/messaging/AbstractRelyingPartyLookupFunction.java
index 7fdf41f85..cb925e577 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/messaging/AbstractRelyingPartyLookupFunction.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/navigate/messaging/AbstractRelyingPartyLookupFunction.java
@@ -28,7 +28,7 @@ import org.opensaml.messaging.context.navigate.ContextDataLookupFunction;
import org.opensaml.messaging.context.navigate.RecursiveTypedParentContextLookup;
import org.opensaml.profile.context.ProfileRequestContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractAttributePredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractAttributePredicate.java
index dcfeee295..0791b770c 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractAttributePredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractAttributePredicate.java
@@ -30,7 +30,7 @@ import org.slf4j.Logger;
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractRelyingPartyPredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractRelyingPartyPredicate.java
index 7a808685b..282308aae 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractRelyingPartyPredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/AbstractRelyingPartyPredicate.java
@@ -21,7 +21,7 @@ import java.util.function.Function;
import javax.annotation.Nonnull;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import java.util.function.Predicate;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicate.java
index c2a8fe1b0..7fa4e5568 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicate.java
@@ -17,7 +17,6 @@
package net.shibboleth.idp.profile.logic;
-import java.util.Collections;
import java.util.Map;
import java.util.function.Function;
@@ -33,9 +32,10 @@ import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.MetricRegistry.MetricSupplier;
import com.codahale.metrics.SlidingTimeWindowMovingAverages;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.Positive;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.logic.FunctionSupport;
import net.shibboleth.shared.primitive.LoggerFactory;
@@ -62,7 +62,7 @@ public class LoopDetectionPredicate extends AbstractRelyingPartyPredicate {
/** Constructor. */
public LoopDetectionPredicate() {
threshold = 20;
- relyingPartyMap = Collections.emptyMap();
+ relyingPartyMap = CollectionSupport.emptyMap();
usernameLookupStrategy = FunctionSupport.constant(null);
}
@@ -84,9 +84,9 @@ public class LoopDetectionPredicate extends AbstractRelyingPartyPredicate {
*/
public void setRelyingPartyMap(@Nullable @NonnullElements final Map<String,String> map) {
if (map != null) {
- relyingPartyMap = Map.copyOf(map);
+ relyingPartyMap = CollectionSupport.copyToMap(map);
} else {
- relyingPartyMap = Collections.emptyMap();
+ relyingPartyMap = CollectionSupport.emptyMap();
}
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java
index dc911dac0..1c10759a9 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicate.java
@@ -18,15 +18,16 @@
package net.shibboleth.idp.profile.logic;
import java.util.Collection;
-import java.util.Collections;
import java.util.function.Predicate;
import javax.annotation.Nonnull;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.ParameterName;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.StrategyIndirectedPredicate;
import net.shibboleth.shared.primitive.StringSupport;
@@ -35,7 +36,7 @@ import org.opensaml.profile.context.ProfileRequestContext;
/**
* Predicate that evaluates a {@link ProfileRequestContext} by looking for a relying party ID
* that matches one of a designated set, or a generic predicate. The ID is obtained from a
- * {@link net.shibboleth.idp.profile.context.RelyingPartyContext} child of the profile request context.
+ * {@link RelyingPartyContext} child of the profile request context.
*/
public class RelyingPartyIdPredicate extends StrategyIndirectedPredicate<ProfileRequestContext,String> {
@@ -55,7 +56,7 @@ public class RelyingPartyIdPredicate extends StrategyIndirectedPredicate<Profile
* @param candidate a single value to check against
*/
public RelyingPartyIdPredicate(@Nonnull @NotEmpty @ParameterName(name="candidate") final String candidate) {
- this(Collections.singleton(candidate));
+ this(CollectionSupport.singleton(candidate));
}
/**
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/VerifiedProfilePredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/VerifiedProfilePredicate.java
index b6ab445db..11ac5d61a 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/VerifiedProfilePredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/VerifiedProfilePredicate.java
@@ -19,10 +19,10 @@ package net.shibboleth.idp.profile.logic;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-
import org.opensaml.profile.context.ProfileRequestContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+
/**
* Predicate to determine whether a profile request is from a verified source.
*/
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/messaging/AbstractRelyingPartyPredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/messaging/AbstractRelyingPartyPredicate.java
index 2f505364d..eda0d0b08 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/messaging/AbstractRelyingPartyPredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/messaging/AbstractRelyingPartyPredicate.java
@@ -27,7 +27,7 @@ import org.opensaml.messaging.context.MessageContext;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
import org.opensaml.messaging.context.navigate.RecursiveTypedParentContextLookup;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/CriteriaRelyingPartyConfigurationResolver.java b/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/CriteriaRelyingPartyConfigurationResolver.java
deleted file mode 100644
index 301005b7b..000000000
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/CriteriaRelyingPartyConfigurationResolver.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.relyingparty;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.security.config.SecurityConfiguration;
-
-import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.component.IdentifiedComponent;
-import net.shibboleth.shared.resolver.CriteriaSet;
-import net.shibboleth.shared.resolver.Resolver;
-
-/** Resolves a {@link RelyingPartyConfiguration} for a given {@link CriteriaSet}. */
-public interface CriteriaRelyingPartyConfigurationResolver extends Resolver<RelyingPartyConfiguration,CriteriaSet>,
- IdentifiedComponent {
-
- /**
- * Return the default security configuration for the profile.
- *
- * @param profileId the profile ID (available via {@link ProfileConfiguration#getId()}
- *
- * @return the configured default configuration
- */
- @Nullable SecurityConfiguration getDefaultSecurityConfiguration(@Nonnull @NotEmpty final String profileId);
-
-}
\ No newline at end of file
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyConfiguration.java b/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyConfiguration.java
index 9f3129ca0..274bfbbb2 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyConfiguration.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyConfiguration.java
@@ -17,10 +17,6 @@
package net.shibboleth.idp.relyingparty;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import java.util.function.Function;
import java.util.function.Predicate;
@@ -29,24 +25,18 @@ import javax.annotation.Nullable;
import org.opensaml.profile.context.ProfileRequestContext;
-import net.shibboleth.profile.config.ProfileConfiguration;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.annotation.constraint.NotLive;
-import net.shibboleth.shared.annotation.constraint.Unmodifiable;
-import net.shibboleth.shared.collection.CollectionSupport;
-import net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.IdentifiedComponent;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.logic.FunctionSupport;
import net.shibboleth.shared.logic.PredicateSupport;
import net.shibboleth.shared.primitive.StringSupport;
-/** The configuration that applies to a given relying party. */
-public class RelyingPartyConfiguration extends AbstractIdentifiableInitializableComponent implements
- IdentifiedComponent, Predicate<ProfileRequestContext> {
+/**
+ * IdP-specific subclass of base configuration class.
+ */
+public class RelyingPartyConfiguration extends net.shibboleth.profile.relyingparty.RelyingPartyConfiguration {
/** Lookup function to supply <code>responderId</code> property. */
@NonnullAfterInit private Function<ProfileRequestContext,String> responderIdLookupStrategy;
@@ -54,18 +44,9 @@ public class RelyingPartyConfiguration extends AbstractIdentifiableInitializable
/** Controls whether detailed information about errors should be exposed. */
@Nonnull private Predicate<ProfileRequestContext> detailedErrorsPredicate;
- /** Lookup function to supply <code>profileConfigurations</code> property. */
- @Nonnull
- private Function<ProfileRequestContext,Map<String,ProfileConfiguration>> profileConfigurationsLookupStrategy;
-
- /** Predicate that must be true for this configuration to be active for a given request. */
- @Nonnull private Predicate<ProfileRequestContext> activationCondition;
-
/** Constructor. */
public RelyingPartyConfiguration() {
- activationCondition = PredicateSupport.alwaysTrue();
detailedErrorsPredicate = PredicateSupport.alwaysFalse();
- profileConfigurationsLookupStrategy = FunctionSupport.constant(null);
}
/**
@@ -134,89 +115,6 @@ public class RelyingPartyConfiguration extends AbstractIdentifiableInitializable
detailedErrorsPredicate = Constraint.isNotNull(condition, "Condition cannot be null");
}
- /**
- * Get the unmodifiable set of profile configurations for this relying party.
- *
- * @param profileRequestContext current profile request context
- *
- * @return unmodifiable set of profile configurations for this relying party, never null
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive public Map<String,ProfileConfiguration> getProfileConfigurations(
- @Nullable final ProfileRequestContext profileRequestContext) {
-
- final Map<String,ProfileConfiguration> map = profileConfigurationsLookupStrategy.apply(profileRequestContext);
- if (map != null) {
- return CollectionSupport.copyToMap(map);
- }
- return CollectionSupport.emptyMap();
- }
-
- /**
- * Get the profile configuration, for the relying party, for the given profile. This is a convenience method and is
- * equivalent to calling {@link Map#get(Object)} on the return of
- * {@link #getProfileConfigurations(ProfileRequestContext)}. This map contains no null entries, keys, or values.
- *
- * @param profileRequestContext current profile request context
- * @param profileId the ID of the profile
- *
- * @return the configuration for the profile or null if the profile ID was null or empty or there is no
- * configuration for the given profile
- */
- @Nullable public ProfileConfiguration getProfileConfiguration(
- @Nullable final ProfileRequestContext profileRequestContext, @Nullable final String profileId) {
- final String trimmedId = StringSupport.trimOrNull(profileId);
- if (trimmedId == null) {
- return null;
- }
-
- return getProfileConfigurations(profileRequestContext).get(trimmedId);
- }
-
- /**
- * Set the profile configurations for this relying party.
- *
- * @param configs the configurations to set
- */
- public void setProfileConfigurations(@Nullable @NonnullElements final Collection<ProfileConfiguration> configs) {
- checkSetterPreconditions();
- if (configs == null) {
- profileConfigurationsLookupStrategy = FunctionSupport.constant(null);
- } else {
- final HashMap<String,ProfileConfiguration> map = new HashMap<>();
- for (final ProfileConfiguration config : List.copyOf(configs)) {
- final String trimmedId =
- Constraint.isNotNull(StringSupport.trimOrNull(config.getId()),
- "ID of profile configuration class " + config.getClass().getName() + " cannot be null");
- map.put(trimmedId, config);
- }
- profileConfigurationsLookupStrategy = FunctionSupport.constant(Map.copyOf(map));
- }
- }
-
- /**
- * Set a lookup strategy for the <code>profileConfigurations</code> property.
- *
- * @param strategy lookup strategy
- *
- * @since 4.0.0
- */
- public void setProfileConfigurationsLookupStrategy(
- @Nonnull final Function<ProfileRequestContext,Map<String,ProfileConfiguration>> strategy) {
- checkSetterPreconditions();
- profileConfigurationsLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy cannot be null");
- }
-
- /**
- * Set the condition under which the relying party configuration should be active.
- *
- * @param condition the activation condition
- */
- public void setActivationCondition(@Nonnull final Predicate<ProfileRequestContext> condition) {
- checkSetterPreconditions();
- activationCondition =
- Constraint.isNotNull(condition, "Relying party configuration activation condition cannot be null");
- }
-
/** {@inheritDoc} */
@Override protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
@@ -224,13 +122,6 @@ public class RelyingPartyConfiguration extends AbstractIdentifiableInitializable
if (responderIdLookupStrategy == null) {
throw new ComponentInitializationException("ResponderID lookup strategy cannot be null");
}
-
- }
-
- /** {@inheritDoc} */
- public boolean test(@Nullable final ProfileRequestContext input) {
- checkComponentActive();
- return activationCondition.test(input);
}
}
\ No newline at end of file
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyConfigurationResolver.java b/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyConfigurationResolver.java
deleted file mode 100644
index 41f7c3e98..000000000
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/relyingparty/RelyingPartyConfigurationResolver.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.relyingparty;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.component.IdentifiedComponent;
-import net.shibboleth.shared.resolver.Resolver;
-
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.security.config.SecurityConfiguration;
-
-/** Resolves a {@link RelyingPartyConfiguration} for a given profile request context. */
-public interface RelyingPartyConfigurationResolver extends Resolver<RelyingPartyConfiguration,ProfileRequestContext>,
- IdentifiedComponent {
-
- /**
- * Return the default security configuration for the profile.
- *
- * @param profileId the profile ID (available via {@link ProfileConfiguration#getId()}
- *
- * @return the configured default configuration
- */
- @Nullable SecurityConfiguration getDefaultSecurityConfiguration(@Nonnull @NotEmpty final String profileId);
-
-}
\ No newline at end of file
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java
index ba86b8baf..6b424e3dd 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java
@@ -22,7 +22,8 @@ import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+
import org.opensaml.profile.context.ProfileRequestContext;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicateTest.java
index b61f919c0..3dc7e939c 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicateTest.java
@@ -22,7 +22,7 @@ import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.FunctionSupport;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -39,6 +39,7 @@ import static org.testng.Assert.*;
/**
* Unit test for {@link DynamicAttributePredicate}.
*/
+ at SuppressWarnings("javadoc")
public class DynamicAttributePredicateTest {
@Test
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicateTest.java
index 7817b3059..da22e035c 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/LoopDetectionPredicateTest.java
@@ -19,7 +19,7 @@ package net.shibboleth.idp.profile.logic;
import java.util.Map;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.FunctionSupport;
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
@@ -29,6 +29,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link LoopDetectionPredicate}. */
+ at SuppressWarnings("javadoc")
public class LoopDetectionPredicateTest extends OpenSAMLInitBaseTestCase {
private ProfileRequestContext prc;
@@ -38,7 +39,7 @@ public class LoopDetectionPredicateTest extends OpenSAMLInitBaseTestCase {
@BeforeMethod
public void setUp() {
prc = new ProfileRequestContext();
- rpCtx = prc.getSubcontext(RelyingPartyContext.class, true);
+ rpCtx = prc.getOrCreateSubcontext(RelyingPartyContext.class);
pred = new LoopDetectionPredicate();
pred.setUsernameLookupStrategy(FunctionSupport.constant("jdoe.1"));
}
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java
index 7773fbb03..0735adef2 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java
@@ -17,9 +17,8 @@
package net.shibboleth.idp.profile.logic;
-import java.util.Collections;
-
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -28,6 +27,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link RelyingPartyIdPredicate}. */
+ at SuppressWarnings("javadoc")
public class RelyingPartyIdPredicateTest {
private ProfileRequestContext prc;
@@ -42,7 +42,7 @@ public class RelyingPartyIdPredicateTest {
@Test
public void testNone() throws ComponentInitializationException {
- final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(Collections.<String>emptySet());
+ final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(CollectionSupport.emptySet());
Assert.assertFalse(pred.test(prc));
@@ -52,7 +52,7 @@ public class RelyingPartyIdPredicateTest {
@Test
public void testMatch() throws ComponentInitializationException {
- final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(Collections.singleton("foo"));
+ final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(CollectionSupport.singleton("foo"));
Assert.assertFalse(pred.test(prc));
@@ -62,7 +62,7 @@ public class RelyingPartyIdPredicateTest {
@Test
public void testNoMatch() throws ComponentInitializationException {
- final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(Collections.singleton("bar"));
+ final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(CollectionSupport.singleton("bar"));
Assert.assertFalse(pred.test(prc));
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java
index 40070d5a5..e944a6cb1 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java
@@ -19,7 +19,7 @@ package net.shibboleth.idp.profile.logic;
import javax.script.ScriptException;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.spring.custom.SchemaTypeAwareXMLBeanDefinitionReader;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -32,6 +32,7 @@ import org.testng.annotations.Test;
/**
* Tests for {@link ScriptedPredicate}.
*/
+ at SuppressWarnings("javadoc")
public class ScriptedPredicateTest {
private ProfileRequestContext withChild;
@@ -40,7 +41,7 @@ public class ScriptedPredicateTest {
@BeforeClass public void setup() {
withChild = new ProfileRequestContext();
- withChild.getSubcontext(RelyingPartyContext.class, true);
+ withChild.getOrCreateSubcontext(RelyingPartyContext.class);
noChild = new ProfileRequestContext();
}
@@ -70,7 +71,7 @@ public class ScriptedPredicateTest {
@Test public void inlineBean() throws ScriptException {
try (final GenericApplicationContext ctx = new GenericApplicationContext()) {
- SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
+ final SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
new SchemaTypeAwareXMLBeanDefinitionReader(ctx);
beanDefinitionReader.loadBeanDefinitions(new ClassPathResource(
@@ -88,7 +89,7 @@ public class ScriptedPredicateTest {
@Test public void resourceBean() throws ScriptException {
try (final GenericApplicationContext ctx = new GenericApplicationContext()) {
- SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
+ final SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
new SchemaTypeAwareXMLBeanDefinitionReader(ctx);
beanDefinitionReader.loadBeanDefinitions(new ClassPathResource(
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicateTest.java
index 24fced5d4..d68ca010e 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicateTest.java
@@ -22,7 +22,8 @@ import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+
import org.opensaml.profile.context.ProfileRequestContext;
import org.testng.annotations.Test;
@@ -37,6 +38,7 @@ import static org.testng.Assert.*;
/**
* Unit test for {@link SimpleAttributePredicate}.
*/
+ at SuppressWarnings("javadoc")
public class SimpleAttributePredicateTest {
@Test
diff --git a/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/inlineBean.xml b/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/inlineBean.xml
index d446b231d..d2269a107 100644
--- a/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/inlineBean.xml
+++ b/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/inlineBean.xml
@@ -13,7 +13,7 @@
<value>
<![CDATA[
value = true;
- if (null == profileContext.getSubcontext("net.shibboleth.idp.profile.context.RelyingPartyContext")) {
+ if (null == profileContext.getSubcontext("net.shibboleth.profile.context.RelyingPartyContext")) {
value = false;
}
value;
diff --git a/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/script.js b/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/script.js
index 867b453f7..4da3293b1 100644
--- a/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/script.js
+++ b/idp-profile-api/src/test/resources/net/shibboleth/idp/profile/logic/script.js
@@ -1,5 +1,5 @@
value = true;
-if (null == profileContext.getSubcontext("net.shibboleth.idp.profile.context.RelyingPartyContext")) {
+if (null == profileContext.getSubcontext("net.shibboleth.profile.context.RelyingPartyContext")) {
value = false;
}
value;
diff --git a/idp-profile-impl/pom.xml b/idp-profile-impl/pom.xml
index 733d0e31e..52fed1663 100644
--- a/idp-profile-impl/pom.xml
+++ b/idp-profile-impl/pom.xml
@@ -35,19 +35,20 @@
<dependency>
<groupId>net.shibboleth</groupId>
- <artifactId>shib-attribute-api</artifactId>
+ <artifactId>shib-profile-api</artifactId>
</dependency>
+
<dependency>
<groupId>net.shibboleth</groupId>
- <artifactId>shib-attribute-resolver-api</artifactId>
+ <artifactId>shib-attribute-api</artifactId>
</dependency>
<dependency>
<groupId>net.shibboleth</groupId>
- <artifactId>shib-attribute-filter-api</artifactId>
+ <artifactId>shib-attribute-resolver-api</artifactId>
</dependency>
<dependency>
<groupId>net.shibboleth</groupId>
- <artifactId>shib-metadata-spring</artifactId>
+ <artifactId>shib-attribute-filter-api</artifactId>
</dependency>
<dependency>
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/AttributesAuditExtractor.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/AttributesAuditExtractor.java
index aaee6f028..7f9d671dd 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/AttributesAuditExtractor.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/AttributesAuditExtractor.java
@@ -29,7 +29,7 @@ import org.opensaml.messaging.context.navigate.ChildContextLookup;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/** {@link Function} that returns the attribute IDs from an {@link AttributeContext}. */
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java
index 982851874..646b0e6e0 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/FilterAttributes.java
@@ -43,9 +43,9 @@ import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.authn.context.navigate.SubjectContextPrincipalLookupFunction;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.service.ReloadableService;
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolveAttributes.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolveAttributes.java
index 6efbcca29..d22269c02 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolveAttributes.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolveAttributes.java
@@ -38,10 +38,10 @@ import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.authn.context.navigate.SubjectContextPrincipalLookupFunction;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.SpringRequestContext;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.logic.FunctionSupport;
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectProfileConfiguration.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectProfileConfiguration.java
index 169c3fbe2..6564074b0 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectProfileConfiguration.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectProfileConfiguration.java
@@ -29,10 +29,10 @@ import org.slf4j.Logger;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.profile.config.ConditionalProfileConfiguration;
import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfiguration.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfiguration.java
index 973b3ef05..a300803f1 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfiguration.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfiguration.java
@@ -31,17 +31,19 @@ import org.slf4j.Logger;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.CriteriaRelyingPartyConfigurationResolver;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.relyingparty.VerifiedProfileCriterion;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.resolver.CriteriaSet;
-import net.shibboleth.shared.resolver.Resolver;
import net.shibboleth.shared.resolver.ResolverException;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
+import net.shibboleth.shared.service.ServiceableComponent;
/**
* This action attempts to resolve a {@link RelyingPartyConfiguration} and adds it to the {@link RelyingPartyContext}
@@ -62,12 +64,12 @@ public final class SelectRelyingPartyConfiguration extends AbstractProfileAction
@Nonnull private final Logger log = LoggerFactory.getLogger(SelectRelyingPartyConfiguration.class);
/** Resolver used to look up relying party configurations. */
- @NonnullAfterInit private Resolver<RelyingPartyConfiguration,?> rpConfigResolver;
+ @NonnullAfterInit private ReloadableService<RelyingPartyConfigurationResolver> rpConfigResolver;
/**
* Strategy used to locate the {@link RelyingPartyContext} associated with a given {@link ProfileRequestContext}.
*/
- @Nonnull private Function<ProfileRequestContext, RelyingPartyContext> relyingPartyContextLookupStrategy;
+ @Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy;
/** The {@link RelyingPartyContext} to manipulate. */
@Nullable private RelyingPartyContext relyingPartyCtx;
@@ -82,8 +84,10 @@ public final class SelectRelyingPartyConfiguration extends AbstractProfileAction
*
* @param resolver the resolver to use
*/
- public void setRelyingPartyConfigurationResolver(@Nonnull final Resolver<RelyingPartyConfiguration,?> resolver) {
+ public void setRelyingPartyConfigurationResolver(
+ @Nonnull final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
checkSetterPreconditions();
+
rpConfigResolver = Constraint.isNotNull(resolver, "Relying party configuration resolver cannot be null");
}
@@ -95,8 +99,9 @@ public final class SelectRelyingPartyConfiguration extends AbstractProfileAction
* {@link ProfileRequestContext}
*/
public void setRelyingPartyContextLookupStrategy(
- @Nonnull final Function<ProfileRequestContext, RelyingPartyContext> strategy) {
+ @Nonnull final Function<ProfileRequestContext,RelyingPartyContext> strategy) {
checkSetterPreconditions();
+
relyingPartyContextLookupStrategy =
Constraint.isNotNull(strategy, "RelyingPartyContext lookup strategy cannot be null");
}
@@ -132,33 +137,30 @@ public final class SelectRelyingPartyConfiguration extends AbstractProfileAction
@Override
public void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
- try {
+ try (final ServiceableComponent<RelyingPartyConfigurationResolver> resolver =
+ rpConfigResolver.getServiceableComponent()) {
+
final RelyingPartyConfiguration config;
- if (rpConfigResolver instanceof RelyingPartyConfigurationResolver) {
- // Old style.
- config = ((RelyingPartyConfigurationResolver) rpConfigResolver).resolveSingle(profileRequestContext);
- } else if (rpConfigResolver instanceof CriteriaRelyingPartyConfigurationResolver) {
- // New style.
- final CriteriaSet criteria = new CriteriaSet();
- if (relyingPartyCtx.getParent() == profileRequestContext) {
- // Works as is.
- criteria.add(new ProfileRequestContextCriterion(profileRequestContext));
- config = ((CriteriaRelyingPartyConfigurationResolver) rpConfigResolver).resolveSingle(criteria);
- } else {
- // Temporarily re-root for compatibility.
- final ProfileRequestContext newPRC = new ProfileRequestContext();
- final BaseContext originalParent = relyingPartyCtx.getParent();
- newPRC.addSubcontext(relyingPartyCtx);
- criteria.add(new ProfileRequestContextCriterion(newPRC));
- config = ((CriteriaRelyingPartyConfigurationResolver) rpConfigResolver).resolveSingle(criteria);
- if (originalParent != null) {
- originalParent.addSubcontext(relyingPartyCtx);
- }
- }
+ final CriteriaSet criteria = new CriteriaSet();
+ if (relyingPartyCtx.isVerified()) {
+ criteria.add(new VerifiedProfileCriterion(true));
+ }
+ if (relyingPartyCtx.getParent() == profileRequestContext) {
+ // Works as is.
+ criteria.add(new ProfileRequestContextCriterion(profileRequestContext));
+ config = resolver.getComponent().resolveSingle(criteria);
} else {
- log.error("{} Unsupported resolver type: {}", getLogPrefix(), rpConfigResolver.getClass().getName());
- ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_RELYING_PARTY_CONFIG);
- return;
+ // Temporarily re-root for compatibility.
+ // TODO: I think this *may* be moot now with the addition of the
+ // explicit VerifiedProfileCriterion.
+ final ProfileRequestContext newPRC = new ProfileRequestContext();
+ final BaseContext originalParent = relyingPartyCtx.getParent();
+ newPRC.addSubcontext(relyingPartyCtx);
+ criteria.add(new ProfileRequestContextCriterion(newPRC));
+ config = resolver.getComponent().resolveSingle(criteria);
+ if (originalParent != null) {
+ originalParent.addSubcontext(relyingPartyCtx);
+ }
}
if (config == null) {
@@ -172,6 +174,9 @@ public final class SelectRelyingPartyConfiguration extends AbstractProfileAction
} catch (final ResolverException e) {
log.error("{} Error trying to resolve relying party configuration", getLogPrefix(), e);
ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_RELYING_PARTY_CONFIG);
+ } catch (final ServiceException e) {
+ log.error("{} Invalid relying party configuration", getLogPrefix(), e);
+ ActionSupport.buildEvent(profileRequestContext, IdPEventIds.INVALID_RELYING_PARTY_CONFIG);
}
}
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectProfileConfiguration.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectProfileConfiguration.java
index a1519e3ce..593b8773b 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectProfileConfiguration.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectProfileConfiguration.java
@@ -33,8 +33,8 @@ import org.slf4j.Logger;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectRelyingPartyConfiguration.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectRelyingPartyConfiguration.java
index 2fbf70873..332d2b8f8 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectRelyingPartyConfiguration.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/messaging/impl/SelectRelyingPartyConfiguration.java
@@ -31,15 +31,18 @@ import org.opensaml.messaging.handler.AbstractMessageHandler;
import org.opensaml.messaging.handler.MessageHandlerException;
import org.slf4j.Logger;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.CriteriaRelyingPartyConfigurationResolver;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.relyingparty.VerifiedProfileCriterion;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.resolver.CriteriaSet;
import net.shibboleth.shared.resolver.ResolverException;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
/**
* This message handler attempts to resolve a {@link RelyingPartyConfiguration} and adds it to the
@@ -47,7 +50,7 @@ import net.shibboleth.shared.resolver.ResolverException;
*
* @post If a {@link RelyingPartyContext} is located, it will be populated with a non-null result of applying
* the supplied
- * {@link CriteriaRelyingPartyConfigurationResolver} to the {@link RelyingPartyContext#getRelyingPartyId()}.
+ * {@link RelyingPartyConfigurationResolver} to the {@link RelyingPartyContext#getRelyingPartyId()}.
*/
public final class SelectRelyingPartyConfiguration extends AbstractMessageHandler {
@@ -55,7 +58,7 @@ public final class SelectRelyingPartyConfiguration extends AbstractMessageHandle
@Nonnull private final Logger log = LoggerFactory.getLogger(SelectRelyingPartyConfiguration.class);
/** Resolver used to look up relying party configurations. */
- @NonnullAfterInit private CriteriaRelyingPartyConfigurationResolver rpConfigResolver;
+ @NonnullAfterInit private ReloadableService<RelyingPartyConfigurationResolver> rpConfigResolver;
/**
* Strategy used to locate the {@link RelyingPartyContext} associated with a given {@link MessageContext}.
@@ -78,7 +81,7 @@ public final class SelectRelyingPartyConfiguration extends AbstractMessageHandle
* @param resolver the resolver to use
*/
public void setRelyingPartyConfigurationResolver(
- @Nonnull final CriteriaRelyingPartyConfigurationResolver resolver) {
+ @Nonnull final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
checkSetterPreconditions();
rpConfigResolver = Constraint.isNotNull(resolver, "Relying party configuration resolver cannot be null");
}
@@ -129,8 +132,11 @@ public final class SelectRelyingPartyConfiguration extends AbstractMessageHandle
public void doInvoke(@Nonnull final MessageContext messageContext) throws MessageHandlerException {
try {
- final CriteriaSet criteria = new CriteriaSet(new EntityIdCriterion(relyingPartyCtx.getRelyingPartyId()));
- final RelyingPartyConfiguration config = rpConfigResolver.resolveSingle(criteria);
+ // Implicitly "verified", so we include the criterion for that.
+ final CriteriaSet criteria = new CriteriaSet(new EntityIdCriterion(relyingPartyCtx.getRelyingPartyId()),
+ new VerifiedProfileCriterion(true));
+ final RelyingPartyConfiguration config =
+ rpConfigResolver.getServiceableComponent().getComponent().resolveSingle(criteria);
if (config == null) {
log.debug("{} No relying party configuration applies to this request", getLogPrefix());
throw new MessageHandlerException("No relying party configuration resolved for this request");
@@ -141,6 +147,9 @@ public final class SelectRelyingPartyConfiguration extends AbstractMessageHandle
} catch (final ResolverException e) {
log.error("{} Error trying to resolve relying party configuration: {}", getLogPrefix(), e.getMessage());
throw new MessageHandlerException("Error trying to resolve relying party configuration", e);
+ } catch (final ServiceException e) {
+ log.error("{} Invalid relying party configuration: {}", getLogPrefix(), e.getMessage());
+ throw new MessageHandlerException("Invalid relying party configuration", e);
}
}
}
\ No newline at end of file
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/CriteriaSelfEntityIDResolver.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/CriteriaSelfEntityIDResolver.java
index 5ff7a5ee8..027e2ca52 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/CriteriaSelfEntityIDResolver.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/CriteriaSelfEntityIDResolver.java
@@ -30,9 +30,9 @@ import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.metadata.RoleDescriptor;
import org.slf4j.Logger;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.CriteriaRelyingPartyConfigurationResolver;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
@@ -40,18 +40,19 @@ import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.component.IdentifiableComponent;
-import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.resolver.CriteriaSet;
import net.shibboleth.shared.resolver.Resolver;
import net.shibboleth.shared.resolver.ResolverException;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceException;
/**
- * Resolver which uses an instance of {@link CriteriaRelyingPartyConfigurationResolver} to
- * resolve the self entityID.
+ * Resolver which uses an instance of {@link RelyingPartyConfigurationResolver} to
+ * resolve our own entityID.
*
* <p>
- * The required and allowed criteria are the same as the {@link CriteriaRelyingPartyConfigurationResolver}
+ * The required and allowed criteria are the same as the {@link RelyingPartyConfigurationResolver}
* implementation in use.
* </p>
*/
@@ -61,17 +62,18 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
/** Logger. */
@Nonnull private Logger log = LoggerFactory.getLogger(CriteriaSelfEntityIDResolver.class);
- /** The CriteriaRelyingPartyConfigurationResolver to which to delegate. */
- @NonnullAfterInit private CriteriaRelyingPartyConfigurationResolver rpcResolver;
+ /** The RelyingPartyConfigurationResolver to which to delegate. */
+ @NonnullAfterInit private ReloadableService<RelyingPartyConfigurationResolver> rpcResolver;
/**
- * Set the {@link CriteriaRelyingPartyConfigurationResolver} instance to which to delegate.
+ * Set the {@link RelyingPartyConfigurationResolver} instance to which to delegate.
*
* @param resolver the relying party resolver
*/
public void setRelyingPartyConfigurationResolver(
- @Nullable final CriteriaRelyingPartyConfigurationResolver resolver) {
+ @Nullable final ReloadableService<RelyingPartyConfigurationResolver> resolver) {
checkSetterPreconditions();
+
rpcResolver = resolver;
}
@@ -83,8 +85,9 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
/** {@inheritDoc} */
protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
+
if (rpcResolver == null) {
- throw new ComponentInitializationException("CriteriaRelyingPartyConfigurationResolver was null");
+ throw new ComponentInitializationException("RelyingPartyConfigurationResolver cannot be null");
}
}
@@ -95,8 +98,8 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
}
/** {@inheritDoc} */
- @Nonnull @NonnullElements public Iterable<String> resolve(
- @Nullable final CriteriaSet criteria) throws ResolverException {
+ @Nonnull @NonnullElements public Iterable<String> resolve(@Nullable final CriteriaSet criteria)
+ throws ResolverException {
checkComponentActive();
final String entityID = resolveSingle(criteria);
if (entityID != null) {
@@ -108,19 +111,30 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
/** {@inheritDoc} */
@Nullable public String resolveSingle(@Nullable final CriteriaSet criteria) throws ResolverException {
checkComponentActive();
- @Nonnull final ProfileRequestContext prc = Constraint.isNotNull(buildContext(criteria), "Could not build context");
+
+ final ProfileRequestContext prc = buildContext(criteria);
+ if (prc == null) {
+ log.error("Unable to extract or build ProfileRequestContext for resolution");
+ return null;
+ }
+
final CriteriaSet prcSet = new CriteriaSet(new ProfileRequestContextCriterion(prc));
- final RelyingPartyConfiguration rpc = rpcResolver.resolveSingle(prcSet);
- if (rpc != null) {
- return rpc.getResponderId(prc);
+ try {
+ final RelyingPartyConfiguration rpc =
+ rpcResolver.getServiceableComponent().getComponent().resolveSingle(prcSet);
+ if (rpc instanceof net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) {
+ return ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpc).getResponderId(prc);
+ }
+ } catch (final ServiceException e) {
+ log.error("RelyingPartyConfiguration resolver unvailable", e);
}
return null;
}
/**
- * Build and populate the synthetic instance of {@link ProfileRequestContext} which will be passed
- * in the resolution call to the delegate.
+ * Build and populate the synthetic instance of {@link ProfileRequestContext} which will be used
+ * in the resolution call to the delegate as well as to resolve the entityID setting.
*
* @param criteria the input criteria
* @return the synthetic context instance, or null if required data is not supplied
@@ -177,7 +191,7 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
* @param criteria the input criteria
* @return the input entityID criterion or null if could not be resolved
*/
- private String resolveEntityID(@Nonnull final CriteriaSet criteria) {
+ @Nullable private String resolveEntityID(@Nonnull final CriteriaSet criteria) {
final EntityIdCriterion eic = criteria.get(EntityIdCriterion.class);
if (eic != null) {
return eic.getEntityId();
@@ -197,7 +211,7 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
* @param criteria the input criteria
* @return the input entity descriptor criterion, or null if could not be resolved
*/
- private EntityDescriptor resolveEntityDescriptor(@Nonnull final CriteriaSet criteria) {
+ @Nullable private EntityDescriptor resolveEntityDescriptor(@Nonnull final CriteriaSet criteria) {
final RoleDescriptor rd = resolveRoleDescriptor(criteria);
if (rd != null && rd.getParent() != null && rd.getParent() instanceof EntityDescriptor) {
return (EntityDescriptor)rd.getParent();
@@ -212,7 +226,7 @@ public class CriteriaSelfEntityIDResolver extends AbstractIdentifiedInitializabl
* @param criteria the input criteria
* @return the input role descriptor criterion or null if could not be resolved
*/
- private RoleDescriptor resolveRoleDescriptor(@Nonnull final CriteriaSet criteria) {
+ @Nullable private RoleDescriptor resolveRoleDescriptor(@Nonnull final CriteriaSet criteria) {
final RoleDescriptorCriterion rdc = criteria.get(RoleDescriptorCriterion.class);
if (rdc != null) {
return rdc.getRole();
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
deleted file mode 100644
index 6abe2cac2..000000000
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.relyingparty.impl;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.security.config.SecurityConfiguration;
-import org.opensaml.security.credential.Credential;
-import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-
-import net.shibboleth.idp.profile.logic.VerifiedProfilePredicate;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
-import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.annotation.constraint.NotLive;
-import net.shibboleth.shared.annotation.constraint.Unmodifiable;
-import net.shibboleth.shared.collection.CollectionSupport;
-import net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent;
-import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.shared.resolver.ResolverException;
-import net.shibboleth.spring.security.CredentialHolder;
-
-/**
- * Retrieves a per-relying party configuration for a given profile request based on the request context.
- *
- * <p>
- * Note that this resolver does not permit more than one {@link RelyingPartyConfiguration} with the same ID.
- * </p>
- */
-public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiableInitializableComponent
- implements RelyingPartyConfigurationResolver {
-
- /** Class logger. */
- @Nonnull private final Logger log = LoggerFactory.getLogger(DefaultRelyingPartyConfigurationResolver.class);
-
- /** Registered relying party configurations. */
- @Nonnull private List<RelyingPartyConfiguration> rpConfigurations;
-
- /** Unverified relying party configuration, used if the request is unverified. */
- @Nullable private RelyingPartyConfiguration unverifiedConfiguration;
-
- /** Default relying party configuration, used if no other verified configuration matches. */
- @NonnullAfterInit private RelyingPartyConfiguration defaultConfiguration;
-
- /** The predicate which decides if this request is "verified". */
- @Nonnull private Predicate<ProfileRequestContext> verificationPredicate;
-
- /** A global default security configuration. */
- @Nullable private SecurityConfiguration defaultSecurityConfiguration;
-
- /** The global list of all configured signing credentials. */
- @Nonnull private List<Credential> signingCredentials;
-
- /** The global list of all configured encryption credentials. */
- @Nonnull private List<Credential> encryptionCredentials;
-
- /** Constructor. */
- public DefaultRelyingPartyConfigurationResolver() {
- rpConfigurations = CollectionSupport.emptyList();
- verificationPredicate = new VerifiedProfilePredicate();
- signingCredentials = CollectionSupport.emptyList();
- encryptionCredentials = CollectionSupport.emptyList();
- }
-
- /**
- * Get an unmodifiable list of verified relying party configurations.
- *
- * @return unmodifiable list of verified relying party configurations
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<RelyingPartyConfiguration>
- getRelyingPartyConfigurations() {
- return rpConfigurations;
- }
-
- /**
- * Set the verified relying party configurations.
- *
- * @param configs list of verified relying party configurations
- */
- public void setRelyingPartyConfigurations(@Nonnull @NonnullElements final List<RelyingPartyConfiguration> configs) {
- checkSetterPreconditions();
- rpConfigurations = CollectionSupport.copyToList(Constraint.isNotNull(configs, "RelyingPartyConfiguration list cannot be null"));
- }
-
- /**
- * Get the {@link RelyingPartyConfiguration} to use if no other verified configuration is acceptable.
- *
- * @return default verified configuration
- */
- @NonnullAfterInit public RelyingPartyConfiguration getDefaultConfiguration() {
- return defaultConfiguration;
- }
-
- /**
- * Set the {@link RelyingPartyConfiguration} to use if no other verified configuration is acceptable.
- *
- * @param configuration default verified configuration
- */
- public void setDefaultConfiguration(@Nonnull final RelyingPartyConfiguration configuration) {
- checkSetterPreconditions();
- defaultConfiguration = Constraint.isNotNull(configuration, "Default RP configuration cannot be null");
- }
-
- /**
- * Get the {@link RelyingPartyConfiguration} to use if the configuration is found to be "unverified"
- * (via use of {@link #getVerificationPredicate()}).
- *
- * @return unverified configuration
- */
- @NonnullAfterInit public RelyingPartyConfiguration getUnverifiedConfiguration() {
- return unverifiedConfiguration;
- }
-
- /**
- * Set the {@link RelyingPartyConfiguration} to use if the configuration is found to be "unverified"
- * (via use of {@link #getVerificationPredicate()}).
- *
- * @param configuration unverified configuration
- */
- public void setUnverifiedConfiguration(@Nonnull final RelyingPartyConfiguration configuration) {
- checkSetterPreconditions();
- unverifiedConfiguration = Constraint.isNotNull(configuration, "Unverified RP configuration cannot be null");
- }
-
- /**
- * Get the definition of what a verified request is.
- *
- * @return predicate for determination whether request is verified
- */
- @Nonnull public Predicate<ProfileRequestContext> getVerificationPredicate() {
- return verificationPredicate;
- }
-
- /**
- * Set the definition of what a verified request is.
- *
- * @param predicate predicate to set
- */
- public void setVerificationPredicate(@Nonnull final Predicate<ProfileRequestContext> predicate) {
- checkSetterPreconditions();
- verificationPredicate = Constraint.isNotNull(predicate, "Verification predicate cannot be null");
- }
-
- /**
- * Set the global default {@link SecurityConfiguration}.
- *
- * @param config global default
- */
- public void setDefaultSecurityConfiguration(@Nullable final SecurityConfiguration config) {
- checkSetterPreconditions();
- defaultSecurityConfiguration = config;
- }
-
- /** {@inheritDoc} */
- @Override protected void doInitialize() throws ComponentInitializationException {
- super.doInitialize();
-
- final HashSet<String> configIds = new HashSet<>(rpConfigurations.size());
- for (final RelyingPartyConfiguration config : rpConfigurations) {
- if (configIds.contains(config.getId())) {
- throw new ComponentInitializationException("Multiple relying party configurations with ID "
- + config.getId() + " detected. Configuration IDs must be unique.");
- }
- configIds.add(config.getId());
- }
- }
-
- /** {@inheritDoc} */
- @Override @Nonnull @NonnullElements public Iterable<RelyingPartyConfiguration> resolve(
- @Nullable final ProfileRequestContext context) throws ResolverException {
- checkComponentActive();
-
- if (context == null) {
- return CollectionSupport.emptyList();
- }
-
- log.debug("Resolving relying party configuration");
- if (!verificationPredicate.test(context)) {
- if (getUnverifiedConfiguration() == null) {
- log.warn("Profile request was unverified, but no such configuration is available");
- return CollectionSupport.emptyList();
- }
- final RelyingPartyConfiguration uvc = getUnverifiedConfiguration();
- assert uvc != null;
- log.debug("Profile request is unverified, returning configuration {}",
- uvc.getId());
- return CollectionSupport.singleton(uvc);
- }
-
- final ArrayList<RelyingPartyConfiguration> matches = new ArrayList<>();
-
- for (final RelyingPartyConfiguration configuration : rpConfigurations) {
- log.debug("Checking if relying party configuration {} is applicable", configuration.getId());
- if (configuration.test(context)) {
- log.debug("Relying party configuration {} is applicable", configuration.getId());
- matches.add(configuration);
- } else {
- log.debug("Relying party configuration {} is not applicable", configuration.getId());
- }
- }
-
- if (matches.isEmpty()) {
- final RelyingPartyConfiguration dc = getDefaultConfiguration();
- log.debug("No matching Relying Party Configuration found, returning the default configuration {}",
- dc.getId());
- return CollectionSupport.singleton(dc);
- }
- return matches;
- }
-
- /** {@inheritDoc} */
- @Override @Nullable public RelyingPartyConfiguration resolveSingle(@Nullable final ProfileRequestContext context)
- throws ResolverException {
- checkComponentActive();
-
- if (context == null) {
- return null;
- }
-
- log.debug("Resolving relying party configuration");
- if (!verificationPredicate.test(context)) {
- if (getUnverifiedConfiguration() == null) {
- log.warn("Profile request was unverified, but no such configuration is available");
- return null;
- }
- log.debug("Profile request is unverified, returning configuration {}",
- getUnverifiedConfiguration().getId());
- return getUnverifiedConfiguration();
- }
-
- for (final RelyingPartyConfiguration configuration : rpConfigurations) {
- log.debug("Checking if relying party configuration {} is applicable", configuration.getId());
- if (configuration.test(context)) {
- log.debug("Relying party configuration {} is applicable", configuration.getId());
- return configuration;
- }
- log.debug("Relying party configuration {} is not applicable", configuration.getId());
- }
-
- log.debug("No relying party configurations are applicable, returning the default configuration {}",
- getDefaultConfiguration().getId());
- return getDefaultConfiguration();
- }
-
- /** {@inheritDoc} */
- @Override
- @Nullable public SecurityConfiguration getDefaultSecurityConfiguration(@Nonnull @NotEmpty final String profileId) {
- return defaultSecurityConfiguration;
- }
-
- /**
- * Get the list of all configured signing credentials.
- *
- * @return the list of signing credentials
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<Credential> getSigningCredentials() {
- return signingCredentials;
- }
-
- /**
- * Set the list of all configured signing credentials.
- *
- * @param credentials the list of signing credentials, may be null
- */
- @Autowired
- @Qualifier("signing")
- public void setSigningCredentials(
- @Nullable @NonnullElements final List<CredentialHolder> credentials) {
- checkSetterPreconditions();
-
- if (credentials != null) {
- signingCredentials = credentials.stream()
- .flatMap(h -> h.getCredentials().stream())
- .collect(CollectionSupport.nonnullCollector(Collectors.toUnmodifiableList())).
- get();
- } else {
- signingCredentials = CollectionSupport.emptyList();
- }
- }
-
- /**
- * Get the list of all configured encryption credentials.
- *
- * @return the list of encryption credentials
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<Credential> getEncryptionCredentials() {
- return encryptionCredentials;
- }
-
- /**
- * Set the list of all configured encryption credentials.
- *
- * @param credentials the list of encryption credentials, may be null
- */
- @Autowired
- @Qualifier("encryption")
- public void setEncryptionCredentials(
- @Nullable @NonnullElements final List<CredentialHolder> credentials) {
- checkSetterPreconditions();
-
- if (credentials != null) {
- encryptionCredentials = credentials.stream()
- .flatMap(h -> h.getCredentials().stream())
- .collect(CollectionSupport.nonnullCollector(Collectors.toUnmodifiableList())).
- get();
- } else {
- encryptionCredentials = CollectionSupport.emptyList();
- }
- }
-}
\ No newline at end of file
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DelegatingCriteriaRelyingPartyConfigurationResolver.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DelegatingCriteriaRelyingPartyConfigurationResolver.java
deleted file mode 100644
index bcf1a8506..000000000
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DelegatingCriteriaRelyingPartyConfigurationResolver.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.relyingparty.impl;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.core.criterion.EntityIdCriterion;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.profile.criterion.ProfileRequestContextCriterion;
-import org.opensaml.saml.common.messaging.context.SAMLMetadataContext;
-import org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext;
-import org.opensaml.saml.criterion.RoleDescriptorCriterion;
-import org.opensaml.saml.saml2.metadata.EntityDescriptor;
-import org.opensaml.saml.saml2.metadata.RoleDescriptor;
-import org.opensaml.security.config.SecurityConfiguration;
-import org.slf4j.Logger;
-
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.CriteriaRelyingPartyConfigurationResolver;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
-import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.collection.CollectionSupport;
-import net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent;
-import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.IdentifiableComponent;
-import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.shared.resolver.CriteriaSet;
-import net.shibboleth.shared.resolver.ResolverException;
-
-/**
- * An implementation of {@link CriteriaRelyingPartyConfigurationResolver} which delegates to an instance of
- * {@link RelyingPartyConfigurationResolver}.
- *
- * <p>
- * One of the following input criteria is required for resolution based on relying party entityID:
- * </p>
- * <ul>
- * <li>{@link ProfileRequestContextCriterion}</li>
- * <li>{@link EntityIdCriterion}</li>
- * <li>{@link RoleDescriptorCriterion}</li>
- * </ul>
- */
-public class DelegatingCriteriaRelyingPartyConfigurationResolver extends AbstractIdentifiedInitializableComponent
- implements CriteriaRelyingPartyConfigurationResolver, IdentifiableComponent {
-
- /** Logger. */
- @Nonnull private Logger log = LoggerFactory.getLogger(DelegatingCriteriaRelyingPartyConfigurationResolver.class);
-
- /** The RelyingPartyConfigurationResolver to which to delegate. */
- @NonnullAfterInit private RelyingPartyConfigurationResolver delegate;
-
- /** Constructor. */
- public DelegatingCriteriaRelyingPartyConfigurationResolver() {
- super();
- }
-
- /**
- * Set the {@link RelyingPartyConfigurationResolver} instance to which to delegate.
- *
- * @param resolver the resolver delegate instance
- */
- public void setDelegate(@Nullable final RelyingPartyConfigurationResolver resolver) {
- checkSetterPreconditions();
- delegate = resolver;
- }
-
- /** {@inheritDoc} */
- @Override public void setId(@Nonnull final String componentId) {
- super.setId(componentId);
- }
-
- /** {@inheritDoc} */
- protected void doInitialize() throws ComponentInitializationException {
- super.doInitialize();
- if (delegate == null) {
- throw new ComponentInitializationException("RelyingPartyConfigurationResolver delegate was null");
- }
- }
-
- /** {@inheritDoc} */
- protected void doDestroy() {
- delegate = null;
- super.doDestroy();
- }
-
- /** {@inheritDoc} */
- @Override
- @Nullable public SecurityConfiguration getDefaultSecurityConfiguration(@Nonnull @NotEmpty final String profileId) {
- checkComponentActive();
- return delegate.getDefaultSecurityConfiguration(profileId);
- }
-
- /** {@inheritDoc} */
- @Override
- @Nullable public RelyingPartyConfiguration resolveSingle(@Nullable final CriteriaSet criteria)
- throws ResolverException {
- checkComponentActive();
- final Iterator<RelyingPartyConfiguration> results = resolve(criteria).iterator();
- if (results.hasNext()) {
- return results.next();
- }
- return null;
- }
-
- /** {@inheritDoc} */
- @Override
- @Nonnull @NonnullElements public Iterable<RelyingPartyConfiguration> resolve(@Nullable final CriteriaSet criteria)
- throws ResolverException {
- checkComponentActive();
- final ProfileRequestContext prc = buildContext(criteria);
- if (prc != null) {
- return delegate.resolve(prc);
- }
- return CollectionSupport.emptyList();
-
- }
-
- /**
- * Build and populate the synthetic instance of {@link ProfileRequestContext} which will be passed
- * in the resolution call to the delegate.
- *
- * @param criteria the input criteria
- * @return the synthetic context instance, or null if required data is not supplied
- */
- @Nullable private ProfileRequestContext buildContext(@Nullable final CriteriaSet criteria) {
- if (criteria == null) {
- return null;
- }
-
- final ProfileRequestContextCriterion prcc = criteria.get(ProfileRequestContextCriterion.class);
- if (prcc != null) {
- return prcc.getProfileRequestContext();
- }
-
- final String entityID = resolveEntityID(criteria);
- log.debug("Resolved effective entityID from criteria: {}", entityID);
-
- final EntityDescriptor entityDescriptor = resolveEntityDescriptor(criteria);
- log.debug("Resolved effective entity descriptor from criteria: {}", entityDescriptor);
-
- final RoleDescriptor roleDescriptor = resolveRoleDescriptor(criteria);
- log.debug("Resolved effective role descriptor from criteria: {}", roleDescriptor);
-
- if (entityID != null || entityDescriptor != null || roleDescriptor != null) {
- final ProfileRequestContext prc = new ProfileRequestContext();
- final RelyingPartyContext rpc = prc.getOrCreateSubcontext(RelyingPartyContext.class);
- rpc.setVerified(true);
-
- rpc.setRelyingPartyId(entityID);
-
- if (entityDescriptor != null || roleDescriptor != null) {
- final SAMLPeerEntityContext peerContext = prc.getOrCreateSubcontext(SAMLPeerEntityContext.class);
- rpc.setRelyingPartyIdContextTree(peerContext);
-
- peerContext.setEntityId(entityID);
-
- if (roleDescriptor != null) {
- peerContext.setRole(roleDescriptor.getSchemaType() != null
- ? roleDescriptor.getSchemaType() : roleDescriptor.getElementQName());
- }
-
- final SAMLMetadataContext metadataContext = peerContext.getOrCreateSubcontext(SAMLMetadataContext.class);
- metadataContext.setEntityDescriptor(entityDescriptor);
- metadataContext.setRoleDescriptor(roleDescriptor);
- }
- return prc;
- }
- return null;
- }
-
- /**
- * Resolve the entityID from the criteria.
- *
- * @param criteria the input criteria
- * @return the input entityID criterion or null if could not be resolved
- */
- private String resolveEntityID(@Nonnull final CriteriaSet criteria) {
- final EntityIdCriterion eic = criteria.get(EntityIdCriterion.class);
- if (eic != null) {
- return eic.getEntityId();
- }
-
- final EntityDescriptor ed = resolveEntityDescriptor(criteria);
- if (ed != null) {
- return ed.getEntityID();
- }
-
- return null;
- }
-
- /**
- * Resolve the EntityDescriptor from the criteria.
- *
- * @param criteria the input criteria
- * @return the input entity descriptor criterion, or null if could not be resolved
- */
- private EntityDescriptor resolveEntityDescriptor(@Nonnull final CriteriaSet criteria) {
- final RoleDescriptor rd = resolveRoleDescriptor(criteria);
- if (rd != null && rd.getParent() != null && rd.getParent() instanceof EntityDescriptor) {
- return (EntityDescriptor)rd.getParent();
- }
-
- return null;
- }
-
- /**
- * Resolve the RoleDescriptor from the criteria.
- *
- * @param criteria the input criteria
- * @return the input role descriptor criterion or null if could not be resolved
- */
- private RoleDescriptor resolveRoleDescriptor(@Nonnull final CriteriaSet criteria) {
- final RoleDescriptorCriterion rdc = criteria.get(RoleDescriptorCriterion.class);
- if (rdc != null) {
- return rdc.getRole();
- }
-
- return null;
- }
-
-}
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/EncryptionCredentialsResolver.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/EncryptionCredentialsResolver.java
index ac082f51b..ac2d11e60 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/EncryptionCredentialsResolver.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/EncryptionCredentialsResolver.java
@@ -24,7 +24,7 @@ import org.opensaml.security.credential.Credential;
import org.opensaml.security.credential.CredentialResolver;
import org.slf4j.Logger;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.IdentifiableComponent;
@@ -86,12 +86,8 @@ public class EncryptionCredentialsResolver implements CredentialResolver, Identi
throws ResolverException {
try(final ServiceableComponent<RelyingPartyConfigurationResolver> component = service.getServiceableComponent()) {
final RelyingPartyConfigurationResolver resolver = component.getComponent();
- if (resolver instanceof DefaultRelyingPartyConfigurationResolver) {
- log.trace("Saw expected instance of DefaultRelyingPartyConfigurationResolver");
- return ((DefaultRelyingPartyConfigurationResolver)resolver).getEncryptionCredentials();
- }
- log.trace("Did NOT see expected instance of DefaultRelyingPartyConfigurationResolver");
- return CollectionSupport.emptyList();
+ log.trace("Saw expected instance of DefaultRelyingPartyConfigurationResolver");
+ return resolver.getEncryptionCredentials();
} catch (final ServiceException e) {
log.error("EncryptionCredentialsResolver '{}': Invalid RelyingPartyResolver configuration", getId(), e);
}
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/ReloadingRelyingPartyConfigurationResolver.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/ReloadingRelyingPartyConfigurationResolver.java
deleted file mode 100644
index f787e0497..000000000
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/ReloadingRelyingPartyConfigurationResolver.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.relyingparty.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.security.config.SecurityConfiguration;
-import org.slf4j.Logger; import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
-import net.shibboleth.shared.annotation.ParameterName;
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
-import net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.shared.resolver.ResolverException;
-import net.shibboleth.shared.service.ReloadableService;
-import net.shibboleth.shared.service.ServiceException;
-import net.shibboleth.shared.service.ServiceableComponent;
-
-/**
- * Retrieves a per-relying party configuration for a given profile request based on the request context. The
- * configuration is loaded via the supplied service.
- *
- * <p>
- * Note that this resolver requires that none of the returned structures do any operations on receipt of
- * {@link #destroy()} since the returned value is not covered by the
- * </p>
- */
-public class ReloadingRelyingPartyConfigurationResolver extends AbstractIdentifiableInitializableComponent implements
- RelyingPartyConfigurationResolver {
-
- /** Class logger. */
- @Nonnull private final Logger log = LoggerFactory.getLogger(ReloadingRelyingPartyConfigurationResolver.class);
-
- /** The service which managed the reloading. */
- private final ReloadableService<RelyingPartyConfigurationResolver> service;
-
- /**
- * Constructor.
- *
- * @param resolverService the service which will manage the loading.
- */
- public ReloadingRelyingPartyConfigurationResolver(@Nonnull @ParameterName(name="resolverService")
- final ReloadableService<RelyingPartyConfigurationResolver> resolverService) {
- service = Constraint.isNotNull(resolverService, "RelyingParty Service cannot be null");
- }
-
- /** {@inheritDoc} */
- @Override @Nonnull @NonnullElements public Iterable<RelyingPartyConfiguration> resolve(
- @Nullable final ProfileRequestContext context) throws ResolverException {
- checkComponentActive();
- try (final ServiceableComponent<RelyingPartyConfigurationResolver> component = service.getServiceableComponent()) {
- final RelyingPartyConfigurationResolver resolver = component.getComponent();
- final List<RelyingPartyConfiguration> results = new ArrayList<>();
- for (final RelyingPartyConfiguration result : resolver.resolve(context)) {
- results.add(result);
- }
- return results;
- } catch (final ResolverException e) {
- log.error("RelyingPartyResolver '{}': error in resolution", getId(), e);
- } catch (final ServiceException e) {
- log.error("RelyingPartyResolver '{}': Invalid RelyingPartyResolver configuration", getId(), e);
- }
- return Collections.emptySet();
- }
-
- /** {@inheritDoc} */
- @Override @Nullable public RelyingPartyConfiguration resolveSingle(@Nullable final ProfileRequestContext context)
- throws ResolverException {
- checkComponentActive();
- try (final ServiceableComponent<RelyingPartyConfigurationResolver> component = service.getServiceableComponent()){
- return component.getComponent().resolveSingle(context);
- } catch (final ResolverException e) {
- log.error("RelyingPartyResolver '{}': error in resolution", getId(), e);
- } catch (final ServiceException e) {
- log.error("RelyingPartyResolver '{}': Invalid RelyingPartyResolver configuration", getId(), e);
- }
- return null;
- }
-
- /** {@inheritDoc} */
- @Override public SecurityConfiguration getDefaultSecurityConfiguration(final String profileId) {
- checkComponentActive();
- try (final ServiceableComponent<RelyingPartyConfigurationResolver> component = service.getServiceableComponent()){
- return component.getComponent().getDefaultSecurityConfiguration(profileId);
- } catch (final ServiceException e) {
- log.error("RelyingPartyResolver '{}': Invalid RelyingPartyResolver configuration", getId(), e);
- }
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/SigningCredentialsResolver.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/SigningCredentialsResolver.java
index 75bf987fc..9ce05876b 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/SigningCredentialsResolver.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/SigningCredentialsResolver.java
@@ -24,7 +24,7 @@ import org.opensaml.security.credential.Credential;
import org.opensaml.security.credential.CredentialResolver;
import org.slf4j.Logger;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.IdentifiableComponent;
@@ -87,12 +87,7 @@ public class SigningCredentialsResolver implements CredentialResolver, Identifia
try (final ServiceableComponent<RelyingPartyConfigurationResolver> component = service.getServiceableComponent()) {
final RelyingPartyConfigurationResolver resolver = component.getComponent();
- if (resolver instanceof DefaultRelyingPartyConfigurationResolver) {
- log.trace("Saw expected instance of DefaultRelyingPartyConfigurationResolver");
- return ((DefaultRelyingPartyConfigurationResolver)resolver).getSigningCredentials();
- }
- log.trace("Did NOT see expected instance of DefaultRelyingPartyConfigurationResolver");
- return CollectionSupport.emptyList();
+ return resolver.getSigningCredentials();
} catch (final ServiceException e) {
log.error("SigningCredentialsResolver '{}': Invalid RelyingPartyResolver configuration", getId(), e);
}
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectProfileConfigurationTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectProfileConfigurationTest.java
index a1407bcab..ff593bfab 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectProfileConfigurationTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectProfileConfigurationTest.java
@@ -24,7 +24,7 @@ import net.shibboleth.idp.profile.IdPEventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.MockProfileConfiguration;
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfigurationTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfigurationTest.java
index d7ee1a21f..258595e01 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfigurationTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/SelectRelyingPartyConfigurationTest.java
@@ -17,23 +17,29 @@
package net.shibboleth.idp.profile.impl;
+import java.time.Instant;
+import java.util.Collection;
import java.util.Collections;
import javax.annotation.Nullable;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
import net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.resolver.CriteriaSet;
import net.shibboleth.shared.resolver.ResolverException;
+import net.shibboleth.shared.service.ReloadableService;
+import net.shibboleth.shared.service.ServiceableComponent;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.security.config.SecurityConfiguration;
+import org.opensaml.security.credential.Credential;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import org.testng.Assert;
@@ -42,6 +48,11 @@ import org.testng.annotations.Test;
/** {@link SelectRelyingPartyConfiguration} unit test. */
public class SelectRelyingPartyConfigurationTest {
+ /**
+ * Test action with no resolver.
+ *
+ * @throws ComponentInitializationException
+ */
@Test(expectedExceptions = ComponentInitializationException.class) public void testNoResolver()
throws ComponentInitializationException {
final SelectRelyingPartyConfiguration action = new SelectRelyingPartyConfiguration();
@@ -58,10 +69,8 @@ public class SelectRelyingPartyConfigurationTest {
final ProfileRequestContext prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
prc.removeSubcontext(RelyingPartyContext.class);
- final RelyingPartyConfigurationResolver resolver = new MockResolver(null, null);
-
final SelectRelyingPartyConfiguration action = new SelectRelyingPartyConfiguration();
- action.setRelyingPartyConfigurationResolver(resolver);
+ action.setRelyingPartyConfigurationResolver(new MockResolver(null, null));
action.initialize();
final Event event = action.execute(src);
@@ -79,10 +88,8 @@ public class SelectRelyingPartyConfigurationTest {
final ProfileRequestContext prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
prc.getSubcontext(RelyingPartyContext.class).setConfiguration(null);
- final RelyingPartyConfigurationResolver resolver = new MockResolver(null, null);
-
final SelectRelyingPartyConfiguration action = new SelectRelyingPartyConfiguration();
- action.setRelyingPartyConfigurationResolver(resolver);
+ action.setRelyingPartyConfigurationResolver(new MockResolver(null, null));
action.initialize();
final Event event = action.execute(src);
@@ -100,16 +107,14 @@ public class SelectRelyingPartyConfigurationTest {
final ProfileRequestContext prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
prc.getSubcontext(RelyingPartyContext.class).setConfiguration(null);
- final RelyingPartyConfiguration config = new RelyingPartyConfiguration();
+ final var config = new net.shibboleth.idp.relyingparty.RelyingPartyConfiguration();
config.setId("foo");
config.setResponderId("http://idp.example.org");
config.setDetailedErrors(true);
config.initialize();
- final RelyingPartyConfigurationResolver resolver = new MockResolver(config, new ResolverException());
-
final SelectRelyingPartyConfiguration action = new SelectRelyingPartyConfiguration();
- action.setRelyingPartyConfigurationResolver(resolver);
+ action.setRelyingPartyConfigurationResolver(new MockResolver(config, new ResolverException()));
action.initialize();
final Event event = action.execute(src);
@@ -127,16 +132,14 @@ public class SelectRelyingPartyConfigurationTest {
final ProfileRequestContext prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
prc.getSubcontext(RelyingPartyContext.class).setConfiguration(null);
- final RelyingPartyConfiguration config = new RelyingPartyConfiguration();
+ final var config = new net.shibboleth.idp.relyingparty.RelyingPartyConfiguration();
config.setId("foo");
config.setResponderId("http://idp.example.org");
config.setDetailedErrors(true);
config.initialize();
- final RelyingPartyConfigurationResolver resolver = new MockResolver(config, null);
-
final SelectRelyingPartyConfiguration action = new SelectRelyingPartyConfiguration();
- action.setRelyingPartyConfigurationResolver(resolver);
+ action.setRelyingPartyConfigurationResolver(new MockResolver(config, null));
action.initialize();
final Event event = action.execute(src);
@@ -144,37 +147,43 @@ public class SelectRelyingPartyConfigurationTest {
ActionTestingSupport.assertProceedEvent(event);
final RelyingPartyConfiguration resolvedConfig =
- prc.getSubcontext(RelyingPartyContext.class).getConfiguration();
+ (RelyingPartyConfiguration) prc.getSubcontext(RelyingPartyContext.class).getConfiguration();
Assert.assertEquals(resolvedConfig.getId(), config.getId());
- Assert.assertEquals(resolvedConfig.getResponderId(prc), config.getResponderId(prc));
+ Assert.assertEquals(((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) resolvedConfig).getResponderId(prc),
+ config.getResponderId(prc));
Assert.assertEquals(resolvedConfig.getProfileConfigurations(prc), config.getProfileConfigurations(prc));
}
- /** A resolver that returns a relying party configuration or throws an exception. */
- private class MockResolver extends AbstractIdentifiedInitializableComponent implements
- RelyingPartyConfigurationResolver {
+ /**
+ * A resolver that returns a relying party configuration or throws an exception. */
+ private class MockResolver extends AbstractIdentifiedInitializableComponent
+ implements ReloadableService<RelyingPartyConfigurationResolver>,
+ ServiceableComponent<RelyingPartyConfigurationResolver>, RelyingPartyConfigurationResolver {
/** The relying party configuration to be returned. */
private RelyingPartyConfiguration configuration;
- /** Exception thrown by {@link #resolve(ProfileRequestContext)} and {@link #resolveSingle(ProfileRequestContext)} */
+ /** Exception thrown by resolution attempts. */
private ResolverException exception;
/**
* Constructor.
*
* @param relyingPartyConfiguration the relying party configuration to be returned
- * @param resolverException exception thrown by {@link #resolve(ProfileRequestContext)} and
- * {@link #resolveSingle(ProfileRequestContext)}
+ * @param resolverException exception thrown on failed resolution
+ *
+ * @throws ComponentInitializationException
*/
public MockResolver(@Nullable final RelyingPartyConfiguration relyingPartyConfiguration,
- @Nullable final ResolverException resolverException) {
+ @Nullable final ResolverException resolverException) throws ComponentInitializationException {
configuration = relyingPartyConfiguration;
exception = resolverException;
+ setId("mock");
+ initialize();
}
/** {@inheritDoc} */
- @Override public Iterable<RelyingPartyConfiguration> resolve(final ProfileRequestContext context)
+ @Override public Iterable<RelyingPartyConfiguration> resolve(final CriteriaSet criteria)
throws ResolverException {
if (exception != null) {
throw exception;
@@ -183,7 +192,7 @@ public class SelectRelyingPartyConfigurationTest {
}
/** {@inheritDoc} */
- @Override public RelyingPartyConfiguration resolveSingle(final ProfileRequestContext context)
+ @Override public RelyingPartyConfiguration resolveSingle(final CriteriaSet criteria)
throws ResolverException {
if (exception != null) {
throw exception;
@@ -195,6 +204,59 @@ public class SelectRelyingPartyConfigurationTest {
@Override public SecurityConfiguration getDefaultSecurityConfiguration(String profileId) {
return null;
}
+
+ /** {@inheritDoc} */
+ @Override
+ public Collection<Credential> getSigningCredentials() {
+ return Collections.emptyList();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Collection<Credential> getEncryptionCredentials() {
+ return Collections.emptyList();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Instant getLastSuccessfulReloadInstant() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Instant getLastReloadAttemptInstant() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Throwable getReloadFailureCause() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void reload() {
+
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ServiceableComponent<RelyingPartyConfigurationResolver> getServiceableComponent() {
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public RelyingPartyConfigurationResolver getComponent() {
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void close() {
+ }
}
-}
+}
\ No newline at end of file
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/FilterFlowsByNonBrowserSupportTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/FilterFlowsByNonBrowserSupportTest.java
index 30ec498f6..cd22e1d88 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/FilterFlowsByNonBrowserSupportTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/FilterFlowsByNonBrowserSupportTest.java
@@ -26,6 +26,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link FilterFlowsByNonBrowserSupport} unit test. */
+ at SuppressWarnings("javadoc")
public class FilterFlowsByNonBrowserSupportTest extends PopulateProfileInterceptorContextTest {
private FilterFlowsByNonBrowserSupport action;
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContextTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContextTest.java
index b9e65d95c..e3388451d 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContextTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/PopulateProfileInterceptorContextTest.java
@@ -46,6 +46,11 @@ public class PopulateProfileInterceptorContextTest {
protected ProfileRequestContext prc;
+ /**
+ * Test setup.
+ *
+ * @throws Exception
+ */
@BeforeMethod public void setUp() throws Exception {
src = new RequestContextBuilder().buildRequestContext();
prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/ProfileInterceptorFlowDescriptorTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/ProfileInterceptorFlowDescriptorTest.java
index c15162205..61474f633 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/ProfileInterceptorFlowDescriptorTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/ProfileInterceptorFlowDescriptorTest.java
@@ -31,6 +31,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicates;
/** {@link ProfileInterceptorFlowDescriptor} unit test. */
+ at SuppressWarnings("javadoc")
public class ProfileInterceptorFlowDescriptorTest {
private ProfileInterceptorFlowDescriptor descriptor;
@@ -55,22 +56,19 @@ public class ProfileInterceptorFlowDescriptorTest {
}
@Test(expectedExceptions = UnmodifiableComponentException.class)
- public void testUnmodifiableActivationCondition()
- throws Exception {
+ public void testUnmodifiableActivationCondition() throws Exception {
descriptor.initialize();
descriptor.setActivationCondition(Predicates.<ProfileRequestContext> alwaysFalse());
}
@Test(expectedExceptions = UnmodifiableComponentException.class)
- public void testUnmodifiableStorageService()
- throws Exception {
+ public void testUnmodifiableStorageService() throws Exception {
descriptor.initialize();
descriptor.setStorageService(null);
}
@Test(expectedExceptions = UnmodifiableComponentException.class)
- public void testUnmodifiableNonBrowserSupport()
- throws Exception {
+ public void testUnmodifiableNonBrowserSupport() throws Exception {
descriptor.initialize();
descriptor.setNonBrowserSupported(true);
}
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/SelectProfileInterceptorFlowTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/SelectProfileInterceptorFlowTest.java
index 614a5dad7..919b4a114 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/SelectProfileInterceptorFlowTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/SelectProfileInterceptorFlowTest.java
@@ -19,7 +19,6 @@ package net.shibboleth.idp.profile.interceptor.impl;
import net.shibboleth.idp.profile.context.ProfileInterceptorContext;
import net.shibboleth.idp.profile.interceptor.ProfileInterceptorFlowDescriptor;
-import net.shibboleth.idp.profile.interceptor.impl.SelectProfileInterceptorFlow;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -31,6 +30,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicates;
/** {@link SelectProfileInterceptorFlow} unit test. */
+ at SuppressWarnings("javadoc")
public class SelectProfileInterceptorFlowTest extends PopulateProfileInterceptorContextTest {
private SelectProfileInterceptorFlow action;
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/WriteProfileInterceptorResultToStorageTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/WriteProfileInterceptorResultToStorageTest.java
index 052c23951..85a0f4cda 100644
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/WriteProfileInterceptorResultToStorageTest.java
+++ b/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/interceptor/impl/WriteProfileInterceptorResultToStorageTest.java
@@ -40,6 +40,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link WriteProfileInterceptorResultToStorage} unit test. */
+ at SuppressWarnings("javadoc")
public class WriteProfileInterceptorResultToStorageTest {
private RequestContext src;
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolverTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolverTest.java
deleted file mode 100644
index 394cbc360..000000000
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolverTest.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.relyingparty.impl;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.testing.MockApplicationContext;
-
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicates;
-
-/** Unit test for {@link DefaultRelyingPartyConfigurationResolver}. */
-public class DefaultRelyingPartyConfigurationResolverTest {
-
- @Test public void testConstruction() throws ComponentInitializationException {
- final RelyingPartyConfiguration one = new RelyingPartyConfiguration();
- one.setId("one");
- one.setResponderId("foo");
- one.setDetailedErrors(true);
- one.initialize();
-
- final RelyingPartyConfiguration two = new RelyingPartyConfiguration();
- two.setId("two");
- two.setResponderId("foo");
- two.setDetailedErrors(true);
- two.setActivationCondition(Predicates.<ProfileRequestContext>alwaysFalse());
- two.initialize();
-
- final RelyingPartyConfiguration three = new RelyingPartyConfiguration();
- three.setId("three");
- three.setResponderId("foo");
- three.setDetailedErrors(true);
- three.initialize();
-
- final List<RelyingPartyConfiguration> rpConfigs = Arrays.asList(one, two, three);
-
- DefaultRelyingPartyConfigurationResolver resolver = new DefaultRelyingPartyConfigurationResolver();
- resolver.setId("test");
- resolver.setRelyingPartyConfigurations(rpConfigs);
- Assert.assertEquals(resolver.getId(), "test");
- Assert.assertEquals(resolver.getRelyingPartyConfigurations().size(), 3);
-
- resolver = new DefaultRelyingPartyConfigurationResolver();
- resolver.setId("test");
- Assert.assertEquals(resolver.getId(), "test");
- Assert.assertEquals(resolver.getRelyingPartyConfigurations().size(), 0);
-
- resolver = new DefaultRelyingPartyConfigurationResolver();
- resolver.setId("test");
- Assert.assertEquals(resolver.getId(), "test");
- Assert.assertEquals(resolver.getRelyingPartyConfigurations().size(), 0);
- }
-
- @Test public void testDefault() throws Exception {
- final ProfileRequestContext requestContext = new ProfileRequestContext();
- requestContext.getSubcontext(RelyingPartyContext.class, true).setVerified(true);
-
- final RelyingPartyConfiguration anonRP = new RelyingPartyConfiguration();
- anonRP.setId("anonRPId");
- anonRP.setResponderId("anonRPResp");
- anonRP.setDetailedErrors(true);
- anonRP.initialize();
-
- final RelyingPartyConfiguration defaultRP = new RelyingPartyConfiguration();
- defaultRP.setId("defaultRPId");
- defaultRP.setResponderId("defaultRPResp");
- defaultRP.setDetailedErrors(true);
- defaultRP.initialize();
-
- final DefaultRelyingPartyConfigurationResolver resolver = new DefaultRelyingPartyConfigurationResolver();
- resolver.setId("test");
- resolver.setUnverifiedConfiguration(anonRP);
- resolver.setDefaultConfiguration(defaultRP);
- resolver.initialize();
-
- final Iterable<RelyingPartyConfiguration> results = resolver.resolve(requestContext);
- Assert.assertNotNull(results);
-
- final Iterator<RelyingPartyConfiguration> resultItr = results.iterator();
- Assert.assertTrue(resultItr.hasNext());
- Assert.assertSame(resultItr.next(), defaultRP);
- Assert.assertFalse(resultItr.hasNext());
-
- Assert.assertSame(resolver.resolveSingle(requestContext), defaultRP);
- }
-
- @Test public void testAnon() throws Exception {
- final ProfileRequestContext requestContext = new ProfileRequestContext();
- requestContext.getSubcontext(RelyingPartyContext.class, true).setVerified(false);
-
- final RelyingPartyConfiguration anonRP = new RelyingPartyConfiguration();
- anonRP.setId("anonRPId");
- anonRP.setResponderId("anonRPResp");
- anonRP.setDetailedErrors(true);
- anonRP.setActivationCondition(Predicates.<ProfileRequestContext>alwaysTrue());
- anonRP.initialize();
-
- final RelyingPartyConfiguration defaultRP = new RelyingPartyConfiguration();
- defaultRP.setId("defaultRPId");
- defaultRP.setResponderId("defaultRPResp");
- defaultRP.setDetailedErrors(true);
- defaultRP.initialize();
-
- final DefaultRelyingPartyConfigurationResolver resolver = new DefaultRelyingPartyConfigurationResolver();
- resolver.setId("test");
- resolver.setUnverifiedConfiguration(anonRP);
- resolver.setDefaultConfiguration(defaultRP);
- resolver.initialize();
-
- final Iterable<RelyingPartyConfiguration> results = resolver.resolve(requestContext);
- Assert.assertNotNull(results);
-
- final Iterator<RelyingPartyConfiguration> resultItr = results.iterator();
- Assert.assertTrue(resultItr.hasNext());
- Assert.assertSame(resultItr.next(), anonRP);
- Assert.assertFalse(resultItr.hasNext());
-
- Assert.assertSame(resolver.resolveSingle(requestContext), anonRP);
- }
-
- @Test public void testResolve() throws Exception {
- final ProfileRequestContext requestContext = new ProfileRequestContext();
- requestContext.getSubcontext(RelyingPartyContext.class, true).setVerified(true);
-
- final RelyingPartyConfiguration anonRP = new RelyingPartyConfiguration();
- anonRP.setId("anonRPId");
- anonRP.setResponderId("anonRPResp");
- anonRP.setDetailedErrors(true);
- anonRP.initialize();
-
- final RelyingPartyConfiguration defaultRP = new RelyingPartyConfiguration();
- defaultRP.setId("defaultRPId");
- defaultRP.setResponderId("defaultRPResp");
- defaultRP.setDetailedErrors(true);
- defaultRP.initialize();
-
- final RelyingPartyConfiguration one = new RelyingPartyConfiguration();
- one.setId("one");
- one.setResponderId("foo");
- one.setDetailedErrors(true);
- one.initialize();
-
- final RelyingPartyConfiguration two = new RelyingPartyConfiguration();
- two.setId("two");
- two.setResponderId("foo");
- two.setDetailedErrors(true);
- two.setActivationCondition(Predicates.<ProfileRequestContext>alwaysFalse());
- two.initialize();
-
- final RelyingPartyConfiguration three = new RelyingPartyConfiguration();
- three.setId("three");
- three.setResponderId("foo");
- three.setDetailedErrors(true);
- three.initialize();
-
- final List<RelyingPartyConfiguration> rpConfigs = Arrays.asList(one, two, three);
-
- final DefaultRelyingPartyConfigurationResolver resolver = new DefaultRelyingPartyConfigurationResolver();
- resolver.setId("test");
- resolver.setRelyingPartyConfigurations(rpConfigs);
- resolver.setUnverifiedConfiguration(anonRP);
- resolver.setDefaultConfiguration(defaultRP);
- resolver.initialize();
-
- Iterable<RelyingPartyConfiguration> results = resolver.resolve(requestContext);
- Assert.assertNotNull(results);
-
- Iterator<RelyingPartyConfiguration> resultItr = results.iterator();
- Assert.assertTrue(resultItr.hasNext());
- Assert.assertSame(resultItr.next(), one);
- Assert.assertTrue(resultItr.hasNext());
- Assert.assertSame(resultItr.next(), three);
- Assert.assertFalse(resultItr.hasNext());
-
- RelyingPartyConfiguration result = resolver.resolveSingle(requestContext);
- Assert.assertSame(result, one);
-
- results = resolver.resolve(null);
- Assert.assertNotNull(results);
-
- resultItr = results.iterator();
- Assert.assertFalse(resultItr.hasNext());
-
- result = resolver.resolveSingle(null);
- Assert.assertNull(result);
- }
-}
\ No newline at end of file
diff --git a/idp-profile-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/RelyingPartyConfigurationTest.java b/idp-profile-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/RelyingPartyConfigurationTest.java
deleted file mode 100644
index a2754516b..000000000
--- a/idp-profile-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/RelyingPartyConfigurationTest.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.relyingparty.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.testing.MockProfileConfiguration;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.logic.ConstraintViolationException;
-import net.shibboleth.shared.logic.FunctionSupport;
-import net.shibboleth.shared.logic.PredicateSupport;
-
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/** Unit test for {@link RelyingPartyConfiguration}. */
-public class RelyingPartyConfigurationTest {
-
- @Test public void testConstruction() throws ComponentInitializationException {
- RelyingPartyConfiguration config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderId("http://idp.example.org");
- config.setDetailedErrorsPredicate(PredicateSupport.alwaysTrue());
- config.initialize();
- Assert.assertEquals(config.getId(), "foo");
- Assert.assertEquals(config.getResponderId(null), "http://idp.example.org");
- Assert.assertTrue(config.isDetailedErrors(null));
- Assert.assertTrue(config.getProfileConfigurations(null).isEmpty());
-
- config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderId("http://idp.example.org");
- config.setDetailedErrorsPredicate(PredicateSupport.alwaysFalse());
- config.initialize();
- Assert.assertEquals(config.getId(), "foo");
- Assert.assertEquals(config.getResponderId(null), "http://idp.example.org");
- Assert.assertFalse(config.isDetailedErrors(null));
- Assert.assertTrue(config.getProfileConfigurations(null).isEmpty());
-
- ArrayList<ProfileConfiguration> profileConfigs = new ArrayList<>();
- profileConfigs.add(new MockProfileConfiguration("foo"));
- profileConfigs.add(new MockProfileConfiguration("bar"));
-
- config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderId("http://idp.example.org");
- config.setProfileConfigurations(profileConfigs);
- config.initialize();
- Assert.assertEquals(config.getId(), "foo");
- Assert.assertEquals(config.getResponderId(null), "http://idp.example.org");
- Assert.assertEquals(config.getProfileConfigurations(null).size(), 2);
-
- try {
- config = new RelyingPartyConfiguration();
- config.initialize();
- Assert.fail();
- } catch (final ComponentInitializationException e) {
- // expected this
- }
-
- try {
- config = new RelyingPartyConfiguration();
- config.setId("");
- config.initialize();
- Assert.fail();
- } catch (final ConstraintViolationException e) {
- // expected this
- }
- }
-
- @Test public void testProfileConfiguration() throws ComponentInitializationException {
- final ArrayList<ProfileConfiguration> profileConfigs = new ArrayList<>();
- profileConfigs.add(new MockProfileConfiguration("foo"));
- profileConfigs.add(new MockProfileConfiguration("bar"));
-
- final RelyingPartyConfiguration config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderId("http://idp.example.org");
- config.setProfileConfigurations(profileConfigs);
- config.initialize();
-
- Assert.assertNotNull(config.getProfileConfiguration(null, "foo"));
- Assert.assertNotNull(config.getProfileConfiguration(null, "bar"));
- Assert.assertNull(config.getProfileConfiguration(null, "baz"));
- }
-
- @Test public void testIndirectProfileConfiguration() throws ComponentInitializationException {
- final Map<String,ProfileConfiguration> profileConfigs = new HashMap<>();
- profileConfigs.put("foo", new MockProfileConfiguration("foo"));
- profileConfigs.put("bar", new MockProfileConfiguration("bar"));
-
- RelyingPartyConfiguration config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderId("http://idp.example.org");
- config.setProfileConfigurationsLookupStrategy(FunctionSupport.constant(profileConfigs));
- config.initialize();
-
- Assert.assertNotNull(config.getProfileConfiguration(null, "foo"));
- Assert.assertNotNull(config.getProfileConfiguration(null, "bar"));
- Assert.assertNull(config.getProfileConfiguration(null, "baz"));
-
- config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderId("http://idp.example.org");
- config.setProfileConfigurations(profileConfigs.values());
- config.setProfileConfigurationsLookupStrategy(FunctionSupport.constant(null));
- config.initialize();
-
- Assert.assertNull(config.getProfileConfiguration(null, "foo"));
- Assert.assertNull(config.getProfileConfiguration(null, "bar"));
- Assert.assertNull(config.getProfileConfiguration(null, "baz"));
- }
-
- @Test public void testIndirectResponderId() throws ComponentInitializationException {
- RelyingPartyConfiguration config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderIdLookupStrategy(FunctionSupport.constant("http://idp.example.org"));
- config.initialize();
- Assert.assertEquals(config.getResponderId(null), "http://idp.example.org");
-
- config = new RelyingPartyConfiguration();
- config.setId("foo");
- config.setResponderId("http://idp.example.org");
- config.setResponderIdLookupStrategy(FunctionSupport.constant(null));
- config.initialize();
-
- try {
- config.getResponderId(null);
- Assert.fail("Expected a constraint violation");
- } catch (final ConstraintViolationException e) {
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/DetailedErrorsProfileConfigPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/DetailedErrorsProfileConfigPredicate.java
index e117ea430..e8709ad96 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/DetailedErrorsProfileConfigPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/DetailedErrorsProfileConfigPredicate.java
@@ -19,9 +19,9 @@ package net.shibboleth.idp.saml.profile.config.logic;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -40,8 +40,8 @@ public class DetailedErrorsProfileConfigPredicate extends AbstractRelyingPartyPr
final RelyingPartyContext rpc = getRelyingPartyContextLookupStrategy().apply(input);
if (rpc != null) {
final RelyingPartyConfiguration rpConfig = rpc.getConfiguration();
- if (rpConfig != null) {
- return rpConfig.isDetailedErrors(input);
+ if (rpConfig instanceof net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) {
+ return ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpConfig).isDetailedErrors(input);
}
}
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/IncludeAttributeStatementPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/IncludeAttributeStatementPredicate.java
index 774e07fac..156616baa 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/IncludeAttributeStatementPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/IncludeAttributeStatementPredicate.java
@@ -23,7 +23,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.shared.logic.Constraint;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/NotBeforeProfileConfigPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/NotBeforeProfileConfigPredicate.java
index 1d0da3165..23f4ca31c 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/NotBeforeProfileConfigPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/NotBeforeProfileConfigPredicate.java
@@ -20,7 +20,7 @@ package net.shibboleth.idp.saml.profile.config.logic;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignAssertionsPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignAssertionsPredicate.java
index 895e8b8b3..a86480cf8 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignAssertionsPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignAssertionsPredicate.java
@@ -28,7 +28,7 @@ import org.opensaml.saml.saml2.metadata.RoleDescriptor;
import org.opensaml.saml.saml2.metadata.SPSSODescriptor;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
import net.shibboleth.idp.saml.profile.context.navigate.SAMLMetadataContextLookupFunction;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignRequestsPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignRequestsPredicate.java
index 856210b31..10999fd41 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignRequestsPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignRequestsPredicate.java
@@ -23,7 +23,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
import net.shibboleth.idp.saml.profile.context.navigate.SAMLMetadataContextLookupFunction;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignResponsesPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignResponsesPredicate.java
index 1634a1793..2e470f401 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignResponsesPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/SignResponsesPredicate.java
@@ -20,7 +20,7 @@ package net.shibboleth.idp.saml.profile.config.logic;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSArtifactRequestsPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSArtifactRequestsPredicate.java
index ce5492211..48d61e015 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSArtifactRequestsPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSArtifactRequestsPredicate.java
@@ -22,7 +22,7 @@ import javax.annotation.Nullable;
import org.opensaml.messaging.context.MessageContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.messaging.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.profile.config.SAMLArtifactConsumerProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSSOAPLogoutRequestsPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSSOAPLogoutRequestsPredicate.java
index af2eafd03..8a294082a 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSSOAPLogoutRequestsPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/ClientTLSSOAPLogoutRequestsPredicate.java
@@ -22,7 +22,7 @@ import javax.annotation.Nullable;
import org.opensaml.messaging.context.MessageContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.messaging.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.SingleLogoutProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignArtifactRequestsPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignArtifactRequestsPredicate.java
index a7362ea9d..7cf968d86 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignArtifactRequestsPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignArtifactRequestsPredicate.java
@@ -22,7 +22,7 @@ import javax.annotation.Nullable;
import org.opensaml.messaging.context.MessageContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.messaging.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.profile.config.SAMLArtifactConsumerProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignSOAPLogoutRequestsPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignSOAPLogoutRequestsPredicate.java
index 85e184898..a9a00abb5 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignSOAPLogoutRequestsPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/logic/messaging/SignSOAPLogoutRequestsPredicate.java
@@ -22,7 +22,7 @@ import javax.annotation.Nullable;
import org.opensaml.messaging.context.MessageContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.messaging.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.SingleLogoutProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AdditionalAudiencesForAssertionLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AdditionalAudiencesForAssertionLookupFunction.java
index 56dd1ca04..2eab4ed1f 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AdditionalAudiencesForAssertionLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AdditionalAudiencesForAssertionLookupFunction.java
@@ -24,7 +24,7 @@ import javax.annotation.Nullable;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AssertionLifetimeLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AssertionLifetimeLookupFunction.java
index cd295bc1a..8a8f0a179 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AssertionLifetimeLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AssertionLifetimeLookupFunction.java
@@ -22,7 +22,7 @@ import java.time.Duration;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AudienceRestrictionsLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AudienceRestrictionsLookupFunction.java
index 550ff5176..3feae8721 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AudienceRestrictionsLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/AudienceRestrictionsLookupFunction.java
@@ -24,7 +24,7 @@ import java.util.Set;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/QualifiedNameIDFormatsLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/QualifiedNameIDFormatsLookupFunction.java
index d0ff807c6..e69af3197 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/QualifiedNameIDFormatsLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/QualifiedNameIDFormatsLookupFunction.java
@@ -23,7 +23,7 @@ import java.util.Collections;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.saml2.profile.config.SingleLogoutProfileConfiguration;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/SessionLifetimeLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/SessionLifetimeLookupFunction.java
index 1b2e6e6a0..6baba905c 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/SessionLifetimeLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/config/navigate/SessionLifetimeLookupFunction.java
@@ -22,7 +22,7 @@ import java.time.Duration;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/SAMLMetadataContextLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/SAMLMetadataContextLookupFunction.java
index c1281a7e1..ec5c6d00b 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/SAMLMetadataContextLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/SAMLMetadataContextLookupFunction.java
@@ -19,8 +19,8 @@ package net.shibboleth.idp.saml.profile.context.navigate;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.opensaml.messaging.context.BaseContext;
import org.opensaml.profile.context.ProfileRequestContext;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/SAMLMetadataContextLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/SAMLMetadataContextLookupFunction.java
index b71ab7555..9ac1964d0 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/SAMLMetadataContextLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/SAMLMetadataContextLookupFunction.java
@@ -19,8 +19,8 @@ package net.shibboleth.idp.saml.profile.context.navigate.messaging;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.messaging.AbstractRelyingPartyLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import org.opensaml.messaging.context.BaseContext;
import org.opensaml.messaging.context.MessageContext;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java
index 318602aea..943aa6175 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/logic/DefaultNameIdentifierFormatStrategy.java
@@ -18,7 +18,6 @@
package net.shibboleth.idp.saml.profile.logic;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.function.Function;
@@ -26,10 +25,11 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.primitive.StringSupport;
@@ -145,7 +145,7 @@ public class DefaultNameIdentifierFormatStrategy extends MetadataNameIdentifierF
if (fromConfig.isEmpty()) {
if (fromMetadata.isEmpty()) {
log.debug("No formats specified in configuration or in metadata, returning default");
- return Collections.singletonList(defaultFormat);
+ return CollectionSupport.singletonList(defaultFormat);
}
log.debug("Configuration did not specify any formats, relying on metadata alone");
return fromMetadata;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/CheckAddressPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/CheckAddressPredicate.java
index 8752239cb..7b58017ce 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/CheckAddressPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/CheckAddressPredicate.java
@@ -20,7 +20,7 @@ package net.shibboleth.idp.saml.saml2.profile.config.logic;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreRequestSignaturesPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreRequestSignaturesPredicate.java
index 9e5a0ca67..af2c2247f 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreRequestSignaturesPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreRequestSignaturesPredicate.java
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.SAML2ProfileConfiguration;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreScopingProfileConfigPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreScopingProfileConfigPredicate.java
index 0b3f01e8f..dd5710c48 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreScopingProfileConfigPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/IgnoreScopingProfileConfigPredicate.java
@@ -20,7 +20,7 @@ package net.shibboleth.idp.saml.saml2.profile.config.logic;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SOAPErrorPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SOAPErrorPredicate.java
index 0c2a41c70..417bb23ca 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SOAPErrorPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SOAPErrorPredicate.java
@@ -27,7 +27,7 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.profile.context.navigate.CurrentOrPreviousEventLookup;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.ECPProfileConfiguration;
import net.shibboleth.shared.logic.Constraint;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SuppressAuthenticatingAuthorityPredicate.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SuppressAuthenticatingAuthorityPredicate.java
index f6ccbaaca..20aa13e06 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SuppressAuthenticatingAuthorityPredicate.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/logic/SuppressAuthenticatingAuthorityPredicate.java
@@ -20,7 +20,7 @@ package net.shibboleth.idp.saml.saml2.profile.config.logic;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.AbstractRelyingPartyPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/MaximumTimeSinceAuthnLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/MaximumTimeSinceAuthnLookupFunction.java
index 970824a54..dd20c12a8 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/MaximumTimeSinceAuthnLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/MaximumTimeSinceAuthnLookupFunction.java
@@ -24,7 +24,7 @@ import javax.annotation.Nullable;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyCountLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyCountLookupFunction.java
index 68db578d3..818bfd581 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyCountLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyCountLookupFunction.java
@@ -20,7 +20,7 @@ package net.shibboleth.idp.saml.saml2.profile.config.navigate;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.saml2.profile.config.SAML2ProfileConfiguration;
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyRestrictionLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyRestrictionLookupFunction.java
index bf69ad219..46571a73a 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyRestrictionLookupFunction.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/ProxyRestrictionLookupFunction.java
@@ -28,7 +28,7 @@ import javax.annotation.Nullable;
import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
import net.shibboleth.idp.saml.saml2.profile.config.SAML2ProfileConfiguration;
import net.shibboleth.shared.collection.CollectionSupport;
diff --git a/idp-saml-impl/pom.xml b/idp-saml-impl/pom.xml
index 621770eda..539b08ee5 100644
--- a/idp-saml-impl/pom.xml
+++ b/idp-saml-impl/pom.xml
@@ -48,6 +48,14 @@
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>net.shibboleth</groupId>
+ <artifactId>shib-profile-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.shibboleth</groupId>
+ <artifactId>shib-profile-impl</artifactId>
+ </dependency>
<dependency>
<groupId>net.shibboleth</groupId>
<artifactId>shib-attribute-api</artifactId>
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/audit/impl/EncryptionAlgorithmAuditExtractor.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/audit/impl/EncryptionAlgorithmAuditExtractor.java
index c456e64f1..590784d15 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/audit/impl/EncryptionAlgorithmAuditExtractor.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/audit/impl/EncryptionAlgorithmAuditExtractor.java
@@ -26,7 +26,7 @@ import org.opensaml.messaging.context.navigate.ChildContextLookup;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.saml.saml2.profile.context.EncryptionContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/** {@link Function} that returns the data encryption algorithm used. */
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/InitializeRelyingPartyContextFromSAMLPeer.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/InitializeRelyingPartyContextFromSAMLPeer.java
index 5dc2ee046..d0dc22180 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/InitializeRelyingPartyContextFromSAMLPeer.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/InitializeRelyingPartyContextFromSAMLPeer.java
@@ -31,9 +31,9 @@ import org.opensaml.messaging.handler.MessageHandlerException;
import org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext;
import org.slf4j.Logger;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.profile.impl.SAMLRelyingPartyIdLookupStrategy;
import net.shibboleth.idp.saml.profile.impl.SAMLVerificationLookupStrategy;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/SAML2AuthnRequestsSignedSecurityHandler.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/SAML2AuthnRequestsSignedSecurityHandler.java
index 92b2ab60b..06481b20d 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/SAML2AuthnRequestsSignedSecurityHandler.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/messaging/impl/SAML2AuthnRequestsSignedSecurityHandler.java
@@ -27,8 +27,8 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.saml.saml2.metadata.SPSSODescriptor;
import org.slf4j.Logger;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.primitive.LoggerFactory;
/**
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java
index 75547bbf9..9d39cc66a 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java
@@ -40,9 +40,9 @@ import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.ThreadSafeAfterInit;
import net.shibboleth.shared.collection.CollectionSupport;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java
index 69ba5e5b3..5cfb8966a 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java
@@ -39,9 +39,9 @@ import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.ThreadSafeAfterInit;
import net.shibboleth.shared.collection.CollectionSupport;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java
index 28d788ff1..1383ecba8 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java
@@ -42,9 +42,9 @@ import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.attribute.impl.JDBCPairwiseIdStore;
import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.ThreadSafeAfterInit;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/BaseAddAttributeStatementToAssertion.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/BaseAddAttributeStatementToAssertion.java
index ee4d4d507..bed80b5dd 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/BaseAddAttributeStatementToAssertion.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/BaseAddAttributeStatementToAssertion.java
@@ -40,8 +40,8 @@ import net.shibboleth.idp.attribute.transcoding.TranscoderSupport;
import net.shibboleth.idp.attribute.transcoding.TranscodingRule;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.config.navigate.IdentifierGenerationStrategyLookupFunction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContext.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContext.java
index 69ef9056e..3558d77bc 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContext.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContext.java
@@ -41,10 +41,10 @@ import net.shibboleth.idp.authn.config.navigate.ForceAuthnProfileConfigPredicate
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
import net.shibboleth.idp.saml.saml2.profile.config.logic.IgnoreScopingProfileConfigPredicate;
import net.shibboleth.idp.saml.saml2.profile.config.navigate.ProxyCountLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContext.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContext.java
index ee73be4c9..3de9f4e56 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContext.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContext.java
@@ -36,8 +36,8 @@ import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForError.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForError.java
index eb5ca9dbc..3d367e5c2 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForError.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForError.java
@@ -38,7 +38,7 @@ import org.slf4j.Logger;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.component.ComponentInitializationException;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeer.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeer.java
index 3c1307629..75f9235e5 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeer.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeer.java
@@ -32,7 +32,7 @@ import org.slf4j.Logger;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContexts.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContexts.java
index 7b509e105..2bf21955b 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContexts.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContexts.java
@@ -55,11 +55,11 @@ import org.opensaml.saml.saml2.metadata.RoleDescriptor;
import org.slf4j.Logger;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.profile.config.SAMLArtifactAwareProfileConfiguration;
import net.shibboleth.idp.saml.profile.config.SAMLArtifactConfiguration;
import net.shibboleth.idp.saml.profile.config.SAMLProfileConfiguration;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLRelyingPartyIdLookupStrategy.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLRelyingPartyIdLookupStrategy.java
index 64f65f674..71da213f4 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLRelyingPartyIdLookupStrategy.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLRelyingPartyIdLookupStrategy.java
@@ -19,13 +19,13 @@ package net.shibboleth.idp.saml.profile.impl;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-
import org.opensaml.messaging.context.BaseContext;
import org.opensaml.messaging.context.navigate.ContextDataLookupFunction;
import org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext;
import org.opensaml.saml.common.messaging.context.SAMLSelfEntityContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+
/**
* A lookup strategy that returns a SAML entityID if the {@link RelyingPartyContext} contains a reference
* to a {@link SAMLPeerEntityContext} or {@link SAMLSelfEntityContext}.
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLVerificationLookupStrategy.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLVerificationLookupStrategy.java
index 197973674..d506aabf2 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLVerificationLookupStrategy.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/profile/impl/SAMLVerificationLookupStrategy.java
@@ -19,14 +19,14 @@ package net.shibboleth.idp.saml.profile.impl;
import javax.annotation.Nullable;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
-
import org.opensaml.messaging.context.BaseContext;
import org.opensaml.messaging.context.navigate.ContextDataLookupFunction;
import org.opensaml.saml.common.messaging.context.SAMLMetadataContext;
import org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext;
import org.opensaml.saml.common.messaging.context.SAMLSelfEntityContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
+
/**
* A lookup strategy that returns true iff the {@link RelyingPartyContext} contains a reference
* to a {@link SAMLPeerEntityContext} or {@link SAMLSelfEntityContext} that contains a
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java
index 5f1509d89..504cdca14 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java
@@ -59,7 +59,7 @@ import net.shibboleth.shared.service.ServiceableComponent;
* <p>The {@link IdPAttribute} set to be encoded is drawn from an
* {@link net.shibboleth.idp.attribute.context.AttributeContext} returned from a lookup strategy, by default located
- * on the {@link net.shibboleth.idp.profile.context.RelyingPartyContext} beneath the profile request context.</p>
+ * on the {@link net.shibboleth.profile.context.RelyingPartyContext} beneath the profile request context.</p>
*
* @event {@link EventIds#PROCEED_EVENT_ID}
* @event {@link EventIds#INVALID_MSG_CTX}
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignators.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignators.java
index 5284bd7b2..5d9b65d17 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignators.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignators.java
@@ -46,7 +46,7 @@ import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
import net.shibboleth.idp.attribute.transcoding.TranscoderSupport;
import net.shibboleth.idp.attribute.transcoding.TranscodingRule;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java
index 680fa843a..817f9f90b 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java
@@ -60,7 +60,7 @@ import net.shibboleth.shared.service.ServiceableComponent;
* <p>The {@link IdPAttribute} set to be encoded is drawn from an
* {@link net.shibboleth.idp.attribute.context.AttributeContext} returned from a
- * lookup strategy, by default located on the {@link net.shibboleth.idp.profile.context.RelyingPartyContext}
+ * lookup strategy, by default located on the {@link net.shibboleth.profile.context.RelyingPartyContext}
* beneath the profile request context.</p>
*
* @event {@link EventIds#PROCEED_EVENT_ID}
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequest.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequest.java
index 650fc28ca..c0b1295d1 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequest.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequest.java
@@ -31,11 +31,11 @@ import net.shibboleth.idp.authn.AbstractAuthenticationAction;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.profile.IdPEventIds;
import net.shibboleth.idp.profile.config.navigate.IdentifierGenerationStrategyLookupFunction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.RelyingPartyIdLookupFunction;
import net.shibboleth.idp.saml.authn.principal.AuthnContextClassRefPrincipal;
import net.shibboleth.idp.saml.authn.principal.AuthnContextDeclRefPrincipal;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.security.IdentifierGenerationStrategy;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributes.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributes.java
index 735aad2b3..e6f5afa92 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributes.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributes.java
@@ -48,7 +48,7 @@ import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
import net.shibboleth.idp.attribute.transcoding.TranscoderSupport;
import net.shibboleth.idp.attribute.transcoding.TranscodingRule;
import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParameters.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParameters.java
index 14016385a..2df408ed7 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParameters.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParameters.java
@@ -50,9 +50,9 @@ import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.saml2.profile.config.SAML2ProfileConfiguration;
import net.shibboleth.idp.saml.saml2.profile.config.SingleLogoutProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.component.ComponentInitializationException;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContext.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContext.java
index e3eb1136e..e51116e32 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContext.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContext.java
@@ -46,10 +46,10 @@ import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.idp.authn.AbstractAuthenticationAction;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.authn.principal.AuthnContextClassRefPrincipal;
import net.shibboleth.idp.saml.authn.principal.AuthnContextDeclRefPrincipal;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.StringSupport;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java
index c9145277e..e6530aee5 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ValidateSAMLAuthentication.java
@@ -64,12 +64,12 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.principal.IdPAttributePrincipal;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.authn.principal.AuthnContextClassRefPrincipal;
import net.shibboleth.idp.saml.authn.principal.AuthnContextDeclRefPrincipal;
import net.shibboleth.idp.saml.authn.principal.NameIDPrincipal;
import net.shibboleth.idp.saml.profile.context.navigate.SAMLMetadataContextLookupFunction;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.Live;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML1SPSessionCreationStrategy.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML1SPSessionCreationStrategy.java
index 1036cc543..2936313c4 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML1SPSessionCreationStrategy.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML1SPSessionCreationStrategy.java
@@ -29,9 +29,9 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.session.SAML1SPSession;
import net.shibboleth.idp.session.SPSession;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionCreationStrategy.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionCreationStrategy.java
index 3c70b6eb9..e1cbaf310 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionCreationStrategy.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionCreationStrategy.java
@@ -40,10 +40,10 @@ import org.opensaml.saml.saml2.metadata.SPSSODescriptor;
import org.slf4j.Logger;
import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.saml.session.SAML2SPSession;
import net.shibboleth.idp.session.BasicSPSession;
import net.shibboleth.idp.session.SPSession;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.Pair;
import net.shibboleth.shared.logic.Constraint;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/FilterAttributesTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/FilterAttributesTest.java
index 61afd5b5b..517c96d0e 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/FilterAttributesTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/FilterAttributesTest.java
@@ -34,11 +34,11 @@ import net.shibboleth.idp.attribute.filter.impl.AttributeFilterImpl;
import net.shibboleth.idp.attribute.filter.testing.MockMatcher;
import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.impl.FilterAttributes;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.MockReloadableService;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/ResolveAttributesTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/ResolveAttributesTest.java
index 1a955b9f6..8972b8b0b 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/ResolveAttributesTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/profile/impl/tests/ResolveAttributesTest.java
@@ -18,7 +18,6 @@
package net.shibboleth.idp.profile.impl.tests;
import java.util.Collection;
-import java.util.Collections;
import java.util.Map;
import javax.annotation.Nonnull;
@@ -35,12 +34,13 @@ import net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl;
import net.shibboleth.idp.attribute.resolver.testing.MockAttributeDefinition;
import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.impl.ResolveAttributes;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.LazySet;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.MockReloadableService;
@@ -59,6 +59,11 @@ public class ResolveAttributesTest {
private ProfileRequestContext prc;
+ /**
+ * Test setup.
+ *
+ * @throws ComponentInitializationException
+ */
@BeforeMethod public void setUpAction() throws ComponentInitializationException {
src = new RequestContextBuilder().buildRequestContext();
prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
@@ -73,7 +78,7 @@ public class ResolveAttributesTest {
prc.getSubcontext(SubjectContext.class, true);
final IdPAttribute attribute = new IdPAttribute("ad1");
- attribute.setValues(Collections.singletonList(new StringAttributeValue("value1")));
+ attribute.setValues(CollectionSupport.singletonList(new StringAttributeValue("value1")));
final LazySet<AttributeDefinition> definitions = new LazySet<>();
final AttributeDefinition ad1 = new MockAttributeDefinition("ad1", attribute);
@@ -103,11 +108,16 @@ public class ResolveAttributesTest {
Assert.assertEquals(resolvedAttributes.get("ad1"), attribute);
}
+ /**
+ * Test that the action resolves specific attributes and proceeds properly.
+ *
+ * @throws Exception if something goes wrong
+ */
@Test public void testResolveSpecificAttributes() throws Exception {
prc.getSubcontext(SubjectContext.class, true);
final IdPAttribute attribute = new IdPAttribute("ad1");
- attribute.setValues(Collections.singletonList(new StringAttributeValue("value1")));
+ attribute.setValues(CollectionSupport.singletonList(new StringAttributeValue("value1")));
final LazySet<AttributeDefinition> definitions = new LazySet<>();
final AttributeDefinition ad1 = new MockAttributeDefinition("ad1", attribute);
@@ -118,7 +128,7 @@ public class ResolveAttributesTest {
resolver.initialize();
AttributeResolutionContext attributeResolutionCtx = new AttributeResolutionContext();
- attributeResolutionCtx.setRequestedIdPAttributeNames(Collections.singleton("ad1"));
+ attributeResolutionCtx.setRequestedIdPAttributeNames(CollectionSupport.singleton("ad1"));
prc.addSubcontext(attributeResolutionCtx);
final ResolveAttributes action = new ResolveAttributes(new MockReloadableService<>(resolver));
@@ -146,7 +156,7 @@ public class ResolveAttributesTest {
prc.getSubcontext(SubjectContext.class, true);
attributeResolutionCtx = new AttributeResolutionContext();
- attributeResolutionCtx.setRequestedIdPAttributeNames(Collections.singleton("dne"));
+ attributeResolutionCtx.setRequestedIdPAttributeNames(CollectionSupport.singleton("dne"));
prc.addSubcontext(attributeResolutionCtx, true);
event = action.execute(src);
@@ -170,7 +180,7 @@ public class ResolveAttributesTest {
prc.getSubcontext(SubjectContext.class, true);
final IdPAttribute attribute = new IdPAttribute("ad1");
- attribute.setValues(Collections.singletonList(new StringAttributeValue("value1")));
+ attribute.setValues(CollectionSupport.singletonList(new StringAttributeValue("value1")));
final LazySet<AttributeDefinition> definitions = new LazySet<>();
final AttributeDefinition ad1 = new MockAttributeDefinition("ad1", new ResolutionException());
@@ -199,7 +209,7 @@ public class ResolveAttributesTest {
prc.getSubcontext(SubjectContext.class, true);
final IdPAttribute attribute = new IdPAttribute("ad1");
- attribute.setValues(Collections.singletonList(new StringAttributeValue("value1")));
+ attribute.setValues(CollectionSupport.singletonList(new StringAttributeValue("value1")));
final LazySet<AttributeDefinition> definitions = new LazySet<>();
definitions.add(new MockAttributeDefinition("ad1", new ResolutionException()));
@@ -212,14 +222,23 @@ public class ResolveAttributesTest {
ActionTestingSupport.assertEvent(event, IdPEventIds.UNABLE_RESOLVE_ATTRIBS);
}
+ /**
+ * Create the resolver.
+ *
+ * @param resolverId resolver ID
+ * @param definitions attribute definitions
+ * @param connectors data connectors
+ *
+ * @return the resolver implementation
+ */
public static AttributeResolverImpl newAttributeResolverImpl(@Nonnull @NotEmpty final String resolverId,
@Nullable final Collection<AttributeDefinition> definitions,
@Nullable final Collection<DataConnector> connectors) {
final AttributeResolverImpl result = new AttributeResolverImpl();
result.setId(resolverId);
- result.setAttributeDefinitions(definitions == null ? Collections.EMPTY_LIST : definitions);
- result.setDataConnectors(connectors == null ? Collections.EMPTY_LIST : connectors);
+ result.setAttributeDefinitions(definitions == null ? CollectionSupport.emptyList() : definitions);
+ result.setDataConnectors(connectors == null ? CollectionSupport.emptyList() : connectors);
return result;
}
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/tests/DelegatingCriteriaRelyingPartyConfigurationResolverTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/tests/RelyingPartyConfigurationResolverTest.java
similarity index 78%
rename from idp-saml-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/tests/DelegatingCriteriaRelyingPartyConfigurationResolverTest.java
rename to idp-saml-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/tests/RelyingPartyConfigurationResolverTest.java
index ecaac6db1..9c0e3de24 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/tests/DelegatingCriteriaRelyingPartyConfigurationResolverTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/relyingparty/impl/tests/RelyingPartyConfigurationResolverTest.java
@@ -17,8 +17,6 @@
package net.shibboleth.idp.relyingparty.impl.tests;
-import java.util.Arrays;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -44,92 +42,87 @@ import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
-import net.shibboleth.idp.relyingparty.impl.DefaultRelyingPartyConfigurationResolver;
-import net.shibboleth.idp.relyingparty.impl.DelegatingCriteriaRelyingPartyConfigurationResolver;
import net.shibboleth.idp.saml.relyingparty.impl.RelyingPartyConfigurationSupport;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfiguration;
+import net.shibboleth.profile.relyingparty.RelyingPartyConfigurationResolver;
+import net.shibboleth.profile.relyingparty.VerifiedProfileCriterion;
+import net.shibboleth.profile.relyingparty.impl.DefaultRelyingPartyConfigurationResolver;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.resolver.CriteriaSet;
import net.shibboleth.shared.resolver.ResolverException;
-/** Unit tests for {@link DelegatingCriteriaRelyingPartyConfigurationResolver}. */
-public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XMLObjectBaseTestCase {
+/** Advanced unit tests for {@link RelyingPartyConfigurationResolver}. */
+ at SuppressWarnings("javadoc")
+public class RelyingPartyConfigurationResolverTest extends XMLObjectBaseTestCase {
- private RelyingPartyConfiguration anonRP, defaultRP;
+ private net.shibboleth.idp.relyingparty.RelyingPartyConfiguration anonRP, defaultRP;
- private RelyingPartyConfiguration oneByName, twoByName, threeByName;
- private RelyingPartyConfiguration oneByGroup, twoByGroup;
- private RelyingPartyConfiguration oneByTag, twoByTag;
-
- private DefaultRelyingPartyConfigurationResolver delegate;
-
- private DelegatingCriteriaRelyingPartyConfigurationResolver resolver;
+ private net.shibboleth.idp.relyingparty.RelyingPartyConfiguration oneByName, twoByName, threeByName;
+ private net.shibboleth.idp.relyingparty.RelyingPartyConfiguration oneByGroup, twoByGroup;
+ private net.shibboleth.idp.relyingparty.RelyingPartyConfiguration oneByTag, twoByTag;
+ private DefaultRelyingPartyConfigurationResolver resolver;
+
@BeforeMethod
public void setup() throws ComponentInitializationException {
- anonRP = new RelyingPartyConfiguration();
+ anonRP = new net.shibboleth.idp.relyingparty.RelyingPartyConfiguration();
anonRP.setId("anonRPId");
anonRP.setResponderId("anonRPResp");
anonRP.setDetailedErrors(true);
anonRP.initialize();
- defaultRP = new RelyingPartyConfiguration();
+ defaultRP = new net.shibboleth.idp.relyingparty.RelyingPartyConfiguration();
defaultRP.setId("defaultRPId");
defaultRP.setResponderId("defaultRPResp");
defaultRP.setDetailedErrors(true);
defaultRP.initialize();
- oneByName = RelyingPartyConfigurationSupport.byName(Collections.singleton("rp1"));
+ oneByName = RelyingPartyConfigurationSupport.byName(CollectionSupport.singleton("rp1"));
oneByName.setResponderId("foo");
oneByName.setDetailedErrors(true);
oneByName.initialize();
- twoByName = RelyingPartyConfigurationSupport.byName(Collections.singleton("rp2"));
+ twoByName = RelyingPartyConfigurationSupport.byName(CollectionSupport.singleton("rp2"));
twoByName.setResponderId("foo");
twoByName.setDetailedErrors(true);
twoByName.initialize();
- threeByName = RelyingPartyConfigurationSupport.byName(Collections.singleton("rp3"));
+ threeByName = RelyingPartyConfigurationSupport.byName(CollectionSupport.singleton("rp3"));
threeByName.setResponderId("foo");
threeByName.setDetailedErrors(true);
threeByName.initialize();
- oneByGroup = RelyingPartyConfigurationSupport.byGroup(Collections.singleton("group1"), null);
+ oneByGroup = RelyingPartyConfigurationSupport.byGroup(CollectionSupport.singleton("group1"), null);
oneByGroup.setResponderId("foo");
oneByGroup.setDetailedErrors(true);
oneByGroup.initialize();
- twoByGroup = RelyingPartyConfigurationSupport.byGroup(Collections.singleton("group2"), null);
+ twoByGroup = RelyingPartyConfigurationSupport.byGroup(CollectionSupport.singleton("group2"), null);
twoByGroup.setResponderId("foo");
twoByGroup.setDetailedErrors(true);
twoByGroup.initialize();
Candidate candidate1 = new EntityAttributesPredicate.Candidate("urn:test:attr:tag", Attribute.URI_REFERENCE);
- candidate1.setValues(Collections.singleton("tag1"));
- oneByTag = RelyingPartyConfigurationSupport.byTag(Collections.singleton(candidate1), true, true);
+ candidate1.setValues(CollectionSupport.singleton("tag1"));
+ oneByTag = RelyingPartyConfigurationSupport.byTag(CollectionSupport.singleton(candidate1), true, true);
oneByTag.setId("byTag1");
oneByTag.setResponderId("foo");
oneByTag.setDetailedErrors(true);
oneByTag.initialize();
Candidate candidate2 = new EntityAttributesPredicate.Candidate("urn:test:attr:tag", Attribute.URI_REFERENCE);
- candidate2.setValues(Collections.singleton("tag2"));
- twoByTag = RelyingPartyConfigurationSupport.byTag(Collections.singleton(candidate2), true, true);
+ candidate2.setValues(CollectionSupport.singleton("tag2"));
+ twoByTag = RelyingPartyConfigurationSupport.byTag(CollectionSupport.singleton(candidate2), true, true);
twoByTag.setId("byTag2");
twoByTag.setResponderId("foo");
twoByTag.setDetailedErrors(true);
twoByTag.initialize();
- // Complete the population and init this in the individual tests.
- delegate = new DefaultRelyingPartyConfigurationResolver();
- delegate.setId("delegate");
- delegate.setUnverifiedConfiguration(anonRP);
- delegate.setDefaultConfiguration(defaultRP);
-
- resolver = new DelegatingCriteriaRelyingPartyConfigurationResolver();
+ resolver = new DefaultRelyingPartyConfigurationResolver();
resolver.setId("resolver");
- resolver.setDelegate(delegate);
- resolver.initialize();
+ resolver.setUnverifiedConfiguration(anonRP);
+ resolver.setDefaultConfiguration(defaultRP);
}
@Test
@@ -137,13 +130,12 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Iterable<RelyingPartyConfiguration> results = null;
RelyingPartyConfiguration result = null;
- final List<RelyingPartyConfiguration> rpConfigs = Arrays.asList(oneByName, twoByName, threeByName);
+ final List<RelyingPartyConfiguration> rpConfigs = CollectionSupport.listOf(oneByName, twoByName, threeByName);
- delegate.setId("delegate");
- delegate.setRelyingPartyConfigurations(rpConfigs);
- delegate.initialize();
+ resolver.setRelyingPartyConfigurations(rpConfigs);
+ resolver.initialize();
- results = resolver.resolve(new CriteriaSet(new EntityIdCriterion("rp1")));
+ results = resolver.resolve(new CriteriaSet(new EntityIdCriterion("rp1"), new VerifiedProfileCriterion(true)));
Assert.assertNotNull(results);
Iterator<RelyingPartyConfiguration> resultItr = results.iterator();
@@ -151,10 +143,10 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Assert.assertSame(resultItr.next(), oneByName);
Assert.assertFalse(resultItr.hasNext());
- result = resolver.resolveSingle(new CriteriaSet(new EntityIdCriterion("rp2")));
+ result = resolver.resolveSingle(new CriteriaSet(new EntityIdCriterion("rp2"), new VerifiedProfileCriterion(true)));
Assert.assertSame(result, twoByName);
- result = resolver.resolveSingle(new CriteriaSet(new EntityIdCriterion("doesNotExist")));
+ result = resolver.resolveSingle(new CriteriaSet(new EntityIdCriterion("doesNotExist"), new VerifiedProfileCriterion(true)));
Assert.assertSame(result, defaultRP);
results = resolver.resolve(null);
@@ -170,18 +162,17 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Iterable<RelyingPartyConfiguration> results = null;
RelyingPartyConfiguration result = null;
- final List<RelyingPartyConfiguration> rpConfigs = Arrays.asList(oneByName, twoByName, threeByName);
+ final List<RelyingPartyConfiguration> rpConfigs = CollectionSupport.listOf(oneByName, twoByName, threeByName);
- delegate.setId("delegate");
- delegate.setRelyingPartyConfigurations(rpConfigs);
- delegate.initialize();
+ resolver.setRelyingPartyConfigurations(rpConfigs);
+ resolver.initialize();
EntityDescriptor ed = (EntityDescriptor) XMLObjectSupport.buildXMLObject(EntityDescriptor.DEFAULT_ELEMENT_NAME);
ed.setEntityID("rp3");
RoleDescriptor rd = (RoleDescriptor) XMLObjectSupport.buildXMLObject(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
ed.getRoleDescriptors().add(rd);
- results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertNotNull(results);
Iterator<RelyingPartyConfiguration> resultItr = results.iterator();
@@ -189,7 +180,7 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Assert.assertSame(resultItr.next(), threeByName);
Assert.assertFalse(resultItr.hasNext());
- result = resolver.resolveSingle(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ result = resolver.resolveSingle(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertSame(result, threeByName);
}
@@ -198,11 +189,10 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Iterable<RelyingPartyConfiguration> results = null;
RelyingPartyConfiguration result = null;
- final List<RelyingPartyConfiguration> rpConfigs = Arrays.asList(oneByGroup, twoByGroup);
+ final List<RelyingPartyConfiguration> rpConfigs = CollectionSupport.listOf(oneByGroup, twoByGroup);
- delegate.setId("delegate");
- delegate.setRelyingPartyConfigurations(rpConfigs);
- delegate.initialize();
+ resolver.setRelyingPartyConfigurations(rpConfigs);
+ resolver.initialize();
EntityDescriptor ed = (EntityDescriptor) XMLObjectSupport.buildXMLObject(EntityDescriptor.DEFAULT_ELEMENT_NAME);
ed.setEntityID("rp3");
@@ -210,7 +200,7 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
RoleDescriptor rd = (RoleDescriptor) XMLObjectSupport.buildXMLObject(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
ed.getRoleDescriptors().add(rd);
- results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertNotNull(results);
Iterator<RelyingPartyConfiguration> resultItr = results.iterator();
@@ -218,14 +208,14 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Assert.assertSame(resultItr.next(), oneByGroup);
Assert.assertFalse(resultItr.hasNext());
- result = resolver.resolveSingle(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ result = resolver.resolveSingle(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertSame(result, oneByGroup);
// With 2 known group names and 1 unknown, should resolve 2 by group
ed.getObjectMetadata().put(new EntityGroupName("group2"));
ed.getObjectMetadata().put(new EntityGroupName("unknown"));
- results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertNotNull(results);
resultItr = results.iterator();
@@ -241,11 +231,10 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Iterable<RelyingPartyConfiguration> results = null;
RelyingPartyConfiguration result = null;
- final List<RelyingPartyConfiguration> rpConfigs = Arrays.asList(oneByTag, twoByTag);
+ final List<RelyingPartyConfiguration> rpConfigs = CollectionSupport.listOf(oneByTag, twoByTag);
- delegate.setId("delegate");
- delegate.setRelyingPartyConfigurations(rpConfigs);
- delegate.initialize();
+ resolver.setRelyingPartyConfigurations(rpConfigs);
+ resolver.initialize();
EntityDescriptor ed = (EntityDescriptor) XMLObjectSupport.buildXMLObject(EntityDescriptor.DEFAULT_ELEMENT_NAME);
ed.setEntityID("rp3");
@@ -254,7 +243,7 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
addTag(ed, "tag1");
- results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertNotNull(results);
Iterator<RelyingPartyConfiguration> resultItr = results.iterator();
@@ -262,14 +251,14 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
Assert.assertSame(resultItr.next(), oneByTag);
Assert.assertFalse(resultItr.hasNext());
- result = resolver.resolveSingle(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ result = resolver.resolveSingle(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertSame(result, oneByTag);
// With 2 known tags names and 1 unknown, should resolve 2 by tag
addTag(ed, "tag2");
addTag(ed, "unknown");
- results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd)));
+ results = resolver.resolve(new CriteriaSet(new RoleDescriptorCriterion(rd), new VerifiedProfileCriterion(true)));
Assert.assertNotNull(results);
resultItr = results.iterator();
@@ -314,4 +303,4 @@ public class DelegatingCriteriaRelyingPartyConfigurationResolverTest extends XML
attrs.add(attr);
}
-}
+}
\ No newline at end of file
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java
index 876505b46..1064e49f7 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java
@@ -37,11 +37,12 @@ import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
/** Unit test for {@link AttributeSourcedSAML1NameIdentifierGenerator}. */
+ at SuppressWarnings("javadoc")
public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLInitBaseTestCase {
/** The name we give the test attribute. */
@@ -120,7 +121,7 @@ public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLIn
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(values);
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getOrCreateSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -132,7 +133,7 @@ public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLIn
@Test public void testWrongFormat() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(saml1NameIdFor(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setFormat(NameIdentifier.EMAIL);
@@ -144,7 +145,7 @@ public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLIn
@Test public void testNameIdentifierValued() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(saml1NameIdFor(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -160,7 +161,7 @@ public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLIn
@Test public void testMultiNameIdentifierValued() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(saml2NameIdFor(OTHERID), saml1NameIdFor(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -176,7 +177,7 @@ public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLIn
@Test public void testStringValued() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(new StringAttributeValue(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -186,8 +187,8 @@ public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLIn
Assert.assertNotNull(outputNameId);
Assert.assertEquals(outputNameId.getValue(), NAME_1);
Assert.assertEquals(outputNameId.getFormat(), NameIdentifier.X509_SUBJECT);
- Assert.assertEquals(outputNameId.getNameQualifier(), prc.getSubcontext(RelyingPartyContext.class)
- .getConfiguration().getResponderId(prc));
+ Assert.assertEquals(outputNameId.getNameQualifier(),
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) prc.getSubcontext(RelyingPartyContext.class).getConfiguration()).getResponderId(prc));
}
@Test public void testScopeValued() throws Exception {
@@ -203,7 +204,7 @@ public class AttributeSourcedSAML1NameIdentifierGeneratorTest extends OpenSAMLIn
Assert.assertNotNull(outputNameId);
Assert.assertEquals(outputNameId.getValue(), NAME_1 + '@' + QUALIFIER);
Assert.assertEquals(outputNameId.getFormat(), NameIdentifier.X509_SUBJECT);
- Assert.assertEquals(outputNameId.getNameQualifier(), prc.getSubcontext(RelyingPartyContext.class)
- .getConfiguration().getResponderId(prc));
+ Assert.assertEquals(outputNameId.getNameQualifier(),
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) prc.getSubcontext(RelyingPartyContext.class).getConfiguration()).getResponderId(prc));
}
}
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java
index 38b7db00b..4550491af 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java
@@ -37,11 +37,12 @@ import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
/** Unit test for {@link AttributeSourcedSAML2NameIDGenerator}. */
+ at SuppressWarnings("javadoc")
public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTestCase {
/** The name we give the test attribute. */
@@ -119,7 +120,7 @@ public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTe
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(values);
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -131,7 +132,7 @@ public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTe
@Test public void testWrongFormat() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(saml2NameIdFor(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setFormat(NameID.EMAIL);
@@ -143,7 +144,7 @@ public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTe
@Test public void testNameIDValued() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(saml2NameIdFor(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -159,7 +160,7 @@ public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTe
@Test public void testMultiNameIDValued() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(saml2NameIdFor(OTHERID), saml1NameIdFor(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -175,7 +176,7 @@ public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTe
@Test public void testStringValued() throws Exception {
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(List.of(new StringAttributeValue(NAME_1)));
- prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+ prc.getSubcontext(RelyingPartyContext.class).getOrCreateSubcontext(AttributeContext.class).setIdPAttributes(
Collections.singleton(inputAttribute));
generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
@@ -186,7 +187,7 @@ public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTe
Assert.assertEquals(outputNameId.getValue(), NAME_1);
Assert.assertEquals(outputNameId.getFormat(), NameID.X509_SUBJECT);
Assert.assertEquals(outputNameId.getNameQualifier(),
- prc.getSubcontext(RelyingPartyContext.class).getConfiguration().getResponderId(prc));
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) prc.getSubcontext(RelyingPartyContext.class).getConfiguration()).getResponderId(prc));
}
@Test public void testScopeValued() throws Exception {
@@ -203,7 +204,7 @@ public class AttributeSourcedSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTe
Assert.assertEquals(outputNameId.getValue(), NAME_1 + '@' + QUALIFIER);
Assert.assertEquals(outputNameId.getFormat(), NameID.X509_SUBJECT);
Assert.assertEquals(outputNameId.getNameQualifier(),
- prc.getSubcontext(RelyingPartyContext.class).getConfiguration().getResponderId(prc));
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) prc.getSubcontext(RelyingPartyContext.class).getConfiguration()).getResponderId(prc));
Assert.assertEquals(outputNameId.getSPNameQualifier(),
prc.getSubcontext(RelyingPartyContext.class).getRelyingPartyId());
}
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIDDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIDDecoderTest.java
index 38a728134..dcd7a7196 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIDDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIDDecoderTest.java
@@ -49,8 +49,9 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
/**
- * test for {@link CryptoTransientNameIDDecoder}.
+ * Unit test for {@link CryptoTransientNameIDDecoder}.
*/
+ at SuppressWarnings("javadoc")
public class CryptoTransientNameIDDecoderTest extends OpenSAMLInitBaseTestCase {
private final static Duration TIMEOUT = Duration.ofSeconds(5);
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIdentifierDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIdentifierDecoderTest.java
index 5dd5751d5..91e491cbc 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIdentifierDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIdentifierDecoderTest.java
@@ -43,8 +43,9 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
/**
- * test for {@link CryptoTransientNameIdentifierDecoder}.
+ * Unit test for {@link CryptoTransientNameIdentifierDecoder}.
*/
+ at SuppressWarnings("javadoc")
public class CryptoTransientNameIdentifierDecoderTest extends OpenSAMLInitBaseTestCase {
private final static Duration TIMEOUT = Duration.ofSeconds(5);
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java
index cfe9e3c6a..2a07701ef 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML1NameIdentifierGeneratorTest.java
@@ -21,8 +21,8 @@ import java.io.IOException;
import java.time.Duration;
import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.security.DataSealer;
import net.shibboleth.shared.security.impl.BasicKeystoreKeyStrategy;
@@ -39,6 +39,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link TransientSAML1NameIdentifierGenerator} using crypto-based generator. */
+ at SuppressWarnings("javadoc")
public class CryptoTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLInitBaseTestCase {
private static final Duration TIMEOUT = Duration.ofMillis(500);
@@ -119,7 +120,8 @@ public class CryptoTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLIni
Assert.assertNotNull(name);
Assert.assertEquals(name.getFormat(), generator.getFormat());
- Assert.assertEquals(name.getNameQualifier(), rpc.getConfiguration().getResponderId(prc));
+ Assert.assertEquals(name.getNameQualifier(),
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpc.getConfiguration()).getResponderId(prc));
final String val = name.getValue();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java
index 4fd1bd295..779419ee9 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientSAML2NameIDGeneratorTest.java
@@ -21,8 +21,8 @@ import java.io.IOException;
import java.time.Duration;
import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.security.DataSealer;
import net.shibboleth.shared.security.impl.BasicKeystoreKeyStrategy;
@@ -40,6 +40,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link TransientSAML2NameIDGenerator} using crypto-based generator. */
+ at SuppressWarnings("javadoc")
public class CryptoTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTestCase {
private static final Duration TIMEOUT = Duration.ofMillis(500);
@@ -120,7 +121,8 @@ public class CryptoTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTes
Assert.assertNotNull(name);
Assert.assertEquals(name.getFormat(), generator.getFormat());
- Assert.assertEquals(name.getNameQualifier(), rpc.getConfiguration().getResponderId(prc));
+ Assert.assertEquals(name.getNameQualifier(),
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpc.getConfiguration()).getResponderId(prc));
final String val = name.getValue();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIDCanonicalizationTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIDCanonicalizationTest.java
index 3fbf3abee..34b5ed449 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIDCanonicalizationTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIDCanonicalizationTest.java
@@ -43,6 +43,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link NameIDCanonicalization} unit test. */
+ at SuppressWarnings("javadoc")
public class NameIDCanonicalizationTest extends OpenSAMLInitBaseTestCase {
private ProfileRequestContext prc;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIdentifierCanonicalizationTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIdentifierCanonicalizationTest.java
index accd5af49..a28718eb0 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIdentifierCanonicalizationTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIdentifierCanonicalizationTest.java
@@ -42,6 +42,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link NameIdentifierCanonicalization} unit test. */
+ at SuppressWarnings("javadoc")
public class NameIdentifierCanonicalizationTest extends OpenSAMLInitBaseTestCase {
private ProfileRequestContext prc;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGeneratorTest.java
index d529c3efc..7ed49a3a7 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGeneratorTest.java
@@ -28,9 +28,9 @@ import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.attribute.impl.ComputedPairwiseIdStore;
import net.shibboleth.idp.attribute.impl.JDBCPairwiseIdStore;
import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.impl.testing.TestSources;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.testing.DatabaseTestingSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -49,6 +49,7 @@ import org.testng.annotations.Test;
/**
* Test for {@link PersistentSAML2NameIDGenerator}.
*/
+ at SuppressWarnings("javadoc")
public class PersistentSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTestCase {
/** Value calculated using V2 version. DO NOT CHANGE WITHOUT TESTING AGAINST 2.0 */
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoderTest.java
index e5968034c..73bbce61a 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoderTest.java
@@ -40,14 +40,15 @@ import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.attribute.impl.JDBCPairwiseIdStore;
import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.impl.testing.TestSources;
import net.shibboleth.idp.saml.nameid.NameDecoderException;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.DatabaseTestingSupport;
/** Test for {@link StoredPersistentIdDecoder}. */
+ at SuppressWarnings("javadoc")
public class StoredPersistentIdDecoderTest extends OpenSAMLInitBaseTestCase {
private DataSource testSource;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java
index 42e3be18e..ce4121662 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML1NameIdentifierGeneratorTest.java
@@ -18,8 +18,8 @@
package net.shibboleth.idp.saml.nameid.impl;
import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
@@ -33,6 +33,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link TransientSAML1NameIdentifierGenerator} using storage-based generator. */
+ at SuppressWarnings("javadoc")
public class StoredTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLInitBaseTestCase {
private MemoryStorageService store;
@@ -94,7 +95,8 @@ public class StoredTransientSAML1NameIdentifierGeneratorTest extends OpenSAMLIni
Assert.assertNotNull(name);
Assert.assertEquals(name.getFormat(), generator.getFormat());
- Assert.assertEquals(name.getNameQualifier(), rpc.getConfiguration().getResponderId(prc));
+ Assert.assertEquals(name.getNameQualifier(),
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpc.getConfiguration()).getResponderId(prc));
String val = name.getValue();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java
index 698d2fc81..7c152b2da 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredTransientSAML2NameIDGeneratorTest.java
@@ -18,8 +18,8 @@
package net.shibboleth.idp.saml.nameid.impl;
import net.shibboleth.idp.authn.context.SubjectContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
@@ -34,6 +34,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link TransientSAML2NameIDGenerator} using storage-based generator. */
+ at SuppressWarnings("javadoc")
public class StoredTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTestCase {
private MemoryStorageService store;
@@ -95,7 +96,8 @@ public class StoredTransientSAML2NameIDGeneratorTest extends OpenSAMLInitBaseTes
Assert.assertNotNull(name);
Assert.assertEquals(name.getFormat(), generator.getFormat());
- Assert.assertEquals(name.getNameQualifier(), rpc.getConfiguration().getResponderId(prc));
+ Assert.assertEquals(name.getNameQualifier(),
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) rpc.getConfiguration()).getResponderId(prc));
Assert.assertEquals(name.getSPNameQualifier(), rpc.getRelyingPartyId());
String val = name.getValue();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransformingDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransformingDecoderTest.java
index 6c8396022..852d9d8d8 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransformingDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransformingDecoderTest.java
@@ -27,6 +27,7 @@ import org.testng.Assert;
import org.testng.annotations.Test;
/** {@link BaseTransformingDecoder} unit test. */
+ at SuppressWarnings("javadoc")
public class TransformingDecoderTest {
private static final String PRINCIPAL="ThePrincipalName at foo.edu";
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransientDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransientDecoderTest.java
index cf3513ba7..884834f70 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransientDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/TransientDecoderTest.java
@@ -40,6 +40,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link BaseTransientDecoder} unit test. */
+ at SuppressWarnings("javadoc")
public class TransientDecoderTest extends OpenSAMLInitBaseTestCase {
private static final String RECIPIENT="TheRecipient";
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/ExtractSubjectFromRequestTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/ExtractSubjectFromRequestTest.java
index dca25095d..2e019c6ae 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/ExtractSubjectFromRequestTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/ExtractSubjectFromRequestTest.java
@@ -44,6 +44,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link ExtractSubjectFromRequest}. */
+ at SuppressWarnings("javadoc")
public class ExtractSubjectFromRequestTest extends XMLObjectBaseTestCase {
private RequestContext rc;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/FinalizeSAMLSubjectCanonicalizationTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/FinalizeSAMLSubjectCanonicalizationTest.java
index a9f4a0ca4..ff4987f6d 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/FinalizeSAMLSubjectCanonicalizationTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/FinalizeSAMLSubjectCanonicalizationTest.java
@@ -32,6 +32,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link FinalizeSAMLSubjectCanonicalization} unit test. */
+ at SuppressWarnings("javadoc")
public class FinalizeSAMLSubjectCanonicalizationTest {
private RequestContext rc;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContextTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContextTest.java
index da8c524c6..a46e237aa 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContextTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeAuthenticationContextTest.java
@@ -18,17 +18,15 @@
package net.shibboleth.idp.saml.profile.impl;
import net.shibboleth.idp.authn.context.AuthenticationContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.FunctionSupport;
-import java.util.Set;
-
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -44,6 +42,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicates;
/** {@link InitializeAuthenticationContext} unit test. */
+ at SuppressWarnings("javadoc")
public class InitializeAuthenticationContextTest extends OpenSAMLInitBaseTestCase {
private InitializeAuthenticationContext action;
@@ -182,7 +181,7 @@ public class InitializeAuthenticationContextTest extends OpenSAMLInitBaseTestCas
final BrowserSSOProfileConfiguration config = new BrowserSSOProfileConfiguration();
config.setDisallowedFeatures(BrowserSSOProfileConfiguration.FEATURE_SCOPING);
- prc.getSubcontext(RelyingPartyContext.class, true).setProfileConfig(config);
+ prc.getOrCreateSubcontext(RelyingPartyContext.class).setProfileConfig(config);
final Event event = action.execute(requestCtx);
ActionTestingSupport.assertEvent(event, EventIds.ACCESS_DENIED);
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForErrorTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForErrorTest.java
index d18cb2638..108bd18aa 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForErrorTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextForErrorTest.java
@@ -17,11 +17,11 @@
package net.shibboleth.idp.saml.profile.impl;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.binding.BindingDescriptor;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
@@ -39,6 +39,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link InitializeOutboundMessageContextForError} unit test. */
+ at SuppressWarnings("javadoc")
public class InitializeOutboundMessageContextForErrorTest extends OpenSAMLInitBaseTestCase {
private RequestContext src;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextTest.java
index b84797d7d..94c17f176 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeOutboundMessageContextTest.java
@@ -18,10 +18,10 @@
package net.shibboleth.idp.saml.profile.impl;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
@@ -36,6 +36,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link InitializeOutboundMessageContext} unit test. */
+ at SuppressWarnings("javadoc")
public class InitializeOutboundMessageContextTest extends OpenSAMLInitBaseTestCase {
private RequestContext src;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeerTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeerTest.java
index b6ebaec9a..dabc60733 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeerTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/InitializeRelyingPartyContextFromSAMLPeerTest.java
@@ -21,10 +21,10 @@ import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.springframework.webflow.execution.Event;
@@ -34,6 +34,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link InitializeRelyingPartyContextFromSAMLPeer} unit test. */
+ at SuppressWarnings("javadoc")
public class InitializeRelyingPartyContextFromSAMLPeerTest {
private RequestContext src;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContextsTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContextsTest.java
index 65d979cfd..53e284d78 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContextsTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/impl/PopulateBindingAndEndpointContextsTest.java
@@ -29,7 +29,7 @@ import java.util.List;
import javax.annotation.Nonnull;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
@@ -66,6 +66,7 @@ import org.w3c.dom.Document;
import com.google.common.base.Predicates;
/** Unit test for {@link PopulateBindingAndEndpointContexts}. */
+ at SuppressWarnings("javadoc")
public class PopulateBindingAndEndpointContextsTest extends XMLObjectBaseTestCase {
private static final String RELAY_STATE = "foo";
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/DefaultNameIdentifierFormatStrategyTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/DefaultNameIdentifierFormatStrategyTest.java
index e69baa76a..819ca00fb 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/DefaultNameIdentifierFormatStrategyTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/DefaultNameIdentifierFormatStrategyTest.java
@@ -41,6 +41,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link DefaultNameIdentifierFormatStrategy}. */
+ at SuppressWarnings("javadoc")
public class DefaultNameIdentifierFormatStrategyTest extends OpenSAMLInitBaseTestCase {
private SPSSODescriptor role;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/EntityAttributesPredicateTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/EntityAttributesPredicateTest.java
index a2c7b7ffb..d68abb83e 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/EntityAttributesPredicateTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/profile/logic/tests/EntityAttributesPredicateTest.java
@@ -53,6 +53,7 @@ import net.shibboleth.shared.spring.custom.SchemaTypeAwareXMLBeanDefinitionReade
/**
* Unit test for {@link EntityAttributesPredicate} and {@link MappedEntityAttributesPredicate}.
*/
+ at SuppressWarnings("javadoc")
public class EntityAttributesPredicateTest extends XMLObjectBaseTestCase {
private String fooEntityID = "http://foo.example.org/shibboleth";
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertionTest.java
index 3a951593c..c03d9a9ba 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertionTest.java
@@ -50,7 +50,6 @@ import net.shibboleth.idp.attribute.transcoding.BasicNamingFunction;
import net.shibboleth.idp.attribute.transcoding.TranscodingRule;
import net.shibboleth.idp.attribute.transcoding.impl.AttributeTranscoderRegistryImpl;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
@@ -58,6 +57,7 @@ import net.shibboleth.idp.saml.attribute.transcoding.AbstractSAML1AttributeTrans
import net.shibboleth.idp.saml.attribute.transcoding.SAML1AttributeTranscoder;
import net.shibboleth.idp.saml.attribute.transcoding.impl.SAML1StringAttributeTranscoder;
import net.shibboleth.idp.saml.saml1.profile.testing.SAML1ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.MockApplicationContext;
import net.shibboleth.shared.testing.MockReloadableService;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java
index 1b2a807c5..1e4cf26b1 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAuthenticationStatementToAssertionTest.java
@@ -41,12 +41,12 @@ import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
import net.shibboleth.idp.authn.impl.DefaultAuthenticationResultSerializer;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.authn.principal.AuthenticationMethodPrincipal;
import net.shibboleth.idp.saml.saml1.profile.testing.SAML1ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.ConstantSupplier;
@@ -58,7 +58,12 @@ public class AddAuthenticationStatementToAssertionTest extends OpenSAMLInitBaseT
private ProfileRequestContext prc;
private AddAuthenticationStatementToAssertion action;
-
+
+ /**
+ * Test setup.
+ *
+ * @throws ComponentInitializationException
+ */
@BeforeMethod public void setUp() throws ComponentInitializationException {
rc = new RequestContextBuilder().setOutboundMessage(
SAML1ActionTestingSupport.buildResponse()).buildRequestContext();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignatorsTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignatorsTest.java
index c96dc97f6..adf5aaf75 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignatorsTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/FilterByQueriedAttributeDesignatorsTest.java
@@ -43,10 +43,10 @@ import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
import net.shibboleth.idp.attribute.transcoding.impl.AttributeTranscoderRegistryImpl;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.service.ReloadableService;
import net.shibboleth.shared.spring.custom.SchemaTypeAwareXMLBeanDefinitionReader;
@@ -54,6 +54,7 @@ import net.shibboleth.shared.testing.MockReloadableService;
import net.shibboleth.shared.xml.XMLParserException;
/** Tests for {@link FilterByQueriedAttributeDesignators} */
+ at SuppressWarnings("javadoc")
public class FilterByQueriedAttributeDesignatorsTest extends XMLObjectBaseTestCase {
static final String PATH = "/net/shibboleth/idp/saml/impl/profile/";
@@ -74,7 +75,7 @@ public class FilterByQueriedAttributeDesignatorsTest extends XMLObjectBaseTestCa
final GenericApplicationContext context = new GenericApplicationContext();
contexts.add(context);
- SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
+ final SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
new SchemaTypeAwareXMLBeanDefinitionReader(context);
beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
@@ -82,7 +83,7 @@ public class FilterByQueriedAttributeDesignatorsTest extends XMLObjectBaseTestCa
context.refresh();
- Collection<Type> beans = context.getBeansOfType(claz).values();
+ final Collection<Type> beans = context.getBeansOfType(claz).values();
Assert.assertEquals(beans.size(), 1);
return beans.iterator().next();
@@ -110,7 +111,7 @@ public class FilterByQueriedAttributeDesignatorsTest extends XMLObjectBaseTestCa
}
@Test public void noAttributes() {
- prc.getSubcontext(RelyingPartyContext.class,true);
+ prc.getOrCreateSubcontext(RelyingPartyContext.class);
final Event event = action.execute(rc);
ActionTestingSupport.assertProceedEvent(event);
}
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
index 70c4a68d4..f99c9217e 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml1/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
@@ -38,6 +38,7 @@ import net.shibboleth.shared.testing.ConstantSupplier;
/**
* Test the {@link IdPInitiatedSSORequestMessageDecoder}.
*/
+ at SuppressWarnings("javadoc")
public class IdPInitiatedSSORequestMessageDecoderTest {
private IdPInitiatedSSORequestMessageDecoder decoder;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyAwareDefaultAuthenticationMethodsLookupFunctionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyAwareDefaultAuthenticationMethodsLookupFunctionTest.java
index 0b8968159..492cf13bf 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyAwareDefaultAuthenticationMethodsLookupFunctionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyAwareDefaultAuthenticationMethodsLookupFunctionTest.java
@@ -41,6 +41,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link ProxyAwareDefaultAuthenticationMethodsLookupFunction}. */
+ at SuppressWarnings("javadoc")
public class ProxyAwareDefaultAuthenticationMethodsLookupFunctionTest extends OpenSAMLInitBaseTestCase {
private ProfileRequestContext prc1,prc2;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyRestrictionLookupFunctionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyRestrictionLookupFunctionTest.java
index 8e44d6792..b23d3a4c7 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyRestrictionLookupFunctionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/config/navigate/tests/ProxyRestrictionLookupFunctionTest.java
@@ -25,10 +25,10 @@ import javax.security.auth.Subject;
import net.shibboleth.idp.authn.AuthenticationResult;
import net.shibboleth.idp.authn.context.SubjectContext;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
import net.shibboleth.idp.saml.saml2.profile.config.navigate.ProxyRestrictionLookupFunction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.Pair;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -40,6 +40,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link ProxyRestrictionLookupFunction}. */
+ at SuppressWarnings("javadoc")
public class ProxyRestrictionLookupFunctionTest extends OpenSAMLInitBaseTestCase {
private ProfileRequestContext prc;
@@ -56,7 +57,7 @@ public class ProxyRestrictionLookupFunctionTest extends OpenSAMLInitBaseTestCase
config = (BrowserSSOProfileConfiguration) prc.getSubcontext(RelyingPartyContext.class).getConfiguration().getProfileConfiguration(
prc, BrowserSSOProfileConfiguration.PROFILE_ID);
prc.getSubcontext(RelyingPartyContext.class).setProfileConfig(config);
- sc = prc.getSubcontext(SubjectContext.class, true);
+ sc = prc.getOrCreateSubcontext(SubjectContext.class);
sc.getAuthenticationResults().put("test1", new AuthenticationResult("test1", new Subject()));
sc.getAuthenticationResults().put("test2", new AuthenticationResult("test2", new Subject()));
fn = new ProxyRestrictionLookupFunction();
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertionTest.java
index a6fc03297..399b123af 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertionTest.java
@@ -34,7 +34,6 @@ import net.shibboleth.idp.attribute.transcoding.BasicNamingFunction;
import net.shibboleth.idp.attribute.transcoding.TranscodingRule;
import net.shibboleth.idp.attribute.transcoding.impl.AttributeTranscoderRegistryImpl;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
@@ -42,6 +41,7 @@ import net.shibboleth.idp.saml.attribute.transcoding.AbstractSAML2AttributeTrans
import net.shibboleth.idp.saml.attribute.transcoding.SAML2AttributeTranscoder;
import net.shibboleth.idp.saml.attribute.transcoding.impl.SAML2StringAttributeTranscoder;
import net.shibboleth.idp.saml.saml2.profile.testing.SAML2ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.MockApplicationContext;
import net.shibboleth.shared.testing.MockReloadableService;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequestTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequestTest.java
index 99fe83306..1ef5953f8 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequestTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnRequestTest.java
@@ -30,7 +30,6 @@ import net.shibboleth.idp.profile.IdPEventIds;
import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.ResponderIdLookupFunction;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
@@ -40,6 +39,7 @@ import net.shibboleth.idp.saml.authn.principal.AuthenticationMethodPrincipal;
import net.shibboleth.idp.saml.authn.principal.AuthnContextClassRefPrincipal;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
import net.shibboleth.idp.saml.saml2.profile.testing.SAML2ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
@@ -78,11 +78,11 @@ public class AddAuthnRequestTest extends OpenSAMLInitBaseTestCase {
@BeforeMethod public void setUp() throws ComponentInitializationException {
rc = new RequestContextBuilder().buildRequestContext();
prc1 = new WebflowRequestContextProfileRequestContextLookup().apply(rc);
- ac = prc1.getSubcontext(AuthenticationContext.class, true);
- prc2 = ac.getSubcontext(ProfileRequestContext.class, true);
+ ac = prc1.getOrCreateSubcontext(AuthenticationContext.class);
+ prc2 = ac.getOrCreateSubcontext(ProfileRequestContext.class);
prc2.setOutboundMessageContext(new MessageContext());
- rpc = prc2.getSubcontext(RelyingPartyContext.class, true);
+ rpc = prc2.getOrCreateSubcontext(RelyingPartyContext.class);
rpc.setRelyingPartyId(ActionTestingSupport.INBOUND_MSG_ISSUER);
final RelyingPartyConfiguration rp = new RelyingPartyConfiguration();
rp.setId("mock");
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java
index 7ebb02b9e..0de61040d 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAuthnStatementToAssertionTest.java
@@ -46,13 +46,13 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
import net.shibboleth.idp.authn.impl.DefaultAuthenticationResultSerializer;
import net.shibboleth.idp.authn.principal.ProxyAuthenticationPrincipal;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.authn.principal.AuthnContextClassRefPrincipal;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
import net.shibboleth.idp.saml.saml2.profile.testing.SAML2ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.ConstantSupplier;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributesTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributesTest.java
index 037f23175..7f5e921c8 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributesTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/FilterByQueriedAttributesTest.java
@@ -43,10 +43,10 @@ import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
import net.shibboleth.idp.attribute.transcoding.impl.AttributeTranscoderRegistryImpl;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.service.ReloadableService;
import net.shibboleth.shared.spring.custom.SchemaTypeAwareXMLBeanDefinitionReader;
@@ -54,6 +54,7 @@ import net.shibboleth.shared.testing.MockReloadableService;
import net.shibboleth.shared.xml.XMLParserException;
/** Tests for {@link FilterByQueriedAttributes} */
+ at SuppressWarnings("javadoc")
public class FilterByQueriedAttributesTest extends XMLObjectBaseTestCase {
static final String PATH = "/net/shibboleth/idp/saml/impl/profile/";
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
index 3580dc36a..00c14dbae 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/IdPInitiatedSSORequestMessageDecoderTest.java
@@ -39,6 +39,7 @@ import net.shibboleth.shared.testing.ConstantSupplier;
/**
* Test the {@link IdPInitiatedSSORequestMessageDecoder}.
*/
+ at SuppressWarnings("javadoc")
public class IdPInitiatedSSORequestMessageDecoderTest extends XMLObjectBaseTestCase {
private IdPInitiatedSSORequestMessageDecoder decoder;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParametersTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParametersTest.java
index d87f84c2d..ff2403f43 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParametersTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/PopulateEncryptionParametersTest.java
@@ -20,11 +20,11 @@ package net.shibboleth.idp.saml.saml2.profile.impl;
import java.util.Collections;
import net.shibboleth.idp.profile.IdPEventIds;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
@@ -45,6 +45,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** Unit test for {@link PopulateEncryptionParameters}. */
+ at SuppressWarnings("javadoc")
public class PopulateEncryptionParametersTest extends OpenSAMLInitBaseTestCase {
private RequestContext rc;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
index 4c58232bf..20f0f0112 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
@@ -52,6 +52,10 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.testing.ConstantSupplier;
+/**
+ * Unit test for {@link ProcessAssertionsForAuthentication} action.
+ */
+ at SuppressWarnings("javadoc")
public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTestCase {
private ProcessAssertionsForAuthentication action;
@@ -81,7 +85,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
prc = new RequestContextBuilder().buildProfileRequestContext();
- AuthenticationContext authnContext = prc.getSubcontext(AuthenticationContext.class, true);
+ final AuthenticationContext authnContext = prc.getSubcontext(AuthenticationContext.class, true);
samlAuthnContext = new SAMLAuthnContext(new MockProfileAction(), new MockMessageDecoderFunction());
authnContext.addSubcontext(samlAuthnContext);
authnContext.addSubcontext(prcInner);
@@ -89,7 +93,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testValid() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
action.initialize();
@@ -103,7 +107,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testInvalid() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.INVALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.INVALID);
samlResponse.getAssertions().add(assertion1);
action.initialize();
@@ -117,7 +121,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testIndeterminate() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.INDETERMINATE);
+ final Assertion assertion1 = buildAssertion(ValidationResult.INDETERMINATE);
samlResponse.getAssertions().add(assertion1);
action.initialize();
@@ -131,9 +135,9 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testMultipleValidNoSessionInstant() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
- Assertion assertion2 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion2 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion2);
action.initialize();
@@ -148,9 +152,9 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testMultipleValidMixedSessionInstant() throws ComponentInitializationException {
// Assertion1 doesn't have session instant, so pick assertion 2
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
- Assertion assertion2 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion2 = buildAssertion(ValidationResult.VALID);
assertion2.getAuthnStatements().get(0).setSessionNotOnOrAfter(Instant.now().plus(Duration.ofHours(2)));
samlResponse.getAssertions().add(assertion2);
@@ -165,13 +169,13 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testMixedValidity() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.INVALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.INVALID);
samlResponse.getAssertions().add(assertion1);
- Assertion assertion2 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion2 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion2);
- Assertion assertion3 = buildAssertion(ValidationResult.INDETERMINATE);
+ final Assertion assertion3 = buildAssertion(ValidationResult.INDETERMINATE);
samlResponse.getAssertions().add(assertion3);
- Assertion assertion4 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion4 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion4);
action.initialize();
@@ -186,10 +190,10 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testMultipleValidBothSessionInstant() throws ComponentInitializationException {
// Assertion1 has earlier session instant, so pick assertion 1
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
assertion1.getAuthnStatements().get(0).setSessionNotOnOrAfter(Instant.now().plus(Duration.ofHours(1)));
samlResponse.getAssertions().add(assertion1);
- Assertion assertion2 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion2 = buildAssertion(ValidationResult.VALID);
assertion2.getAuthnStatements().get(0).setSessionNotOnOrAfter(Instant.now().plus(Duration.ofHours(2)));
samlResponse.getAssertions().add(assertion2);
@@ -204,7 +208,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testMultipleAuthnStatementsNoSessionInstant() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
assertion1.getAuthnStatements().add(SAML2ActionTestingSupport.buildAuthnStatement());
samlResponse.getAssertions().add(assertion1);
@@ -219,7 +223,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testMultipleAuthnStatementsMixedSessionInstant() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
assertion1.getAuthnStatements().add(SAML2ActionTestingSupport.buildAuthnStatement());
assertion1.getAuthnStatements().get(1).setSessionNotOnOrAfter(Instant.now().plus(Duration.ofHours(2)));
samlResponse.getAssertions().add(assertion1);
@@ -235,7 +239,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testMultipleAuthnStatementsBothSessionInstant() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
assertion1.getAuthnStatements().get(0).setSessionNotOnOrAfter(Instant.now().plus(Duration.ofHours(1)));
assertion1.getAuthnStatements().add(SAML2ActionTestingSupport.buildAuthnStatement());
assertion1.getAuthnStatements().get(1).setSessionNotOnOrAfter(Instant.now().plus(Duration.ofHours(2)));
@@ -276,7 +280,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testNoSAMLAuthnContext() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
prc.getSubcontext(AuthenticationContext.class).removeSubcontext(SAMLAuthnContext.class);
@@ -292,7 +296,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testAssertionNotValidated() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(null);
+ final Assertion assertion1 = buildAssertion(null);
samlResponse.getAssertions().add(assertion1);
action.initialize();
@@ -306,7 +310,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testNoAuthnStatement() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
assertion1.getAuthnStatements().clear();
samlResponse.getAssertions().add(assertion1);
@@ -321,7 +325,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testNoConfirmedSubject() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
assertion1.getObjectMetadata().get(ValidationProcessingData.class).get(0)
.getContext().getDynamicParameters().remove(SAML2AssertionValidationParameters.CONFIRMED_SUBJECT_CONFIRMATION);
samlResponse.getAssertions().add(assertion1);
@@ -337,7 +341,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test
public void testActionInactive() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
action.setActivationCondition(Predicates.alwaysFalse());
@@ -353,7 +357,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test(expectedExceptions = ComponentInitializationException.class)
public void testNullAuthnAssertionStrategy() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
action.setAuthnAssertionSelectionStrategy(null);
@@ -363,7 +367,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test(expectedExceptions = ComponentInitializationException.class)
public void testNullAuthnStatementStrategy() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
action.setAuthnStatementSelectionStrategy(null);
@@ -373,7 +377,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test(expectedExceptions = ComponentInitializationException.class)
public void testNullResponseResolver() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
action.setResponseResolver(null);
@@ -383,7 +387,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
@Test(expectedExceptions = ComponentInitializationException.class)
public void testNullSAMLAuthnContextStrategy() throws ComponentInitializationException {
- Assertion assertion1 = buildAssertion(ValidationResult.VALID);
+ final Assertion assertion1 = buildAssertion(ValidationResult.VALID);
samlResponse.getAssertions().add(assertion1);
action.setSAMLAuthnContextLookupStrategy(null);
@@ -395,11 +399,11 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
// Helpers
private Assertion buildAssertion(ValidationResult validationResult) {
- SubjectConfirmation sc = (SubjectConfirmation) XMLObjectSupport.buildXMLObject(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
- Subject subject = SAML2ActionTestingSupport.buildSubject("testUser");
+ final SubjectConfirmation sc = (SubjectConfirmation) XMLObjectSupport.buildXMLObject(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
+ final Subject subject = SAML2ActionTestingSupport.buildSubject("testUser");
subject.getSubjectConfirmations().add(sc);
- Assertion assertion = SAML2ActionTestingSupport.buildAssertion();
+ final Assertion assertion = SAML2ActionTestingSupport.buildAssertion();
assertion.setSubject(subject);
assertion.getAuthnStatements().add(SAML2ActionTestingSupport.buildAuthnStatement());
@@ -412,7 +416,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
}
private ValidationContext buildValidationContext(SubjectConfirmation sc) {
- ValidationContext vc = new ValidationContext();
+ final ValidationContext vc = new ValidationContext();
vc.getDynamicParameters().put(SAML2AssertionValidationParameters.CONFIRMED_SUBJECT_CONFIRMATION, sc);
return vc;
}
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessLogoutRequestTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessLogoutRequestTest.java
index ba8f6c473..942fb0d3c 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessLogoutRequestTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessLogoutRequestTest.java
@@ -68,6 +68,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link ProcessLogoutRequest} unit test. */
+ at SuppressWarnings("javadoc")
public class ProcessLogoutRequestTest extends SessionManagerBaseTestCase {
private SAMLObjectBuilder<SessionIndex> sessionIndexBuilder;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContextTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContextTest.java
index 5388ea642..6e9f2e386 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContextTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessRequestedAuthnContextTest.java
@@ -22,11 +22,11 @@ import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration;
import net.shibboleth.idp.saml.saml2.profile.testing.SAML2ActionTestingSupport;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import java.util.Collections;
@@ -47,6 +47,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link ProcessRequestedAuthnContext} unit test. */
+ at SuppressWarnings("javadoc")
public class ProcessRequestedAuthnContextTest extends OpenSAMLInitBaseTestCase {
private MockRequestContext src;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java
index 9de8145e1..73c162434 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/SessionManagerBaseTestCase.java
@@ -40,6 +40,7 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
/** Base class for tests requiring a SessionManager component to be set up. */
+ at SuppressWarnings("javadoc")
public class SessionManagerBaseTestCase extends OpenSAMLInitBaseTestCase {
protected MemoryStorageService storageService;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/PrepareInboundMessageContextTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/PrepareInboundMessageContextTest.java
index e2f5f2c2c..308b61868 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/PrepareInboundMessageContextTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/PrepareInboundMessageContextTest.java
@@ -38,6 +38,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link PrepareInboundMessageContext} unit test. */
+ at SuppressWarnings("javadoc")
public class PrepareInboundMessageContextTest extends OpenSAMLInitBaseTestCase {
private RequestContext src;
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionSerializerTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionSerializerTest.java
index 1351b3fd6..a9f73e58c 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionSerializerTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/session/impl/SAML2SPSessionSerializerTest.java
@@ -34,6 +34,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/** {@link SAML2SPSessionSerializer} unit test. */
+ at SuppressWarnings("javadoc")
public class SAML2SPSessionSerializerTest extends OpenSAMLInitBaseTestCase {
private static final String DATAPATH = "/net/shibboleth/idp/saml/impl/session/";
diff --git a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/BasicSPSessionCreationStrategy.java b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/BasicSPSessionCreationStrategy.java
index 70984d4f4..cc5c7420d 100644
--- a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/BasicSPSessionCreationStrategy.java
+++ b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/BasicSPSessionCreationStrategy.java
@@ -29,9 +29,9 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import net.shibboleth.shared.primitive.LoggerFactory;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.BasicSPSession;
import net.shibboleth.idp.session.SPSession;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
/**
diff --git a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/DetectIdentitySwitch.java b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/DetectIdentitySwitch.java
index d1297d7c0..59b842383 100644
--- a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/DetectIdentitySwitch.java
+++ b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/DetectIdentitySwitch.java
@@ -17,7 +17,6 @@
package net.shibboleth.idp.session.impl;
-import java.util.Collections;
import java.util.function.Function;
import javax.annotation.Nonnull;
diff --git a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/PopulateMultiRPContextFromLogoutContext.java b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/PopulateMultiRPContextFromLogoutContext.java
index bacec6947..06f7fe852 100644
--- a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/PopulateMultiRPContextFromLogoutContext.java
+++ b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/PopulateMultiRPContextFromLogoutContext.java
@@ -38,9 +38,9 @@ import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.context.MultiRelyingPartyContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.SPSession;
import net.shibboleth.idp.session.context.LogoutContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.component.ComponentInitializationException;
diff --git a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/RestoreProfileRequestContextTree.java b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/RestoreProfileRequestContextTree.java
index dd2d5d1ce..8b63ec0de 100644
--- a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/RestoreProfileRequestContextTree.java
+++ b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/RestoreProfileRequestContextTree.java
@@ -20,8 +20,8 @@ package net.shibboleth.idp.session.impl;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.ActionSupport;
import net.shibboleth.idp.profile.context.AuditContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.context.LogoutContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import org.opensaml.messaging.context.InOutOperationContext;
diff --git a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/SaveProfileRequestContextTree.java b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/SaveProfileRequestContextTree.java
index 17064b3d1..e05b6275c 100644
--- a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/SaveProfileRequestContextTree.java
+++ b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/SaveProfileRequestContextTree.java
@@ -20,8 +20,8 @@ package net.shibboleth.idp.session.impl;
import net.shibboleth.idp.profile.AbstractProfileAction;
import net.shibboleth.idp.profile.ActionSupport;
import net.shibboleth.idp.profile.context.AuditContext;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.session.context.LogoutContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.logic.Constraint;
import org.opensaml.messaging.context.InOutOperationContext;
diff --git a/idp-spring/src/test/java/net/shibboleth/idp/profile/spring/logic/RelyingPartyIdPredicateTest.java b/idp-spring/src/test/java/net/shibboleth/idp/profile/spring/logic/RelyingPartyIdPredicateTest.java
index 08f2a873f..92902c62c 100644
--- a/idp-spring/src/test/java/net/shibboleth/idp/profile/spring/logic/RelyingPartyIdPredicateTest.java
+++ b/idp-spring/src/test/java/net/shibboleth/idp/profile/spring/logic/RelyingPartyIdPredicateTest.java
@@ -17,8 +17,8 @@
package net.shibboleth.idp.profile.spring.logic;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.logic.RelyingPartyIdPredicate;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.spring.context.FilesystemGenericApplicationContext;
import net.shibboleth.shared.spring.custom.SchemaTypeAwareXMLBeanDefinitionReader;
@@ -34,7 +34,7 @@ import org.testng.annotations.Test;
public class RelyingPartyIdPredicateTest {
private boolean testCandidate(final RelyingPartyIdPredicate rpIdPredicate, final String rpId) {
- ProfileRequestContext prc = new ProfileRequestContext();
+ final ProfileRequestContext prc = new ProfileRequestContext();
final RelyingPartyContext rpc = prc.getSubcontext(RelyingPartyContext.class, true);
assert rpc != null;
rpc.setRelyingPartyId(rpId);
@@ -46,7 +46,7 @@ public class RelyingPartyIdPredicateTest {
public void constructors() {
try (final GenericApplicationContext context = new FilesystemGenericApplicationContext()) {
context.setDisplayName("ApplicationContext: Matcher");
- SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
+ final SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
new SchemaTypeAwareXMLBeanDefinitionReader(context);
beanDefinitionReader.loadBeanDefinitions("net/shibboleth/idp/profile/spring/logic/relyingPartyIdPredicates.xml");
diff --git a/idp-testing/src/main/java/net/shibboleth/idp/profile/testing/RequestContextBuilder.java b/idp-testing/src/main/java/net/shibboleth/idp/profile/testing/RequestContextBuilder.java
index dee81c50f..0c65c3eff 100644
--- a/idp-testing/src/main/java/net/shibboleth/idp/profile/testing/RequestContextBuilder.java
+++ b/idp-testing/src/main/java/net/shibboleth/idp/profile/testing/RequestContextBuilder.java
@@ -33,7 +33,7 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -399,7 +399,7 @@ public class RequestContextBuilder {
*/
@Nonnull protected RelyingPartyContext buildRelyingPartyContext(
@Nonnull final ProfileRequestContext profileRequestContext) throws ComponentInitializationException {
- final RelyingPartyContext rpCtx = profileRequestContext.getSubcontext(RelyingPartyContext.class, true);
+ final RelyingPartyContext rpCtx = profileRequestContext.getOrCreateSubcontext(RelyingPartyContext.class);
if (Objects.equals(NO_VAL, inboundMessageIssuer) || inboundMessageIssuer == null) {
rpCtx.setRelyingPartyId(ActionTestingSupport.INBOUND_MSG_ISSUER);
} else {
diff --git a/idp-testing/src/main/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionTestingSupport.java b/idp-testing/src/main/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionTestingSupport.java
index 3dbd799e6..0b8df86f5 100644
--- a/idp-testing/src/main/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionTestingSupport.java
+++ b/idp-testing/src/main/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionTestingSupport.java
@@ -24,7 +24,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.idp.saml.saml1.profile.config.ArtifactResolutionProfileConfiguration;
@@ -74,7 +74,7 @@ public final class SAML1ActionTestingSupport extends org.opensaml.saml.saml1.tes
rpConfig.setProfileConfigurations(buildProfileConfigurations());
rpConfig.initialize();
- final RelyingPartyContext subcontext = parent.getSubcontext(RelyingPartyContext.class, true);
+ final RelyingPartyContext subcontext = parent.getOrCreateSubcontext(RelyingPartyContext.class);
subcontext.setRelyingPartyId(id);
subcontext.setProfileConfig(rpConfig.getProfileConfiguration(null, BrowserSSOProfileConfiguration.PROFILE_ID));
subcontext.setConfiguration(rpConfig);
diff --git a/idp-testing/src/main/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionTestingSupport.java b/idp-testing/src/main/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionTestingSupport.java
index e88991903..34f0e1e34 100644
--- a/idp-testing/src/main/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionTestingSupport.java
+++ b/idp-testing/src/main/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionTestingSupport.java
@@ -24,7 +24,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.profile.config.ProfileConfiguration;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.idp.relyingparty.RelyingPartyConfiguration;
import net.shibboleth.idp.saml.saml2.profile.config.ArtifactResolutionProfileConfiguration;
@@ -74,7 +74,7 @@ public final class SAML2ActionTestingSupport extends org.opensaml.saml.saml2.tes
rpConfig.setProfileConfigurations(buildProfileConfigurations());
rpConfig.initialize();
- final RelyingPartyContext subcontext = parent.getSubcontext(RelyingPartyContext.class, true);
+ final RelyingPartyContext subcontext = parent.getOrCreateSubcontext(RelyingPartyContext.class);
subcontext.setRelyingPartyId(id);
subcontext.setProfileConfig(rpConfig.getProfileConfiguration(null, BrowserSSOProfileConfiguration.PROFILE_ID));
subcontext.setConfiguration(rpConfig);
diff --git a/idp-testing/src/test/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionSupportTest.java b/idp-testing/src/test/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionSupportTest.java
index 2b276f1f8..6bf0d846a 100644
--- a/idp-testing/src/test/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionSupportTest.java
+++ b/idp-testing/src/test/java/net/shibboleth/idp/saml/saml1/profile/testing/SAML1ActionSupportTest.java
@@ -17,9 +17,9 @@
package net.shibboleth.idp.saml.saml1.profile.testing;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.profile.testing.ActionTestSupportAction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import java.util.function.Function;
@@ -66,14 +66,14 @@ public class SAML1ActionSupportTest extends OpenSAMLInitBaseTestCase {
RelyingPartyContext relyingPartyCtx = relyingPartyContextLookupStrategy.apply(profileRequestContext);
Assert.assertEquals(response.getAssertions().size(), 0, "Expected zarro assertions before insert");
- Assertion assertion = SAML1ActionSupport.addAssertionToResponse(action, response,
+ final Assertion assertion = SAML1ActionSupport.addAssertionToResponse(action, response,
relyingPartyCtx.getProfileConfig().getSecurityConfiguration(profileRequestContext).getIdGenerator(),
- relyingPartyCtx.getConfiguration().getResponderId(profileRequestContext));
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) relyingPartyCtx.getConfiguration()).getResponderId(profileRequestContext));
Assert.assertEquals(response.getAssertions().size(), 1, "Expected but one assertion after insert");
Assert.assertTrue(response.getAssertions().contains(assertion), "Inserted assertion should be there");
- Assertion second = SAML1ActionSupport.addAssertionToResponse(action, response,
+ final Assertion second = SAML1ActionSupport.addAssertionToResponse(action, response,
relyingPartyCtx.getProfileConfig().getSecurityConfiguration(profileRequestContext).getIdGenerator(),
- relyingPartyCtx.getConfiguration().getResponderId(profileRequestContext));
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) relyingPartyCtx.getConfiguration()).getResponderId(profileRequestContext));
Assert.assertEquals(response.getAssertions().size(), 2, "Expected two assertions after two inserts");
Assert.assertTrue(response.getAssertions().contains(assertion), "Inserted assertion should be there");
Assert.assertNotSame(second, assertion, "Two separate assertions should have been added");
diff --git a/idp-testing/src/test/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionSupportTest.java b/idp-testing/src/test/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionSupportTest.java
index 071ed35db..83ed7b4e9 100644
--- a/idp-testing/src/test/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionSupportTest.java
+++ b/idp-testing/src/test/java/net/shibboleth/idp/saml/saml2/profile/testing/SAML2ActionSupportTest.java
@@ -17,9 +17,9 @@
package net.shibboleth.idp.saml.saml2.profile.testing;
-import net.shibboleth.idp.profile.context.RelyingPartyContext;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.idp.saml.profile.testing.ActionTestSupportAction;
+import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.component.ComponentInitializationException;
import java.util.function.Function;
@@ -68,12 +68,12 @@ public class SAML2ActionSupportTest extends OpenSAMLInitBaseTestCase {
Assert.assertEquals(response.getAssertions().size(), 0, "Expected zarro assertions before insert");
Assertion assertion = SAML2ActionSupport.addAssertionToResponse(action, response,
relyingPartyCtx.getProfileConfig().getSecurityConfiguration(profileRequestContext).getIdGenerator(),
- relyingPartyCtx.getConfiguration().getResponderId(profileRequestContext));
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) relyingPartyCtx.getConfiguration()).getResponderId(profileRequestContext));
Assert.assertEquals(response.getAssertions().size(), 1, "Expected but one assertion after insert");
Assert.assertTrue(response.getAssertions().contains(assertion), "Inserted assertion should be there");
Assertion second = SAML2ActionSupport.addAssertionToResponse(action, response,
relyingPartyCtx.getProfileConfig().getSecurityConfiguration(profileRequestContext).getIdGenerator(),
- relyingPartyCtx.getConfiguration().getResponderId(profileRequestContext));
+ ((net.shibboleth.idp.relyingparty.RelyingPartyConfiguration) relyingPartyCtx.getConfiguration()).getResponderId(profileRequestContext));
Assert.assertEquals(response.getAssertions().size(), 2, "Expected two assertions after two inserts");
Assert.assertTrue(response.getAssertions().contains(assertion), "Inserted assertion should be there");
Assert.assertNotSame(second, assertion, "Two separate assertions should have been added");
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list