[java-identity-provider] branch main updated: Promote isFeatureDisallowed method to interface.
Scott Cantor
cantor.2 at osu.edu
Fri Feb 3 18:45:21 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=721172421082c665570201a13d5cc1c6453cccce
The following commit(s) were added to refs/heads/main by this push:
new 721172421 Promote isFeatureDisallowed method to interface.
721172421 is described below
commit 721172421082c665570201a13d5cc1c6453cccce
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Feb 3 13:45:18 2023 -0500
Promote isFeatureDisallowed method to interface.
---
.../idp/profile/config/AbstractProfileConfiguration.java | 11 +----------
.../shibboleth/idp/profile/config/ProfileConfiguration.java | 12 ++++++++++++
.../saml/profile/impl/InitializeAuthenticationContext.java | 5 ++---
.../saml2/profile/impl/ProcessRequestedAuthnContext.java | 5 ++---
4 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java
index 37816b302..8a0c00f22 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/AbstractProfileConfiguration.java
@@ -170,16 +170,7 @@ public abstract class AbstractProfileConfiguration extends AbstractIdentifiableI
outboundFlowsLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy cannot be null");
}
- /**
- * Return true iff the input feature constant is disallowed.
- *
- * @param profileRequestContext current profile request context
- * @param feature a bit constant
- *
- * @return true iff the input feature constant is disallowed
- *
- * @since 3.3.0
- */
+ /** {@inheritDoc} */
public boolean isFeatureDisallowed(@Nullable final ProfileRequestContext profileRequestContext, final int feature) {
return (getDisallowedFeatures(profileRequestContext) & feature) == feature;
}
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/ProfileConfiguration.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/ProfileConfiguration.java
index 88d4b9db0..9412193e6 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/ProfileConfiguration.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/config/ProfileConfiguration.java
@@ -86,4 +86,16 @@ public interface ProfileConfiguration extends IdentifiedComponent {
*/
public int getDisallowedFeatures(@Nullable final ProfileRequestContext profileRequestContext);
+ /**
+ * Return true iff the input feature constant is disallowed.
+ *
+ * @param profileRequestContext current profile request context
+ * @param feature a bit constant
+ *
+ * @return true iff the input feature constant is disallowed
+ *
+ * @since 5.0.0
+ */
+ public boolean isFeatureDisallowed(@Nullable final ProfileRequestContext profileRequestContext, final int feature);
+
}
\ No newline at end of file
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 d04066854..ec181fffa 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
@@ -241,9 +241,8 @@ public class InitializeAuthenticationContext extends AbstractProfileAction {
// Check if permitted.
final RelyingPartyContext rpContext = relyingPartyContextLookupStrategy.apply(profileRequestContext);
- if (rpContext != null && rpContext.getProfileConfig() != null
- && rpContext.getProfileConfig() instanceof BrowserSSOProfileConfiguration) {
- if (((BrowserSSOProfileConfiguration) rpContext.getProfileConfig()).isFeatureDisallowed(
+ if (rpContext != null && rpContext.getProfileConfig() != null) {
+ if (rpContext.getProfileConfig().isFeatureDisallowed(
profileRequestContext, BrowserSSOProfileConfiguration.FEATURE_SCOPING)) {
log.warn("{} Incoming Scoping disallowed by profile configuration", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, EventIds.ACCESS_DENIED);
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 7d243c0ff..839e2274f 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
@@ -194,9 +194,8 @@ public class ProcessRequestedAuthnContext extends AbstractAuthenticationAction {
// Check if permitted.
final RelyingPartyContext rpContext = relyingPartyContextLookupStrategy.apply(profileRequestContext);
- if (rpContext != null && rpContext.getProfileConfig() != null
- && rpContext.getProfileConfig() instanceof BrowserSSOProfileConfiguration) {
- if (((BrowserSSOProfileConfiguration) rpContext.getProfileConfig()).isFeatureDisallowed(
+ if (rpContext != null && rpContext.getProfileConfig() != null) {
+ if (rpContext.getProfileConfig().isFeatureDisallowed(
profileRequestContext, BrowserSSOProfileConfiguration.FEATURE_AUTHNCONTEXT)) {
log.warn("{} Incoming RequestedAuthnContext disallowed by profile configuration", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, EventIds.ACCESS_DENIED);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list