[java-idp-plugin-vci] 01/01: Status-list revoke flow, OP conventions, client auth required, auth errors, shared store
Codeberg
noreply at shibboleth.net
Tue Nov 10 07:36:28 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch dev/REVIEWREVOKE
in repository java-idp-plugin-vci.
View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-vci/commit/7d70d8436eb616e0a355ef292417519fc1b1b52a
commit 7d70d8436eb616e0a355ef292417519fc1b1b52a
Author: Janne Lauros <janne.lauros at csc.fi>
AuthorDate: Tue Nov 10 09:36:01 2026 +0200
Status-list revoke flow, OP conventions, client auth required, auth errors, shared store
---
README.md | 1 -
.../messaging/impl/StatusListRevokeRequest.java | 25 +------
.../impl/DefaultStatusListRevokeConfiguration.java | 5 ++
.../META-INF/net.shibboleth.idp/postconfig.xml | 5 ++
.../flows/oauth/status-list/list/list-beans.xml | 6 --
.../oauth/status-list/revoke/revoke-beans.xml | 30 +++++---
.../impl/StatusListRevokeRequestTest.java | 85 ++++++++++++++++++++++
.../DefaultStatusListRevokeConfigurationTest.java | 47 ++++++++++++
8 files changed, 167 insertions(+), 37 deletions(-)
diff --git a/README.md b/README.md
index e350ff9..6a7f82d 100644
--- a/README.md
+++ b/README.md
@@ -4830,7 +4830,6 @@ Request, a `POST` of `application/json`, success is `204 No Content`:
|---|---|---|
| `id` | String | The month, `uuuu-MM`, with or without the issuer tag. |
| `idx` | Integer | The slot, `0` to `1048575`. |
-| `client_id` | String | Only where unauthenticated callers are accepted. |
The `scope` of the client does not limit the slots it may revoke.
diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/messaging/impl/StatusListRevokeRequest.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/messaging/impl/StatusListRevokeRequest.java
index eb86372..e43d2af 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/messaging/impl/StatusListRevokeRequest.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/messaging/impl/StatusListRevokeRequest.java
@@ -34,7 +34,6 @@ import com.nimbusds.oauth2.sdk.OAuth2Error;
import com.nimbusds.oauth2.sdk.ParseException;
import com.nimbusds.oauth2.sdk.auth.ClientAuthentication;
import com.nimbusds.oauth2.sdk.http.HTTPRequest;
-import com.nimbusds.oauth2.sdk.id.ClientID;
/**
* Request to revoke one slot of a status list, as in
@@ -61,16 +60,6 @@ public class StatusListRevokeRequest extends AbstractOptionallyIdentifiedRequest
super(uri, clientAuthentication);
}
- /**
- * Constructor for a request identifying its client without authenticating.
- *
- * @param uri endpoint the request was made to
- * @param clientId client identifier
- */
- protected StatusListRevokeRequest(@Nullable final URI uri, @Nonnull final ClientID clientId) {
- super(uri, clientId);
- }
-
/**
* Get identifier of the list holding the slot.
*
@@ -150,17 +139,11 @@ public class StatusListRevokeRequest extends AbstractOptionallyIdentifiedRequest
throw new ParseException(e.getMessage(), e);
}
- final StatusListRevokeRequest request;
- if (clientAuthentication != null) {
- request = new StatusListRevokeRequest(uri, clientAuthentication);
- } else {
- final Object clientId = payload.get("client_id");
- if (!(clientId instanceof String value) || value.isEmpty()) {
- throw new ParseException("Missing client authentication",
- OAuth2Error.INVALID_CLIENT.appendDescription(": no client authentication or client_id"));
- }
- request = new StatusListRevokeRequest(uri, new ClientID(value));
+ if (clientAuthentication == null) {
+ throw new ParseException("Missing client authentication",
+ OAuth2Error.INVALID_CLIENT.appendDescription(": no client authentication"));
}
+ final StatusListRevokeRequest request = new StatusListRevokeRequest(uri, clientAuthentication);
if (!(payload.get(StatusListParameters.BUCKET_PARAMETER) instanceof String listId) || listId.isEmpty()) {
throw new ParseException("Missing " + StatusListParameters.BUCKET_PARAMETER, OAuth2Error.INVALID_REQUEST
diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/profile/config/impl/DefaultStatusListRevokeConfiguration.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/profile/config/impl/DefaultStatusListRevokeConfiguration.java
index 9a42ec5..05e0bdb 100644
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/profile/config/impl/DefaultStatusListRevokeConfiguration.java
+++ b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/statuslist/profile/config/impl/DefaultStatusListRevokeConfiguration.java
@@ -33,6 +33,11 @@ public class DefaultStatusListRevokeConfiguration extends AbstractOpenIDVCIConfi
@NotEmpty
public static final String PROFILE_ID = "http://geant.org/ns/profiles/oauth/status-list/revoke";
+ /** Status list revocation profile counter name. */
+ @Nonnull
+ @NotEmpty
+ public static final String PROFILE_COUNTER = "net.shibboleth.idp.profiles.oauth.status-list.revoke";
+
/** Constructor. */
public DefaultStatusListRevokeConfiguration() {
super(PROFILE_ID);
diff --git a/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
index ec824ab..634e969 100644
--- a/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
+++ b/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -49,6 +49,11 @@
lazy-init="true" depends-on="shibboleth.LoggingService"
p:storage-ref="#{'%{openidvci.StorageService:shibboleth.StorageService}'.trim()}" />
+ <bean id="openidvci.status-list.Store" class="org.geant.shibboleth.plugin.openidvci.statuslist.storage.StatusListStore"
+ lazy-init="true" depends-on="shibboleth.LoggingService"
+ p:id="openidvci.status-list.Store"
+ p:storage-ref="#{'%{openidvci.status-list.StorageService:shibboleth.StorageService}'.trim()}" />
+
<bean id="openidvci.DefaultAttestationTrustEvaluator" lazy-init="true"
class="org.opensaml.security.x509.impl.CertPathPKIXTrustEvaluator">
<property name="pKIXValidationOptions">
diff --git a/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/list/list-beans.xml b/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/list/list-beans.xml
index 5927f0b..a47ff06 100644
--- a/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/list/list-beans.xml
+++ b/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/list/list-beans.xml
@@ -41,12 +41,6 @@
p:issuer="%{openidvci.issuer:}"
p:deploymentIssuer="#{getObject('shibboleth.oidc.issuer')}" />
- <bean id="openidvci.status-list.Store"
- class="org.geant.shibboleth.plugin.openidvci.statuslist.storage.StatusListStore"
- depends-on="shibboleth.LoggingService"
- p:id="openidvci.status-list.Store"
- p:storage-ref="#{'%{openidvci.status-list.StorageService:shibboleth.StorageService}'.trim()}" />
-
<bean id="FormStatusListToken"
class="org.geant.shibboleth.plugin.openidvci.statuslist.profile.impl.FormStatusListToken"
scope="prototype"
diff --git a/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/revoke/revoke-beans.xml b/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/revoke/revoke-beans.xml
index a845a06..febb71e 100644
--- a/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/revoke/revoke-beans.xml
+++ b/openid-vci-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth/status-list/revoke/revoke-beans.xml
@@ -12,9 +12,11 @@
default-init-method="initialize" default-destroy-method="destroy">
<bean id="openidvci.profileId" class="java.lang.String"
- c:_0="http://geant.org/ns/profiles/oauth/status-list/revoke"/>
+ c:_0="#{T(org.geant.shibboleth.plugin.openidvci.statuslist.profile.config.impl.DefaultStatusListRevokeConfiguration).PROFILE_ID}"/>
<bean id="openidvci.loggingId" class="java.lang.String"
c:_0="%{openidvci.logging.status-list.revoke:OAuth.StatusList.Revoke}"/>
+ <util:constant id="shibboleth.metrics.ProfileCounter"
+ static-field="org.geant.shibboleth.plugin.openidvci.statuslist.profile.config.impl.DefaultStatusListRevokeConfiguration.PROFILE_COUNTER"/>
<bean id="OpenIDVCIDecodeMessage" class="org.opensaml.profile.action.impl.DecodeMessage" scope="prototype">
<constructor-arg>
@@ -30,12 +32,6 @@
<bean id="shibboleth.ClientIDLookupStrategy"
class="net.shibboleth.idp.plugin.oidc.op.messaging.context.navigate.TokenRequestClientIDLookupFunction" />
- <bean id="openidvci.status-list.Store"
- class="org.geant.shibboleth.plugin.openidvci.statuslist.storage.StatusListStore"
- depends-on="shibboleth.LoggingService"
- p:id="openidvci.status-list.Store"
- p:storage-ref="#{'%{openidvci.status-list.StorageService:shibboleth.StorageService}'.trim()}" />
-
<bean id="RevokeStatusListIndex"
class="org.geant.shibboleth.plugin.openidvci.statuslist.profile.impl.RevokeStatusListIndex"
scope="prototype"
@@ -53,8 +49,24 @@
</property>
<property name="mappedErrors">
<map value-type="com.nimbusds.oauth2.sdk.ErrorObject">
- <entry key="#{T(org.opensaml.profile.action.EventIds).INVALID_MSG_CTX}"
- value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_REQUEST}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).AUTHN_EXCEPTION}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).SUBJECT_C14N_ERROR}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).UNKNOWN_USERNAME}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).NO_CREDENTIALS}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).INVALID_CREDENTIALS}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).ACCOUNT_LOCKED}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).ACCOUNT_ERROR}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).RESELECT_FLOW}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
+ <entry key="#{T(net.shibboleth.idp.authn.AuthnEventIds).NO_POTENTIAL_FLOW}"
+ value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
<entry key="#{T(org.opensaml.profile.action.EventIds).ACCESS_DENIED}"
value="#{T(com.nimbusds.oauth2.sdk.OAuth2Error).INVALID_CLIENT}" />
<!-- Storage refused the write, so the slot is not revoked and the caller has to retry. -->
diff --git a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/statuslist/messaging/impl/StatusListRevokeRequestTest.java b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/statuslist/messaging/impl/StatusListRevokeRequestTest.java
new file mode 100644
index 0000000..6716b51
--- /dev/null
+++ b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/statuslist/messaging/impl/StatusListRevokeRequestTest.java
@@ -0,0 +1,85 @@
+/*
+ * 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.statuslist.messaging.impl;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import com.nimbusds.oauth2.sdk.OAuth2Error;
+import com.nimbusds.oauth2.sdk.ParseException;
+import com.nimbusds.oauth2.sdk.http.HTTPRequest;
+
+/** Tests for {@link StatusListRevokeRequest}. */
+public class StatusListRevokeRequestTest {
+
+ private static HTTPRequest request(final String authorization, final String body)
+ throws URISyntaxException, ParseException {
+ final HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.POST, new URI("http://example.com"));
+ if (authorization != null) {
+ httpRequest.setAuthorization(authorization);
+ }
+ httpRequest.setContentType("application/json");
+ httpRequest.setBody(body);
+ return httpRequest;
+ }
+
+ @Test
+ public void testAuthenticated() throws Exception {
+ final StatusListRevokeRequest request =
+ StatusListRevokeRequest.parse(request("Basic dGVzdDp0ZXN0", "{\"id\": \"2027-03\", \"idx\": 41337}"));
+
+ Assert.assertEquals(request.getClientAuthentication().getClientID().getValue(), "test");
+ Assert.assertEquals(request.getId(), "2027-03");
+ Assert.assertEquals(request.getIndex(), 41337L);
+ }
+
+ @Test
+ public void testNoClientAuthentication() throws Exception {
+ final ParseException e = Assert.expectThrows(ParseException.class,
+ () -> StatusListRevokeRequest.parse(request(null, "{\"id\": \"2027-03\", \"idx\": 41337}")));
+
+ Assert.assertEquals(e.getErrorObject().getCode(), OAuth2Error.INVALID_CLIENT.getCode());
+ }
+
+ @Test
+ public void testClientIdIsNotClientAuthentication() throws Exception {
+ final ParseException e = Assert.expectThrows(ParseException.class, () -> StatusListRevokeRequest
+ .parse(request(null, "{\"client_id\": \"test\", \"id\": \"2027-03\", \"idx\": 41337}")));
+
+ Assert.assertEquals(e.getErrorObject().getCode(), OAuth2Error.INVALID_CLIENT.getCode());
+ }
+
+ @Test
+ public void testMissingId() throws Exception {
+ final ParseException e = Assert.expectThrows(ParseException.class,
+ () -> StatusListRevokeRequest.parse(request("Basic dGVzdDp0ZXN0", "{\"idx\": 41337}")));
+
+ Assert.assertEquals(e.getErrorObject().getCode(), OAuth2Error.INVALID_REQUEST.getCode());
+ }
+
+ @Test
+ public void testIndexNotInteger() throws Exception {
+ final ParseException e = Assert.expectThrows(ParseException.class, () -> StatusListRevokeRequest
+ .parse(request("Basic dGVzdDp0ZXN0", "{\"id\": \"2027-03\", \"idx\": 1.5}")));
+
+ Assert.assertEquals(e.getErrorObject().getCode(), OAuth2Error.INVALID_REQUEST.getCode());
+ }
+
+}
diff --git a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/statuslist/profile/config/impl/DefaultStatusListRevokeConfigurationTest.java b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/statuslist/profile/config/impl/DefaultStatusListRevokeConfigurationTest.java
new file mode 100644
index 0000000..4e80948
--- /dev/null
+++ b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/statuslist/profile/config/impl/DefaultStatusListRevokeConfigurationTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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.statuslist.profile.config.impl;
+
+import java.util.List;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/** Tests for {@link DefaultStatusListRevokeConfiguration}. */
+public class DefaultStatusListRevokeConfigurationTest {
+
+ @Test
+ public void testId() {
+ Assert.assertEquals(new DefaultStatusListRevokeConfiguration().getId(),
+ "http://geant.org/ns/profiles/oauth/status-list/revoke");
+ }
+
+ @Test
+ public void testCounter() {
+ Assert.assertEquals(DefaultStatusListRevokeConfiguration.PROFILE_COUNTER,
+ "net.shibboleth.idp.profiles.oauth.status-list.revoke");
+ }
+
+ @Test
+ public void testNoInterceptorFlowsByDefault() {
+ final DefaultStatusListRevokeConfiguration configuration = new DefaultStatusListRevokeConfiguration();
+
+ Assert.assertEquals(configuration.getInboundInterceptorFlows(null), List.of());
+ Assert.assertEquals(configuration.getOutboundInterceptorFlows(null), List.of());
+ }
+
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list