[java-idp-plugin-vci] 02/02: Renamed
Codeberg
noreply at shibboleth.net
Fri Dec 5 08:28:01 UTC 2025
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch dev/AUTHZ_DETAILS_TO_OWN_CLAIM
in repository java-idp-plugin-vci.
View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-vci/commit/fae08917b48e6a3a35571da24a3f5cc202a6c53e
commit fae08917b48e6a3a35571da24a3f5cc202a6c53e
Author: jlauros <janne.lauros at csc.fi>
AuthorDate: Fri Dec 5 10:27:39 2025 +0200
Renamed
---
.../AuthorizationCodeManipulationStrategy.java | 96 ----------------------
1 file changed, 96 deletions(-)
diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/logic/AuthorizationCodeManipulationStrategy.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/logic/AuthorizationCodeManipulationStrategy.java
deleted file mode 100644
index 40f58a6..0000000
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/logic/AuthorizationCodeManipulationStrategy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2025, GÉANT
- *
- * 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 org.geant.shibboleth.plugin.openidvci.profile.logic;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-
-import javax.annotation.Nonnull;
-
-import org.geant.shibboleth.plugin.openidvci.messaging.context.navigate.AuthorizationDetailsLookupFunction;
-import org.geant.shibboleth.plugin.openidvci.messaging.impl.OpenIDVCIAuthorizationDetail;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.slf4j.Logger;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.nimbusds.oauth2.sdk.AuthorizationRequest;
-
-import net.shibboleth.idp.plugin.oidc.op.token.support.TokenClaimsSet;
-import net.shibboleth.shared.logic.Constraint;
-import net.shibboleth.shared.primitive.LoggerFactory;
-
-public class AuthorizationCodeManipulationStrategy
- implements BiFunction<ProfileRequestContext, Map<String, Object>, Map<String, Object>> {
-
- /** Class logger. */
- @Nonnull
- private Logger log = LoggerFactory.getLogger(AuthorizationCodeManipulationStrategy.class);
-
- /** Strategy used to locate the {@link OpenIDVCIAuthorizationDetail} to use. */
- @Nonnull
- private Function<ProfileRequestContext, List<OpenIDVCIAuthorizationDetail>> authorizationDetailsStrategy;
-
- /**
- * Set the strategy used to locate the {@link OpenIDVCIAuthorizationDetail} to
- * use.
- *
- * @param strategy lookup strategy
- */
- public void setAuthorizationDetailsLookupStrategy(
- @Nonnull final Function<ProfileRequestContext, List<OpenIDVCIAuthorizationDetail>> strategy) {
- authorizationDetailsStrategy = Constraint.isNotNull(strategy,
- "AuthorizationDetailsLookupStrategy lookup strategy cannot be null");
- }
-
- /**
- * Constructor.
- */
- public AuthorizationCodeManipulationStrategy() {
- authorizationDetailsStrategy = new AuthorizationDetailsLookupFunction();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Map<String, Object> apply(ProfileRequestContext profileRequestContext, Map<String, Object> claims) {
- if (profileRequestContext.getInboundMessageContext().getMessage() instanceof AuthorizationRequest request) {
- try {
- List<OpenIDVCIAuthorizationDetail> details = OpenIDVCIAuthorizationDetail
- .parse(request.toHTTPRequest());
- if (details == null) {
- return null;
- }
- Map<String, Object> userInfoClaims;
- if (claims.get(TokenClaimsSet.KEY_DELIVERY_CLAIMS_USERINFO) instanceof Map<?, ?> map) {
- userInfoClaims = (Map<String, Object>) map;
- } else {
- userInfoClaims = new HashMap<>();
- }
- // TODO: naming scheme for internal delivery claims
- userInfoClaims.put("vci.int.authorizationDetails", new ObjectMapper().writeValueAsString(details));
- claims.put(TokenClaimsSet.KEY_DELIVERY_CLAIMS_USERINFO, userInfoClaims);
- return claims;
- } catch (JsonProcessingException e) {
- log.warn("{} Failed parsing", e);
- }
- }
- return null;
- }
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list