[java-idp-plugin-vci] branch dev/REVIEWOFFERCALLERFLOW updated: credential offer scope validation, per-request context nullable, tests

Codeberg noreply at shibboleth.net
Mon Nov 16 09:52:46 UTC 2026


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

codeberg pushed a commit to branch dev/REVIEWOFFERCALLERFLOW
in repository java-idp-plugin-vci.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-vci/commit/314d1b6b4ec254cfb09467f01fdb85de8c2a9880

The following commit(s) were added to refs/heads/dev/REVIEWOFFERCALLERFLOW by this push:
     new 314d1b6  credential offer scope validation, per-request context nullable, tests
314d1b6 is described below

commit 314d1b6b4ec254cfb09467f01fdb85de8c2a9880
Author: Janne Lauros <janne.lauros at csc.fi>
AuthorDate: Mon Nov 16 11:52:23 2026 +0200

    credential offer scope validation, per-request context nullable, tests
---
 .../profile/impl/ValidateCredentialOfferScope.java     |  4 ++--
 .../profile/impl/ValidateCredentialOfferScopeTest.java | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScope.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScope.java
index 33d54c9..76397c9 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScope.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScope.java
@@ -20,6 +20,7 @@ import java.util.Set;
 import java.util.function.Function;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import org.geant.shibboleth.plugin.openidvci.messaging.context.CredentialOfferContext;
 import org.opensaml.profile.action.ActionSupport;
@@ -31,7 +32,6 @@ import net.shibboleth.idp.profile.AbstractProfileAction;
 import net.shibboleth.oidc.profile.core.OidcEventIds;
 import net.shibboleth.profile.context.navigate.RelyingPartyIdLookupFunction;
 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;
@@ -58,7 +58,7 @@ public class ValidateCredentialOfferScope extends AbstractProfileAction {
     private Function<ProfileRequestContext, Set<String>> allowedCredentialConfigurationsLookupStrategy;
 
     /** Context of the Credential Offer. */
-    @NonnullBeforeExec
+    @Nullable
     private CredentialOfferContext ctx;
 
     /** Constructor. */
diff --git a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScopeTest.java b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScopeTest.java
index f0b15f3..9038246 100644
--- a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScopeTest.java
+++ b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/profile/impl/ValidateCredentialOfferScopeTest.java
@@ -97,4 +97,22 @@ public class ValidateCredentialOfferScopeTest {
         ActionTestingSupport.assertEvent(event, EventIds.INVALID_PROFILE_CTX);
     }
 
+    @Test
+    public void testNoInboundMessageContext() throws Exception {
+        profileRequestCtx.setInboundMessageContext(null);
+        action.setAllowedCredentialConfigurationsLookupStrategy(prc -> null);
+        action.initialize();
+        final Event event = action.execute(requestCtx);
+        ActionTestingSupport.assertEvent(event, EventIds.INVALID_PROFILE_CTX);
+    }
+
+    @Test
+    public void testNoValidatedCredentials() throws Exception {
+        profileRequestCtx.getInboundMessageContext().addSubcontext(new CredentialOfferContext(), true);
+        action.setAllowedCredentialConfigurationsLookupStrategy(prc -> null);
+        action.initialize();
+        final Event event = action.execute(requestCtx);
+        ActionTestingSupport.assertEvent(event, EventIds.INVALID_PROFILE_CTX);
+    }
+
 }

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


More information about the commits mailing list