[java-idp-plugin-vci] branch dev/DID_WEB_REVIEW updated: did:web identifier, host to lowercase

Codeberg noreply at shibboleth.net
Fri Nov 6 09:29:59 UTC 2026


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

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

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

The following commit(s) were added to refs/heads/dev/DID_WEB_REVIEW by this push:
     new 4db329c  did:web identifier, host to lowercase
4db329c is described below

commit 4db329c508ff67efd3bbe2fe4168eba7c24a0342
Author: Janne Lauros <janne.lauros at csc.fi>
AuthorDate: Fri Nov 6 11:29:45 2026 +0200

    did:web identifier, host to lowercase
---
 .../geant/shibboleth/plugin/openidvci/security/impl/DidSupport.java | 6 ++++--
 .../shibboleth/plugin/openidvci/security/impl/DidSupportTest.java   | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupport.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupport.java
index e1830da..1662aa1 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupport.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupport.java
@@ -22,6 +22,7 @@ import java.security.PrivateKey;
 import java.security.PublicKey;
 import java.security.interfaces.ECPublicKey;
 import java.text.ParseException;
+import java.util.Locale;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -97,7 +98,7 @@ public final class DidSupport {
 
     /**
      * Derive the did:web identifier of a deployment from the url it is reached at.
-     * Only the host is taken, a path is dropped and a port is encoded.
+     * Only the host is taken, in lower case, a path is dropped and a port is encoded.
      *
      * @param deploymentIssuer url of this deployment
      * @return the did:web identifier, or null if the url names no host
@@ -122,7 +123,8 @@ public final class DidSupport {
         }
 
         final int port = uri.getPort();
-        return port == -1 ? DID_WEB_PREFIX + host : DID_WEB_PREFIX + host + ENCODED_PORT_SEPARATOR + port;
+        final String name = host.toLowerCase(Locale.ROOT);
+        return port == -1 ? DID_WEB_PREFIX + name : DID_WEB_PREFIX + name + ENCODED_PORT_SEPARATOR + port;
     }
 
     /**
diff --git a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupportTest.java b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupportTest.java
index 3791d70..c43aa0a 100644
--- a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupportTest.java
+++ b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/security/impl/DidSupportTest.java
@@ -121,6 +121,7 @@ public class DidSupportTest {
             { "https://example.org/idp/path", "did:web:example.org" },
             { "https://example.org:8443", "did:web:example.org%3A8443" },
             { "https://example.org:8443/idp", "did:web:example.org%3A8443" },
+            { "https://Example.ORG/idp", "did:web:example.org" },
             { null, null },
             { "", null },
             { "not a url", null },

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


More information about the commits mailing list