chore: update version to 2.0.1-SNAPSHOT and modify changelog for UmaTokenSecret audience enforcement

This commit is contained in:
Luca Frosini 2026-04-29 11:57:03 +02:00
parent 61d22993c8
commit 85696aaa39
4 changed files with 10 additions and 6 deletions

View File

@ -2,7 +2,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for GCube Secrets
## [v2.0.1]
## [v2.0.1-SNAPSHOT]
- `UmaTokenSecret` now enforces a single-value audience (`aud`) claim in JWTs, rejecting tokens with multiple audiences. [#31139]

View File

@ -2,7 +2,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for GCube Secrets
## [v2.0.1]
## [v2.0.1-SNAPSHOT]
- `UmaTokenSecret` now enforces a single-value audience (`aud`) claim in JWTs, rejecting tokens with multiple audiences. [#31139]

View File

@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.common.security</groupId>
<artifactId>gcube-secrets</artifactId>
<version>2.0.1</version>
<version>2.0.1-SNAPSHOT</version>
<name>GCube Secrets</name>
<description>Library for managing secrets and security tokens in gCube applications</description>
<properties>
@ -86,7 +86,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>4.0.1</version>
<version>4.0.3-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.Map;
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
import org.gcube.common.authorization.library.exception.AuthorizationException;
import org.gcube.common.iam.D4ScienceJWTObject;
import org.gcube.common.iam.OIDCBearerAuth;
import org.gcube.common.security.Owner;
@ -86,7 +87,7 @@ public class UmaTokenSecret extends Secret {
String audience[] = this.accessToken.getAudience();
if (audience.length !=1) {
throw new RuntimeException("Invalid audience in access token: " + String.join(",", audience));
throw new AuthorizationException("Invalid multi-context token: " + String.join(",", audience));
}
owner = new Owner(
@ -104,7 +105,10 @@ public class UmaTokenSecret extends Secret {
initialised = true;
} catch (Exception e) {
throw new RuntimeException(e);
if (e instanceof AuthorizationException) {
throw (AuthorizationException) e;
}
throw new AuthorizationException(e);
}
}