[java-idp-plugin-vci] branch bugs/LowHanging updated: Implement sending of multiple credentials in response. Rename crendential -> credentials where applicable. Loose credential naming refferring to version

Codeberg noreply at shibboleth.net
Mon Sep 21 10:56:56 UTC 2026


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

codeberg pushed a commit to branch bugs/LowHanging
in repository java-idp-plugin-vci.

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

The following commit(s) were added to refs/heads/bugs/LowHanging by this push:
     new f4a30e8  Implement sending of multiple credentials in response. Rename crendential -> credentials where applicable. Loose credential naming refferring to version
f4a30e8 is described below

commit f4a30e89800a80d0b50247bba90cb938e094d39c
Author: Janne Lauros <janne.lauros at csc.fi>
AuthorDate: Mon Sep 21 13:56:46 2026 +0300

    Implement sending of multiple credentials in response. Rename crendential -> credentials where applicable. Loose credential naming refferring to version
---
 .../messaging/context/CredentialsContext.java      | 36 +++++++++++-----------
 .../messaging/impl/CredentialSuccessResponse.java  | 24 ++++++++-------
 .../FormOutboundCredentialsResponseMessage.java    |  4 +--
 .../openidvci/profile/impl/SignJWTCredential.java  |  4 +--
 4 files changed, 35 insertions(+), 33 deletions(-)

diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/context/CredentialsContext.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/context/CredentialsContext.java
index ae84095..7b008a5 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/context/CredentialsContext.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/context/CredentialsContext.java
@@ -66,13 +66,13 @@ public class CredentialsContext extends BaseContext {
     @Nullable
     private List<ClaimsSet> credentialShells;
 
-    /** JWT based credential per proof ready to be signed. */
+    /** JWT based credentials per proof ready to be signed. */
     @Nullable
-    private List<JWTClaimsSet> jwtCredential = new ArrayList<>();
+    private List<JWTClaimsSet> jwtCredentials = new ArrayList<>();
 
-    /** Per proof signed credential. */
+    /** Per proof signed credentials. */
     @Nullable
-    private List<String> signedJWTCredential;
+    private List<String> signedJWTCredentials;
 
     /** Disclosures of JWT based credential. */
     @Nullable
@@ -239,22 +239,22 @@ public class CredentialsContext extends BaseContext {
     }
 
     /**
-     * Get JWT based credential per proof ready to be signed.
+     * Get JWT based credentials per proof ready to be signed.
      * 
-     * @return JWT based credential per proof ready to be signed
+     * @return JWT based credentials per proof ready to be signed
      */
     @Nullable
     public List<JWTClaimsSet> getJWTCredentials() {
-        return jwtCredential;
+        return jwtCredentials;
     }
 
     /**
-     * Set JWT based credential per proof ready to be signed.
+     * Set JWT based credentials per proof ready to be signed.
      * 
-     * @param credentials JWT based credential per proof ready to be signed
+     * @param credentials JWT based credentials per proof ready to be signed
      */
     public void setJWTCredentials(final List<JWTClaimsSet> credentials) {
-        this.jwtCredential = credentials;
+        this.jwtCredentials = credentials;
     }
 
     /**
@@ -276,23 +276,23 @@ public class CredentialsContext extends BaseContext {
     }
 
     /**
-     * Get per proof signed credential.
+     * Get per proof signed credentials.
      * 
-     * @return Per proof signed credential
+     * @return Per proof signed credentials
      */
     @Nullable
-    public List<String> getSignedCredential() {
-        return signedJWTCredential;
+    public List<String> getSignedCredentials() {
+        return signedJWTCredentials;
     }
 
     /**
-     * Set per proof signed credential.
+     * Set per proof signed credentials.
      * 
-     * @param signedCredential Per proof signed credential
+     * @param signedCredentials Per proof signed credentials
      */
     @Nullable
-    public void setSignedCredential(final List<String> signedCredential) {
-        this.signedJWTCredential = signedCredential;
+    public void setSignedCredentials(final List<String> signedCredentials) {
+        this.signedJWTCredentials = signedCredentials;
     }
 
 }
\ No newline at end of file
diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/impl/CredentialSuccessResponse.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/impl/CredentialSuccessResponse.java
index 8775a31..d4ebd46 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/impl/CredentialSuccessResponse.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/messaging/impl/CredentialSuccessResponse.java
@@ -35,30 +35,32 @@ import com.nimbusds.oauth2.sdk.http.HTTPResponse;
 /**
  * https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-credential-response
  * 
- * Forms a credential response. Now a mix of specifications v14 and v15.
+ * Forms a credential response.
  *
  */
 public class CredentialSuccessResponse implements SuccessResponse {
 
-    /** v15 credentials parameter. */
+    /** credentials parameter. */
     @JsonProperty("credentials")
     private final List<Map<String, String>> credentials = new ArrayList<Map<String, String>>();
 
     /**
      * Constructor. TODO: No safeguards in place. Add when finalized.
      * 
-     * @param credentialv15 v15 credentials parameter
+     * @param credentialList credentials parameter
      */
-    public CredentialSuccessResponse(@Nullable final List<String> credentialv15) {
-        final Map<String, String> cred = new HashMap<String, String>();
-        credentialv15.forEach(credential -> cred.put("credential", credential));
-        credentials.add(cred);
+    public CredentialSuccessResponse(@Nullable final List<String> credentialList) {
+        credentialList.forEach(credential -> {
+            final Map<String, String> cred = new HashMap<String, String>();
+            cred.put("credential", credential);
+            credentials.add(cred);
+        });
     }
 
     /**
-     * Get v15 credentials parameter.
+     * Get credentials parameter.
      * 
-     * @return v15 credentials parameter
+     * @return credentials parameter
      */
     public List<Map<String, String>> getCredentials() {
         return credentials;
@@ -70,7 +72,7 @@ public class CredentialSuccessResponse implements SuccessResponse {
      * @return this response as a json string
      * @throws JsonProcessingException if serialization fails
      */
-    public String toOffer() throws JsonProcessingException {
+    public String toJSONString() throws JsonProcessingException {
         final ObjectMapper objectMapper = new ObjectMapper();
         return objectMapper.writeValueAsString(this);
     }
@@ -91,7 +93,7 @@ public class CredentialSuccessResponse implements SuccessResponse {
 
         httpResponse.setHeader("Date", DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.now()));
         try {
-            httpResponse.setContent(toOffer());
+            httpResponse.setContent(toJSONString());
         } catch (final JsonProcessingException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/FormOutboundCredentialsResponseMessage.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/FormOutboundCredentialsResponseMessage.java
index 9d043f9..4d678c0 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/FormOutboundCredentialsResponseMessage.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/FormOutboundCredentialsResponseMessage.java
@@ -77,11 +77,11 @@ public class FormOutboundCredentialsResponseMessage extends AbstractOIDCResponse
         }
         try {
             final List<String> credentials = new ArrayList<>();
-            ctx.getSignedCredential().forEach(cred -> {
+            ctx.getSignedCredentials().forEach(cred -> {
                 credentials.add(cred + (ctx.getDisclosures() != null ? "~" + ctx.getDisclosures() + "~" : ""));
             });
             final CredentialSuccessResponse response = new CredentialSuccessResponse(credentials);
-            log.info("Setting response as {}", response.toOffer());
+            log.info("Setting response as {}", response.toJSONString());
             profileRequestContext.ensureOutboundMessageContext().setMessage(response);
         } catch (final JsonProcessingException e) {
             log.error("{} Error occurred while parsing objects {}", getLogPrefix(), e);
diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/SignJWTCredential.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/SignJWTCredential.java
index abfba63..6d86ceb 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/SignJWTCredential.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/profile/impl/SignJWTCredential.java
@@ -50,7 +50,7 @@ import com.nimbusds.jwt.JWTClaimsSet;
 /**
  * Action that signs all jwt verifiable credentials
  * {@link CredentialsContext#getJWTCredentials} storing the result to
- * {@link CredentialsContext#setSignedCredential}.
+ * {@link CredentialsContext#setSignedCredentials}.
  */
 public class SignJWTCredential extends AbstractOIDCResponseAction {
 
@@ -172,7 +172,7 @@ public class SignJWTCredential extends AbstractOIDCResponseAction {
                 return;
             }
         }
-        ctx.setSignedCredential(credentials);
+        ctx.setSignedCredentials(credentials);
         log.info("Signed {} credentials", credentials.size());
     }
 

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


More information about the commits mailing list