[java-idp-plugin-oidc-rp] branch main updated: Fix Javadoc and minor syntax issues
Phil Smart
philip.smart at jisc.ac.uk
Mon Apr 24 13:00:33 UTC 2023
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-oidc-rp.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-oidc-rp.git;a=commit;h=6cbd03532d4bd5e7c4996b2f9aa090857ceb6918
The following commit(s) were added to refs/heads/main by this push:
new 6cbd035 Fix Javadoc and minor syntax issues
6cbd035 is described below
commit 6cbd03532d4bd5e7c4996b2f9aa090857ceb6918
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Mon Apr 24 14:00:28 2023 +0100
Fix Javadoc and minor syntax issues
---
.../idp/plugin/authn/oidc/rp/OIDCProxyException.java | 20 +++++++++++++++++++-
.../shibboleth/idp/plugin/authn/oidc/rp/Version.java | 18 ++++++++++++++++++
.../oidc/rp/context/AbstractOIDCEntityContext.java | 1 -
.../authn/oidc/rp/context/OAuth2ClientContext.java | 1 -
.../authn/oidc/rp/context/OIDCAuthnContext.java | 4 ++--
.../rp/context/OutboundMessageHandlerContext.java | 6 ++----
.../navigate/IDTokenInAccessTokenUpdateStrategy.java | 1 +
.../navigate/RequestObjectTokenUpdateStrategy.java | 1 -
.../logic/AbstractUserInfoResponseTypeCondition.java | 2 +-
.../logic/RequestObjectRequiredAndSupported.java | 5 +++--
.../RequiresSignatureVerificationPredicate.java | 5 ++---
.../UserInfoEncryptedJWTResponseTypeCondition.java | 5 +++--
.../logic/UserInfoPlainResponseTypeCondition.java | 5 +++--
.../UserInfoSignedJWTResponseTypeCondition.java | 5 +++--
.../AuthenticationRequestTimeLookupFunction.java | 2 +-
15 files changed, 58 insertions(+), 23 deletions(-)
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/OIDCProxyException.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/OIDCProxyException.java
index c79918a..dbbbe22 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/OIDCProxyException.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/OIDCProxyException.java
@@ -1,9 +1,27 @@
+/*
+ * 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.oidc.rp;
import javax.annotation.concurrent.ThreadSafe;
/**
- * An exception to signal a general Duo error.
+ * An exception to signal a general proxy error.
*/
@ThreadSafe
public class OIDCProxyException extends Exception{
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/Version.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/Version.java
index da5b500..90925e3 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/Version.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/Version.java
@@ -1,3 +1,21 @@
+/*
+ * 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.oidc.rp;
import javax.annotation.Nullable;
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/AbstractOIDCEntityContext.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/AbstractOIDCEntityContext.java
index 062fef0..0bb96c7 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/AbstractOIDCEntityContext.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/AbstractOIDCEntityContext.java
@@ -24,7 +24,6 @@ import org.opensaml.messaging.context.BaseContext;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
-
/**
* Abstract base class for subcontexts that carry information about a OIDC entity. This context will often
* contain subcontexts, whose data is construed to be scoped to that entity.
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OAuth2ClientContext.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OAuth2ClientContext.java
index 2841ba1..36c52ed 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OAuth2ClientContext.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OAuth2ClientContext.java
@@ -37,7 +37,6 @@ import net.shibboleth.utilities.java.support.logic.Constraint;
* @parent {@link OIDCPeerEntityContext}
* @added During an OAuth 2.0 authentication request attempt
*/
-//TODO do we need this, we could just take stuff off the RP profile config
public class OAuth2ClientContext extends BaseContext {
/** The client_id.*/
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OIDCAuthnContext.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OIDCAuthnContext.java
index bfb945f..8c28713 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OIDCAuthnContext.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OIDCAuthnContext.java
@@ -30,7 +30,7 @@ import org.opensaml.profile.action.ProfileAction;
import net.shibboleth.utilities.java.support.logic.Constraint;
/**
- * Manages state during proxied OIDC authentication.
+ * Manages state during proxied OIDC authentication via a Spring Controller.
*/
public class OIDCAuthnContext extends BaseContext {
@@ -41,7 +41,7 @@ public class OIDCAuthnContext extends BaseContext {
@Nonnull private final ProfileAction encodeMessageAction;
/** The function to use to obtain a decoder. */
- @Nonnull private Function<String,MessageDecoder> decoderFactory;
+ @Nonnull private final Function<String,MessageDecoder> decoderFactory;
/**
* Constructor.
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OutboundMessageHandlerContext.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OutboundMessageHandlerContext.java
index 451dc67..fbeb67e 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OutboundMessageHandlerContext.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/OutboundMessageHandlerContext.java
@@ -34,7 +34,7 @@ public class OutboundMessageHandlerContext extends BaseContext {
@Nullable private String webflowKey;
/**
- * Constructor.
+ * Convenience constructor.
*
* @param key the swf key
*/
@@ -67,8 +67,6 @@ public class OutboundMessageHandlerContext extends BaseContext {
*/
@Nullable public String getWebflowKey() {
return webflowKey;
- }
-
-
+ }
}
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/IDTokenInAccessTokenUpdateStrategy.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/IDTokenInAccessTokenUpdateStrategy.java
index ee86219..5c79f27 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/IDTokenInAccessTokenUpdateStrategy.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/IDTokenInAccessTokenUpdateStrategy.java
@@ -74,6 +74,7 @@ public class IDTokenInAccessTokenUpdateStrategy implements BiConsumer<ProfileReq
tokenResponseContextLookupStrategy.apply(profileRequestContext);
if (context != null) {
try {
+ // Create a new token response with the update id_token from the existing response
final JSONObject jsonToken = context.getTokenResponse().toJSONObject();
jsonToken.put("id_token", idToken.serialize());
context.setTokenResponse(OIDCTokenResponse.parse(jsonToken));
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/RequestObjectTokenUpdateStrategy.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/RequestObjectTokenUpdateStrategy.java
index 7a8642a..8321805 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/RequestObjectTokenUpdateStrategy.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/context/navigate/RequestObjectTokenUpdateStrategy.java
@@ -28,7 +28,6 @@ import org.slf4j.LoggerFactory;
import com.nimbusds.jwt.JWT;
-import net.shibboleth.idp.plugin.authn.oidc.rp.context.navigate.AccessTokenLookupStrategy;
import net.shibboleth.oidc.profile.core.OIDCAuthenticationRequest;
import net.shibboleth.utilities.java.support.logic.Constraint;
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/AbstractUserInfoResponseTypeCondition.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/AbstractUserInfoResponseTypeCondition.java
index 51f0e15..7fa0623 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/AbstractUserInfoResponseTypeCondition.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/AbstractUserInfoResponseTypeCondition.java
@@ -32,7 +32,7 @@ import net.shibboleth.utilities.java.support.logic.Constraint;
/**
* Abstract predicate for pulling out the {@link UserInfoResponseContext}. If either the
- * profile request context or extracted UserInfo response context are null, false is returned
+ * profile request context or extracted UserInfo response context are {@code null} false is returned
* immediately.
*/
public abstract class AbstractUserInfoResponseTypeCondition implements Predicate<ProfileRequestContext> {
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequestObjectRequiredAndSupported.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequestObjectRequiredAndSupported.java
index 638023c..1333e94 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequestObjectRequiredAndSupported.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequestObjectRequiredAndSupported.java
@@ -36,7 +36,7 @@ import net.shibboleth.oidc.metadata.context.OIDCProviderMetadataContext;
import net.shibboleth.oidc.profile.config.OIDCAuthenticationRelyingPartyProfileConfiguration;
import net.shibboleth.utilities.java.support.logic.Constraint;
-/** Tests whether a request object should be build, and if it is supported by the upstream OP.*/
+/** Tests whether a request object should be built, and if it is supported by the upstream OP.*/
public class RequestObjectRequiredAndSupported extends AbstractRelyingPartyPredicate {
/** Class logger. */
@@ -79,7 +79,8 @@ public class RequestObjectRequiredAndSupported extends AbstractRelyingPartyPredi
final OIDCProviderMetadataContext metadata = oidcProviderMetadataContextLookupStrategy.apply(input);
if (metadata == null || metadata.getProviderInformation() == null) {
// Should not happen at the time this predicate is called.
- log.warn("OIDC Provider Metadata is not available, can not determine if request object is supported");
+ log.warn("OIDC Provider Metadata is not available, can not determine if request object is supported, "
+ + "will not build request object");
return false;
}
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequiresSignatureVerificationPredicate.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequiresSignatureVerificationPredicate.java
index d1f3f74..5648436 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequiresSignatureVerificationPredicate.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/RequiresSignatureVerificationPredicate.java
@@ -35,8 +35,8 @@ import net.shibboleth.utilities.java.support.annotation.ParameterName;
import net.shibboleth.utilities.java.support.logic.Constraint;
/**
- * Is successful TLS credential verification enough to validate the JWT in question? Defaults to true —
- * signature verification is required.
+ * Is successful TLS credential verification enough to validate the JWT in question or should JWT signature validation
+ * be applied? Defaults to true — signature verification is required.
*/
public class RequiresSignatureVerificationPredicate extends AbstractRelyingPartyPredicate {
@@ -46,7 +46,6 @@ public class RequiresSignatureVerificationPredicate extends AbstractRelyingParty
/** Strategy used to lookup the {@link AbstractAuthenticatableOIDCContext} to test. */
@Nonnull
private final Function<MessageContext, AbstractAuthenticatableOIDCContext> authenticatableOIDCContextLookupStrategy;
-
/**
*
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoEncryptedJWTResponseTypeCondition.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoEncryptedJWTResponseTypeCondition.java
index 6d626ed..15507ac 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoEncryptedJWTResponseTypeCondition.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoEncryptedJWTResponseTypeCondition.java
@@ -27,7 +27,7 @@ import com.nimbusds.jwt.EncryptedJWT;
import net.shibboleth.idp.plugin.authn.oidc.rp.context.UserInfoResponseContext;
/**
- * Return true if the UserInfo response was an encrypted JWT type.
+ * Return true if the UserInfo JWT response was an encrypted JWT type.
*/
public class UserInfoEncryptedJWTResponseTypeCondition extends AbstractUserInfoResponseTypeCondition {
@@ -41,4 +41,5 @@ public class UserInfoEncryptedJWTResponseTypeCondition extends AbstractUserInfoR
return (JWEAlgorithm.Family.SYMMETRIC.contains(context.getUserInfo().getUserInfoJWT().getHeader()
.getAlgorithm()) || JWEAlgorithm.Family.ASYMMETRIC.contains(context.getUserInfo().getUserInfoJWT()
.getHeader().getAlgorithm())) && context.getUserInfo().getUserInfoJWT() instanceof EncryptedJWT;
- }}
+ }
+}
\ No newline at end of file
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoPlainResponseTypeCondition.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoPlainResponseTypeCondition.java
index bb3174f..eef2f2d 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoPlainResponseTypeCondition.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoPlainResponseTypeCondition.java
@@ -37,5 +37,6 @@ public class UserInfoPlainResponseTypeCondition extends AbstractUserInfoResponse
return false;
}
return context.getUserInfo().getEntityContentType() == ContentType.APPLICATION_JSON &&
- context.getUserInfo().getUserInfo() != null;
- }}
+ context.getUserInfo().getUserInfo() != null && context.getUserInfo().getUserInfoJWT() == null;
+ }
+}
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoSignedJWTResponseTypeCondition.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoSignedJWTResponseTypeCondition.java
index 72aa0e3..0596f65 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoSignedJWTResponseTypeCondition.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/logic/UserInfoSignedJWTResponseTypeCondition.java
@@ -27,7 +27,7 @@ import com.nimbusds.jwt.SignedJWT;
import net.shibboleth.idp.plugin.authn.oidc.rp.context.UserInfoResponseContext;
/**
- * Return true if the UserInfo response was a signed JWT type.
+ * Return true if the UserInfo JWT response was a signed JWT type.
*/
public class UserInfoSignedJWTResponseTypeCondition extends AbstractUserInfoResponseTypeCondition {
@@ -40,4 +40,5 @@ public class UserInfoSignedJWTResponseTypeCondition extends AbstractUserInfoResp
return JWSAlgorithm.Family.SIGNATURE.contains(context.getUserInfo().getUserInfoJWT().getHeader()
.getAlgorithm()) && context.getUserInfo().getUserInfoJWT() instanceof SignedJWT;
- }}
+ }
+}
diff --git a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/navigate/AuthenticationRequestTimeLookupFunction.java b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/navigate/AuthenticationRequestTimeLookupFunction.java
index 13072d7..18257f9 100644
--- a/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/navigate/AuthenticationRequestTimeLookupFunction.java
+++ b/idp-oidc-rp-api/src/main/java/net/shibboleth/idp/plugin/authn/oidc/rp/messaging/context/navigate/AuthenticationRequestTimeLookupFunction.java
@@ -34,7 +34,7 @@ import net.shibboleth.utilities.java.support.logic.Constraint;
* Lookup function that returns the time at which the RP sent the authentication request, as taken from the
* authentication request object.
*/
-public class AuthenticationRequestTimeLookupFunction implements Function<ProfileRequestContext, Instant> {
+public class AuthenticationRequestTimeLookupFunction implements Function<ProfileRequestContext, Instant> {
/** Class logger. */
@Nonnull private final Logger log = LoggerFactory.getLogger(AuthenticationRequestTimeLookupFunction.class);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list