[java-idp-plugin-oidc-op-oidfed] 01/02: Deleted obsolete class, covered by client information decorator nowadays

Codeberg noreply at shibboleth.net
Fri Oct 9 10:19:49 UTC 2026


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

codeberg pushed a commit to branch main
in repository java-idp-plugin-oidc-op-oidfed.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-oidc-op-oidfed/commit/ec45ee71f09864b9530b10cb9bbdc0a6073cb6f4

commit ec45ee71f09864b9530b10cb9bbdc0a6073cb6f4
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Oct 9 09:39:23 2026 +0300

    Deleted obsolete class, covered by client information decorator nowadays
---
 .../profile/impl/StoreAutomaticRegistration.java   | 187 ---------------------
 1 file changed, 187 deletions(-)

diff --git a/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/impl/StoreAutomaticRegistration.java b/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/impl/StoreAutomaticRegistration.java
deleted file mode 100644
index 1e38d6a..0000000
--- a/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/impl/StoreAutomaticRegistration.java
+++ /dev/null
@@ -1,187 +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.oidfed.profile.impl;
-
-import java.time.Instant;
-import java.util.function.Function;
-
-import javax.annotation.Nonnull;
-
-import org.opensaml.messaging.context.navigate.ChildContextLookup;
-import org.opensaml.profile.action.ActionSupport;
-import org.opensaml.profile.action.EventIds;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.profile.context.navigate.InboundMessageContextLookup;
-import org.slf4j.Logger;
-
-import com.nimbusds.oauth2.sdk.id.ClientID;
-import com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation;
-import com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata;
-
-import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.oidc.metadata.ClientInformationManager;
-import net.shibboleth.oidc.metadata.ClientInformationManagerException;
-import net.shibboleth.oidfed.profile.context.RelyingPartyTrustChainContext;
-import net.shibboleth.oidfed.profile.context.VerifiedTrustChain;
-import net.shibboleth.oidfed.profile.navigate.DefaultSelectedTrustChainMetadataLookupStrategy;
-import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
-import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
-import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.LoggerFactory;
-
-/**
- * Stores the automatically registered client information via configurable {@link ClientInformationManager}.
- * The client information and its expiration time are fetched from {@link RelyingPartyTrustChainContext}.
- */
-public class StoreAutomaticRegistration extends AbstractProfileAction {
-
-    /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(StoreAutomaticRegistration.class);
-
-    /** The client information manager used for storing the information. */
-    @NonnullAfterInit private ClientInformationManager clientInformationManager;
-
-    /** Strategy used to lookup the trust chain context. */
-    @Nonnull private Function<ProfileRequestContext, RelyingPartyTrustChainContext> trustChainContextLookupStrategy;
-
-    /** Strategy used to lookup the selected metadata. */
-    @Nonnull private Function<ProfileRequestContext, OIDCClientMetadata> selectedMetadataLookupStrategy;
-
-    /** The client information to be stored. */
-    @NonnullBeforeExec private OIDCClientInformation clientInformation;
-
-    /** The expiration instant for the client informatiom. */
-    @NonnullBeforeExec private Instant expiration;
-
-    /**
-     * Constructor.
-     */
-    public StoreAutomaticRegistration() {
-        final Function<ProfileRequestContext, RelyingPartyTrustChainContext> tcls =
-                new ChildContextLookup<>(RelyingPartyTrustChainContext.class).compose(
-                        new InboundMessageContextLookup());
-        assert tcls != null;
-        trustChainContextLookupStrategy = tcls;
-        selectedMetadataLookupStrategy = new DefaultSelectedTrustChainMetadataLookupStrategy();
-    }
-
-    /**
-     * Get the client information manager used for storing the information.
-     * 
-     * @return The client information manager used for storing the information
-     */
-    @NonnullAfterInit public ClientInformationManager getClientInformationManager() {
-        return clientInformationManager;
-    }
-
-    /**
-     * Set the client information manager used for storing the information.
-     * @param manager The client information manager used for storing the information.
-     */
-    public void setClientInformationManager(@Nonnull final ClientInformationManager manager) {
-        ifInitializedThrowUnmodifiabledComponentException();
-        clientInformationManager = Constraint.isNotNull(manager, "The client information manager cannot be null!");
-    }
-
-    /**
-     * Set the strategy used to lookup the trust chain context.
-     * 
-     * @param strategy lookup strategy
-     */
-    public void setTrustChainContextLookupStrategy(
-            @Nonnull final Function<ProfileRequestContext, RelyingPartyTrustChainContext> strategy) {
-        checkSetterPreconditions();
-        trustChainContextLookupStrategy =
-                Constraint.isNotNull(strategy, "TrustChainContextLookupStrategy cannot be null");
-    }
-
-    /**
-     * Set the strategy used to lookup the selected metadata.
-     * 
-     * @param strategy lookup strategy
-     */
-    public void setSelectedMetadataLookupStrategy(
-            @Nonnull final Function<ProfileRequestContext, OIDCClientMetadata> strategy) {
-        checkSetterPreconditions();
-        selectedMetadataLookupStrategy =
-                Constraint.isNotNull(strategy, "SelectedMetadataLookupStrategy cannot be null");
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void doInitialize() throws ComponentInitializationException {
-        super.doInitialize();
-
-        if (clientInformationManager == null) {
-            throw new ComponentInitializationException("ClientInformationManager cannot be null");
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
-        if (!super.doPreExecute(profileRequestContext)) {
-            return false;
-        }
-
-        final RelyingPartyTrustChainContext trustChainContext =
-                trustChainContextLookupStrategy.apply(profileRequestContext);
-        if (trustChainContext == null || trustChainContext.getSelectedTrustChain() == null) {
-            log.error("{} Unable to locate selected trust chain", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MSG_CTX);
-            return false;
-        }
-
-        final OIDCClientMetadata metadata = selectedMetadataLookupStrategy.apply(profileRequestContext);
-        if (metadata == null) {
-            log.error("{} Unable to parse the RP metadata for storing", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MSG_CTX);
-            return false;
-        }
-
-        final VerifiedTrustChain selectedTrustChain = trustChainContext.getSelectedTrustChain();
-        assert selectedTrustChain != null;
-
-        clientInformation = new OIDCClientInformation(
-                new ClientID(selectedTrustChain.getTrustChain().get(0).getSubject()), metadata);
-
-        expiration = trustChainContext.getSelectedMetadataExpiration();
-        if (expiration == null) {
-            log.error("{} Unable to resolve expiration time for the selected metadata", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MSG_CTX);
-            return false;
-        }
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
-        log.debug("{} Storing automatically registered client information", getLogPrefix());
-
-        try {
-            log.debug("{} Registration will expire on {}", getLogPrefix(), expiration);
-            assert clientInformation != null;
-            clientInformationManager.storeClientInformation(clientInformation, expiration, true);               
-        } catch (final ClientInformationManagerException e) {
-            log.error("{} Could not store the client information", getLogPrefix(), e);
-            ActionSupport.buildEvent(profileRequestContext, EventIds.IO_ERROR);
-            return;
-        }
-        log.info("{} Client information successfully stored for {}", getLogPrefix(), 
-                clientInformation.getID().getValue());
-    }
-}
\ 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