[java-idp-oidc] branch main updated: Removed deprecated classes and methods.

Henri Mikkonen henri.mikkonen at iki.fi
Fri Sep 8 10:15:06 UTC 2023


This is an automated email from the git hooks/post-receive script.

hjmikkon pushed a commit to branch main
in repository java-idp-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=390dc77de937996c7bbea52e5eddb642375851c9

The following commit(s) were added to refs/heads/main by this push:
     new 390dc77d Removed deprecated classes and methods.
390dc77d is described below

commit 390dc77de937996c7bbea52e5eddb642375851c9
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Sep 8 13:14:19 2023 +0300

    Removed deprecated classes and methods.
    
    They were tagged for removal since 3.x.
---
 .../context/OIDCAuthenticationResponseContext.java | 31 -------
 .../idp/plugin/oidc/op/profile/OidcEventIds.java   | 94 ----------------------
 .../op/token/support/AccessTokenClaimsSet.java     | 56 -------------
 .../op/token/support/AuthorizeCodeClaimsSet.java   | 36 ---------
 .../op/token/support/RefreshTokenClaimsSet.java    | 16 ----
 .../oidc/op/token/support/TokenClaimsSet.java      | 30 -------
 .../support/TokenDeliveryClaimsClaimsSet.java      | 32 --------
 ...entIDFromOIDCMetadataContextLookupFunction.java | 78 ------------------
 8 files changed, 373 deletions(-)

diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/context/OIDCAuthenticationResponseContext.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/context/OIDCAuthenticationResponseContext.java
index e03744e4..e33673d7 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/context/OIDCAuthenticationResponseContext.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/context/OIDCAuthenticationResponseContext.java
@@ -208,37 +208,6 @@ public class OIDCAuthenticationResponseContext extends BaseContext {
     public void setAuthorizationGrantClaimsSet(@Nullable final TokenClaimsSet claims) {
         authorizationGrantClaims = claims;
     }
-    
-    /**
-     * Get the claims representing the authorization grant, which may be derived from an
-     * authorization code, refresh token, or assertion.
-     * 
-     * <p>Renamed to {@link #getAuthorizationGrantClaimsSet()}.</p>
-     * 
-     * @return token claims
-     * 
-     * @deprecated
-     */
-    @Deprecated(since="3.1.0", forRemoval=true)
-    @Nullable
-    public TokenClaimsSet getTokenClaimsSet() {
-        return authorizationGrantClaims;
-    }
-
-    /**
-     * Set the claims representing the authorization grant, which may be derived from an
-     * authorization code, refresh token, or assertion.
-     * 
-     * <p>Renamed to {@link #setAuthorizationGrantClaimsSet(TokenClaimsSet)}.</p>
-     * 
-     * @param claims token claims
-     * 
-     * @deprecated
-     */
-    @Deprecated(since="3.1.0", forRemoval=true)
-    public void setTokenClaimsSet(@Nullable final TokenClaimsSet claims) {
-        authorizationGrantClaims = claims;
-    }
 
     /**
      * Get authorization code.
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/OidcEventIds.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/OidcEventIds.java
deleted file mode 100644
index bfeaf5c0..00000000
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/OidcEventIds.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed 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.oidc.op.profile;
-
-import javax.annotation.Nonnull;
-
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-
-/**
- * OpenID Connect -specific constants to use for {@link org.opensaml.profile.action.ProfileAction}
- * {@link org.opensaml.profile.context.EventContext}s.
- * 
- * @deprecated Moved to <code>net.shibboleth.oidc.profile.core.OidcEventIds</code>
- */
- at Deprecated(since="3.1.0", forRemoval=true)
-public final class OidcEventIds {
-    
-    /**
-     * ID of event returned if the mandatory redirect_uris is missing.
-     */
-    @Nonnull @NotEmpty public static final String MISSING_REDIRECT_URIS = "MissingRedirectionURIs";
-
-    /**
-     * ID of event returned if the mandatory redirect_uris is invalid.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_REDIRECT_URIS = "InvalidRedirectionURIs";
-    
-    /**
-     * The provided authorization grant is invalid.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_GRANT = "InvalidGrant";
-    
-    /**
-     * The redirect_uri in request is invalid.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_REDIRECT_URI = "InvalidRedirectionURI";
-    
-    /**
-     * The response type in request is not supported for RP.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_RESPONSE_TYPE = "InvalidResponseType";
-    
-    /**
-     * The grant type in token request is not supported for RP.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_GRANT_TYPE = "InvalidGrantType";
-    
-    /**
-     * The subject resolved is not the expected one.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_SUBJECT = "InvalidSubject";
-    
-    /**
-     * Both request uri and request object in request.
-     */
-    @Nonnull @NotEmpty public static final String REQUEST_OBJECT_AND_URI = "RequestObjectAndUri";
-    
-    /**
-     * The request object cannot be validated.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_REQUEST_OBJECT = "InvalidRequestObject";
-    
-    /**
-     * The request uri is invalid.
-     */
-    @Nonnull @NotEmpty public static final String INVALID_REQUEST_URI = "InvalidRequestUri";
-    
-    /**
-     * The revocation attempt failed.
-     * 
-     * @since 3.1.0
-     */
-    @Nonnull @NotEmpty public static final String REVOCATION_FAILED = "RevocationFailed";
-    
-    /**
-     * Constructor.
-     */
-    private OidcEventIds() {
-        // no op
-    }
-
-}
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java
index 2f6d02f2..e6a1f8b5 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AccessTokenClaimsSet.java
@@ -40,29 +40,6 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
     /** Value of access token claims set type. */
     @Nonnull @NotEmpty protected static final String VALUE_TYPE_AT = "at";
 
-    /**
-     * Constructor for access token claims set when derived from existing claims set.
-     * 
-     * @param tokenClaimsSet Authorize Code / Refresh Token this token is based on
-     * @param scope Validated and possibly reduced scope of the authentication request
-     * @param dlClaims Claims set for token delivery.
-     * @param dlClaimsUI Claims set for token delivery, user info only.
-     * @param iat Issue time of the token
-     * @param exp Expiration time of the token
-     * 
-     * @deprecated
-     */
-// Checkstyle: ParameterNumber OFF
-    @Deprecated(since="3.1.0", forRemoval=true)
-    public AccessTokenClaimsSet(@Nonnull final TokenClaimsSet tokenClaimsSet, @Nonnull final Scope scope,
-            @Nullable final ClaimsSet dlClaims, @Nullable final ClaimsSet dlClaimsUI, @Nonnull final Instant iat,
-            @Nonnull final Instant exp) {
-        
-        final Builder builder = new Builder(tokenClaimsSet, scope, dlClaims, dlClaimsUI, iat, exp);
-        setClaimsSet(builder.buildJWTClaimsSet(VALUE_TYPE_AT));
-    }
-// Checkstyle: ParameterNumber ON
-    
     /**
      * Direct constructor.
      * 
@@ -151,39 +128,6 @@ public final class AccessTokenClaimsSet extends TokenClaimsSet {
             
         }
         
-        /**
-         * Constructor for access token builder.
-         * 
-         * @param idGenerator Generator for pseudo unique identifier for the code
-         * @param clientID Client Id of the rp
-         * @param issuer OP issuer value
-         * @param userPrincipal User Principal of the authenticated user
-         * @param subject subject of the authenticated user
-         * @param issuedAt Issue time of the authorize code
-         * @param expiresAt Expiration time of the authorize code
-         * @param authenticationTime Authentication time of the user
-         * @param redirectURI Validated redirect URI of the authentication request
-         * @param scope Scope of the authentication request
-         * 
-         * @deprecated
-         */
-// Checkstyle: ParameterNumber OFF
-        @Deprecated(since="3.1.0", forRemoval=true)
-        public Builder(@Nonnull final IdentifierGenerationStrategy idGenerator, @Nonnull final ClientID clientID,
-                @Nonnull final String issuer, @Nonnull final String userPrincipal, @Nonnull final String subject,
-                @Nonnull final Instant issuedAt, @Nonnull final Instant expiresAt,
-                @Nonnull final Instant authenticationTime, @Nonnull final URI redirectURI, @Nonnull final Scope scope) {
-            setJWTID(idGenerator);
-            setClientID(clientID);
-            setIssuer(issuer);
-            setPrincipal(userPrincipal);
-            setSubject(subject);
-            setIssuedAt(issuedAt);
-            setExpiresAt(expiresAt);
-            setAuthenticationTime(authenticationTime);
-            setScope(scope);
-        }
-        
         /**
          * Constructor for access token claims set when derived from existing claims set.
          * 
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java
index 600665a8..060d9d4e 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/AuthorizeCodeClaimsSet.java
@@ -84,42 +84,6 @@ public final class AuthorizeCodeClaimsSet extends TokenClaimsSet {
             
         }
         
-        /**
-         * Constructor for authorize code builder.
-         * 
-         * @param idGenerator Generator for pseudo unique identifier for the code
-         * @param clientID Client Id of the rp
-         * @param issuer OP issuer value
-         * @param userPrincipal User Principal of the authenticated user
-         * @param subject subject of the authenticated user
-         * @param issuedAt Issue time of the authorize code
-         * @param expiresAt Expiration time of the authorize code
-         * @param authenticationTime Authentication time of the user
-         * @param redirectURI Validated redirect URI of the authentication request
-         * @param scope Scope of the authentication request
-         * 
-         * @deprecated
-         */
-        // Checkstyle: ParameterNumber OFF
-        @Deprecated(since="3.1.0", forRemoval=true)
-        public Builder(@Nonnull final IdentifierGenerationStrategy idGenerator, @Nonnull final ClientID clientID,
-                @Nonnull final String issuer, @Nonnull final String userPrincipal, @Nonnull final String subject,
-                @Nonnull final Instant issuedAt, @Nonnull final Instant expiresAt,
-                @Nonnull final Instant authenticationTime, @Nonnull final URI redirectURI, @Nonnull final Scope scope) {
-            
-            setJWTID(idGenerator);
-            setClientID(clientID);
-            setIssuer(issuer);
-            setPrincipal(userPrincipal);
-            setSubject(subject);
-            setIssuedAt(issuedAt);
-            setExpiresAt(expiresAt);
-            setAuthenticationTime(authenticationTime);
-            setRedirectURI(redirectURI);
-            setScope(scope);
-        }
-        // Checkstyle: ParameterNumber ON
-
         /**
          * Builds AuthorizeCodeClaimsSet.
          * 
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/RefreshTokenClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/RefreshTokenClaimsSet.java
index 40462ab5..d00d720f 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/RefreshTokenClaimsSet.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/RefreshTokenClaimsSet.java
@@ -37,22 +37,6 @@ public final class RefreshTokenClaimsSet extends TokenClaimsSet {
     /** Value of refresh token claims set type. */
     @Nonnull @NotEmpty private static final String VALUE_TYPE_RF = "rf";
 
-    /**
-     * Constructor for refresh token claims set when derived from existing claim set.
-     * 
-     * @param tokenClaimsSet code or token this token is based on
-     * @param iat new issue time of the token
-     * @param exp new expiration time of the token
-     * 
-     * @deprecated
-     */
-    @Deprecated(since="3.1.0", forRemoval=true)
-    public RefreshTokenClaimsSet(@Nonnull final TokenClaimsSet tokenClaimsSet, @Nonnull final Instant iat,
-            @Nonnull final Instant exp) {
-        final Builder builder = new Builder(tokenClaimsSet, iat, exp);
-        setClaimsSet(builder.buildJWTClaimsSet(VALUE_TYPE_RF));
-    }
-
     /**
      * Private constructor for the parser.
      * 
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java
index 1da28ba6..2b3f7f8c 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenClaimsSet.java
@@ -323,21 +323,6 @@ public class TokenClaimsSet {
         return d != null ? d.toInstant() : null;
     }
 
-    /**
-     * Check if the token is expired.
-     * 
-     * <p>Replaced by {@link #isTimeValid} method that enforces both bounds.</p>
-     * 
-     * @return true if the token is expired, otherwise false
-     * 
-     * @deprecated
-     */
-    @Deprecated(since="3.1.0", forRemoval=true)
-    public boolean isExpired() {
-        Constraint.isNotNull(tokenClaimsSet, "JWTClaimsSet cannot be null");
-        return tokenClaimsSet.getExpirationTime().before(new Date());
-    }
-
     /**
      * Check if the token is valid with respect to expiration and not before limits.
      * 
@@ -1010,21 +995,6 @@ public class TokenClaimsSet {
             return this;
         }
 
-        /**
-         * Set claims request of the authentication request.
-         * 
-         * @param claimsRequest claims request of the authentication request.
-         * 
-         * @return the builder
-         * 
-         * @deprecated
-         */
-        @Deprecated(since="3.1.0", forRemoval=true)
-        public Builder<T> setClaims(@Nullable final OIDCClaimsRequest claimsRequest) {
-            reqClaims = claimsRequest;
-            return this;
-        }
-
         /**
          * Set claims request of the authentication request.
          * 
diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenDeliveryClaimsClaimsSet.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenDeliveryClaimsClaimsSet.java
deleted file mode 100644
index e2d39221..00000000
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/token/support/TokenDeliveryClaimsClaimsSet.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed 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.oidc.op.token.support;
-
-import com.nimbusds.openid.connect.sdk.claims.ClaimsSet;
-
-/**
- * Claims set for token delivery claims.
- * 
- * @deprecated Use {@link ClaimsSet}.
- */
- at Deprecated(since="3.2.0", forRemoval=true)
-public class TokenDeliveryClaimsClaimsSet extends ClaimsSet {
-    
-    /** Constructor. */
-    public TokenDeliveryClaimsClaimsSet() {
-        super();
-    }
-
-}
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/logic/ClientIDFromOIDCMetadataContextLookupFunction.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/logic/ClientIDFromOIDCMetadataContextLookupFunction.java
deleted file mode 100644
index eaf7f2d5..00000000
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/logic/ClientIDFromOIDCMetadataContextLookupFunction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed 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.oidc.op.profile.logic;
-
-import java.util.function.BiFunction;
-import java.util.function.Function;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.messaging.context.navigate.ChildContextLookup;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.profile.context.navigate.InboundMessageContextLookup;
-
-import com.nimbusds.jwt.JWTClaimsSet;
-import com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation;
-
-import net.shibboleth.oidc.metadata.context.OIDCMetadataContext;
-import net.shibboleth.shared.logic.Constraint;
-/**
- * A function that returns client_id via client information stored in {@link OIDCMetadataContext}.
- * 
- * @deprecated As of 3.1.0, moved to 
- * <code>net.shibboleth.oidc.profile.logic.ClientIDFromOIDCMetadataContextLookupFunction</code>
- */
- at Deprecated(forRemoval = true, since = "3.1.0")
-public class ClientIDFromOIDCMetadataContextLookupFunction
-        implements BiFunction<ProfileRequestContext, JWTClaimsSet, String> {
-
-    /** Strategy that will return {@link OIDCMetadataContext}. */
-    @Nonnull private Function<ProfileRequestContext, OIDCMetadataContext> oidcMetadataContextLookupStrategy;
-
-    /**
-     * Constructor.
-     */
-    public ClientIDFromOIDCMetadataContextLookupFunction() {
-        oidcMetadataContextLookupStrategy = new ChildContextLookup<>(OIDCMetadataContext.class).compose(
-                new InboundMessageContextLookup());
-    }
-
-    /**
-     * Set the strategy used to return the {@link OIDCMetadataContext}.
-     * 
-     * @param strategy The lookup strategy.
-     */
-    public void setOIDCMetadataContextLookupStrategy(
-            @Nonnull final Function<ProfileRequestContext, OIDCMetadataContext> strategy) {
-        oidcMetadataContextLookupStrategy =
-                Constraint.isNotNull(strategy, "OIDCMetadataContext lookup strategy cannot be null");
-    }
-
-    /** {@inheritDoc} */
-    @Override @Nullable
-    public String apply(@Nonnull final ProfileRequestContext prc, @Nullable final JWTClaimsSet claimsSet) {
-        final OIDCMetadataContext oidcMetadataContext = oidcMetadataContextLookupStrategy.apply(prc);
-        if (oidcMetadataContext == null) {
-            return null;
-        }
-        final OIDCClientInformation clientInformation = oidcMetadataContext.getClientInformation();
-        if (clientInformation == null || clientInformation.getID() == null) {
-            return null;
-        }
-        return clientInformation.getID().toString();
-    }
-    
-}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list