[java-idp-plugin-duo] branch main updated: Fix checkstyle and synchronization issue
Phil Smart
philip.smart at jisc.ac.uk
Thu Feb 25 17:35:50 UTC 2021
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-duo.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=5e1f83b34ac466075356162334b239bcdbf4877d
The following commit(s) were added to refs/heads/main by this push:
new 5e1f83b Fix checkstyle and synchronization issue
5e1f83b is described below
commit 5e1f83b34ac466075356162334b239bcdbf4877d
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Feb 25 17:35:48 2021 +0000
Fix checkstyle and synchronization issue
---
.../idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java | 14 +++-----------
.../idp/plugin/authn/duo/DuoOIDCIntegration.java | 1 -
.../net/shibboleth/idp/plugin/authn/duo/URISupport.java | 7 +++++++
.../idp/plugin/authn/duo/model/DuoHealthCheck.java | 17 +++++++++++++++++
4 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java
index 3d57f3e..cf0d592 100644
--- a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java
+++ b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java
@@ -17,8 +17,6 @@
package net.shibboleth.idp.plugin.authn.duo;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
@@ -30,7 +28,6 @@ import javax.annotation.Nullable;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.ThreadSafe;
import javax.security.auth.Subject;
-import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,20 +40,15 @@ import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
import net.shibboleth.utilities.java.support.component.AbstractInitializableComponent;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
-import net.shibboleth.utilities.java.support.component.InitializableComponent;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
/**
* Data wrapper for use with Duo OIDC integrations. Holds shared-state.
*
- * Is an {@link InitializableComponent} component and is hence
- * made 'effectively immutable' once initialized and properly published by spring.
- * FIXME
- * Despite most fields being 'effectively immutable' once published by Spring, the redirectURI is allowed
- * to change, but in a thread-safe manor.
+ * <p>Despite most fields being 'effectively immutable' once published by Spring, the redirectURI is allowed
+ * to change, but in a thread-safe manor.</p>
*
- * Is capable of deriving the redirectURI from the server request checked against a known list of allowed hosts.
*/
@ThreadSafe
public final class DefaultDuoOIDCIntegration extends AbstractInitializableComponent implements DuoOIDCIntegration{
@@ -113,7 +105,7 @@ public final class DefaultDuoOIDCIntegration extends AbstractInitializableCompon
}
@Override
- @Nonnull @NotLive @Unmodifiable public Set<String> getAllowedOrigins() {
+ @Nonnull @NotLive @Unmodifiable public synchronized Set<String> getAllowedOrigins() {
return Collections.unmodifiableSet(allowedOrigins);
}
diff --git a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCIntegration.java b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCIntegration.java
index fee033e..678fb02 100644
--- a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCIntegration.java
+++ b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCIntegration.java
@@ -22,7 +22,6 @@ import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import javax.servlet.http.HttpServletRequest;
import net.shibboleth.idp.authn.principal.PrincipalSupportingComponent;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
diff --git a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/URISupport.java b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/URISupport.java
index bd569e9..143dca2 100644
--- a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/URISupport.java
+++ b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/URISupport.java
@@ -70,6 +70,13 @@ public final class URISupport {
return uri;
}
+ /**
+ * Builds the 'origin' (see RFC 6454) from given URI. Omits default or unknown ports.
+ *
+ * @param uri the URI to build the origin from
+ * @return the origin
+ * @throws URISyntaxException if there is an error getting information from the URI.
+ */
@Nonnull public static String buildOrigin(@Nonnull final URI uri) throws URISyntaxException {
if (uri.getPort() == -1) {
diff --git a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/model/DuoHealthCheck.java b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/model/DuoHealthCheck.java
index cb7a228..bacfcbb 100644
--- a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/model/DuoHealthCheck.java
+++ b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/model/DuoHealthCheck.java
@@ -1,3 +1,20 @@
+/*
+ * 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.plugin.authn.duo.model;
import javax.annotation.Nonnull;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list