From 29a84d50b704a432afc379827b4b4b5049c2a3b4 Mon Sep 17 00:00:00 2001 From: "bilal.ashraf" Date: Sat, 25 Oct 2025 00:44:47 +0500 Subject: [PATCH 01/52] tsl support in progress --- .idea/.gitignore | 3 + .idea/compiler.xml | 13 ++ .idea/encodings.xml | 7 + .idea/jarRepositories.xml | 20 +++ .idea/misc.xml | 12 ++ .idea/vcs.xml | 6 + pom.xml | 48 ++++--- .../dto/CredentialDeferredIssueRequest.java | 35 +++++ .../dto/CredentialDeferredIssueResponse.java | 6 + .../java/com/authlete/common/dto/Service.java | 62 +++++++- .../authlete/common/dto/TslConfigData.java | 133 ++++++++++++++++++ .../common/types/TslPublishFormat.java | 113 +++++++++++++++ 12 files changed, 432 insertions(+), 26 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 src/main/java/com/authlete/common/dto/TslConfigData.java create mode 100644 src/main/java/com/authlete/common/types/TslPublishFormat.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..26d33521af --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000000..cca8335003 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000000..aa00ffab78 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000000..712ab9d985 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000..d31b37ac7b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..35eb1ddfbb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 24682b2364..eb186dee48 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,11 @@ com.authlete authlete-java-common +<<<<<<< HEAD 4.33-SNAPSHOT +======= + 4.21 +>>>>>>> b3dde3000 (tsl support in progress) jar ${project.groupId}:${project.artifactId} @@ -308,28 +312,28 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 3.1.0 - - - sign-artifacts - verify - - sign - - - E834481D - ${env.GPG_PASSPHRASE} - - --pinentry-mode - loopback - - - - - + + + + + + + + + + + + + + + + + + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java index 586316c0d6..669685ed92 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java @@ -78,6 +78,12 @@ public class CredentialDeferredIssueRequest implements Serializable private CredentialIssuanceOrder order; + /** + * The access token that came along with the deferred credential request. + */ + private String accessToken; + + /** * Get the credential order that provides an instruction for issuing a * credential. @@ -107,4 +113,33 @@ public CredentialDeferredIssueRequest setOrder(CredentialIssuanceOrder order) return this; } + + /** + * Get the access token that came along with the deferred credential request. + * + * @return + * The access token that the deferred credential endpoint received. + */ + public String getAccessToken() + { + return accessToken; + } + + + /** + * Set the access token that came along with the deferred credential request. + * + * @param accessToken + * The access token that the deferred credential endpoint received. + * + * @return + * {@code this} object. + */ + public CredentialDeferredIssueRequest setAccessToken(String accessToken) + { + this.accessToken = accessToken; + + return this; + } + } diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java index e22a1efb37..9f48159e53 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java @@ -222,6 +222,12 @@ public enum Action * The API call is invalid. */ CALLER_ERROR, + + /** + * The deferred credential request does not contain the access token or + * the access token is invalid. + */ + UNAUTHORIZED, } diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 2af8139bad..3c1da56887 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1960,6 +1960,26 @@ public class Service implements Serializable */ private boolean httpAliasProhibited; + /** + * The flag indicating whether the feature of Trust status list publishing for + * this service is enabled or not. + * + * @since TODO + * @since Authlete TODO + */ + private boolean tslPublishingEnabled; + + + /** + * Trust status list configuration data. + * + * @since TODO + * @since Authlete TODO + * + * @see + * Trust Status List + */ + private TslConfigData tslConfigData; /** * Get the service number. @@ -12097,7 +12117,6 @@ public Service setNativeSsoSupported(boolean supported) return this; } - /** * Get the version of the OpenID for Verifiable Credential Issuance * specification to support. @@ -12208,6 +12227,17 @@ public Service setOid4vciVersion(String version) return this; } + public Service setTslPublishingEnabled(boolean tslPublishingEnabled) + { + this.tslPublishingEnabled = tslPublishingEnabled; + + return this; + } + + public boolean isTslPublishingEnabled() + { + return tslPublishingEnabled; + } /** * Get the flag to determine to support + * Trust Status List + */ + public Service setTslConfigData(TslConfigData tslConfigData) + { + this.tslConfigData = tslConfigData; + + return this; + } /** * Get the flag that indicates whether the allowlist for client IDs @@ -12795,10 +12839,20 @@ public boolean isHttpAliasProhibited() * @see * OAuth Client ID Metadata Document */ - public Service setHttpAliasProhibited(boolean prohibited) - { + public Service setHttpAliasProhibited(boolean prohibited) { this.httpAliasProhibited = prohibited; return this; } + + /** + * Retrieves the {@link TslConfigData} associated with this service. + * + * @return the current {@link TslConfigData} + */ + public TslConfigData getTslConfigData() + { + return tslConfigData; + + } } diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java new file mode 100644 index 0000000000..94cb390d8f --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -0,0 +1,133 @@ +package com.authlete.common.dto; + +import com.authlete.common.types.TslPublishFormat; + +import java.io.Serializable; +import java.net.URI; + +/** + * A class that represents trust status list configurations data + * The set consists of the following. + * + *
    + *
  • {@code format} + *
  • {@code validity} + *
  • {@code publishFrequency} + *
  • {@code timeToLive} + *
  • {@code publishEndpoint} + *
+ * + * @since TODO + * @since Authlete TODO + * + * @see Token Status List (TSL) + */ +public class TslConfigData implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported + * + * @since TODO + */ + private TslPublishFormat format; + + /** + * The validity of the TSL in hours + * + * @since TODO + */ + private int validity; + + /** + * Publish TSL after every X hours + * + * @since TODO + */ + private int publishFrequency; + + /** + * Time to live in hours which provides indication to verifiers to cache this TSL + * + * @since TODO + */ + private int timeToLive; + + /** + * Endpoint where to publish this TSL + * + * @since TODO + */ + private URI publishEndpoint; + + /** + * The default constructor. + */ + public TslConfigData() { + } + + /** + * Copy constructor. + * + * @param tslConfigData + * Source to copy data from. {@code null} won't raise any exception. + */ + public TslConfigData(TslConfigData tslConfigData) { + if (tslConfigData == null) { + return; + } + format = tslConfigData.getFormat(); + validity = tslConfigData.getValidity(); + publishFrequency = tslConfigData.getPublishFrequency(); + timeToLive = tslConfigData.getTimeToLive(); + publishEndpoint = tslConfigData.getPublishEndpoint(); + } + + public TslConfigData setFormat(TslPublishFormat format) { + this.format = format; + + return this; + } + public TslPublishFormat getFormat() { + return format; + } + + public TslConfigData setValidity(int validity) { + this.validity = validity; + + return this; + } + public int getValidity() { + return validity; + } + + public TslConfigData setPublishFrequency(int publishFrequency) { + this.publishFrequency = publishFrequency; + + return this; + } + public int getPublishFrequency() { + return publishFrequency; + } + + public TslConfigData setTimeToLive(int timeToLive) { + this.timeToLive = timeToLive; + + return this; + } + public int getTimeToLive() { + return timeToLive; + } + + public TslConfigData setPublishEndpoint(URI publishEndpoint) { + this.publishEndpoint = publishEndpoint; + + return this; + } + public URI getPublishEndpoint() { + return publishEndpoint; + } +} + diff --git a/src/main/java/com/authlete/common/types/TslPublishFormat.java b/src/main/java/com/authlete/common/types/TslPublishFormat.java new file mode 100644 index 0000000000..d493a3ba5e --- /dev/null +++ b/src/main/java/com/authlete/common/types/TslPublishFormat.java @@ -0,0 +1,113 @@ +package com.authlete.common.types; + +import java.util.EnumSet; + +public enum TslPublishFormat { + + /** + * Currently jwt is supported. TSL publishing cwt format will be supported in the next iteration + */ + JWT((short)1, "jwt"); + + + private static final TslPublishFormat[] sValues = values(); + private static final TslPublishFormat.Helper sHelper = new TslPublishFormat.Helper(sValues); + private final short mValue; + private final String mString; + + + private TslPublishFormat(short value, String string) + { + mValue = value; + mString = string; + } + + + /** + * Get the integer representation of this enum instance. + */ + public short getValue() + { + return mValue; + } + + + /** + * Find an instance of this enum by a value. + * + * @param value + * The integer representation of the instance to find. + * + * @return + * An instance of this enum, or {@code null} if not found. + */ + public static TslPublishFormat getByValue(short value) + { + if (value < 1 || sValues.length < value) + { + // Not found. + return null; + } + + return sValues[value - 1]; + } + + + /** + * Get the string value of TSL publish format. + * + * @return + * A string that contains TSL publish format. + */ + public String getString() + { + return mString; + } + + + public static int toBits(EnumSet set) + { + return sHelper.toBits(set); + } + + + public static TslPublishFormat[] toArray(int bits) + { + return sHelper.toArray(bits); + } + + + public static EnumSet toSet(int bits) + { + return sHelper.toSet(bits); + } + + + public static EnumSet toSet(TslPublishFormat[] array) + { + return sHelper.toSet(array); + } + + + private static class Helper extends EnumHelper + { + public Helper(TslPublishFormat[] values) + { + super(TslPublishFormat.class, values); + } + + + @Override + protected short getValue(TslPublishFormat entry) + { + return entry.getValue(); + } + + + @Override + protected TslPublishFormat[] newArray(int size) + { + return new TslPublishFormat[size]; + } + } +} From 6ff5faab57e0884546047fe51105aeb1eaa58747 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Fri, 28 Nov 2025 17:59:44 +0500 Subject: [PATCH 02/52] tsl support --- pom.xml | 4 + .../java/com/authlete/common/dto/Service.java | 39 +++- .../authlete/common/dto/TslConfigData.java | 166 ++++++++++++++---- .../common/dto/TslEntriesResponse.java | 54 ++++++ .../com/authlete/common/dto/TslEntry.java | 57 ++++++ .../authlete/common/dto/TslGetRequest.java | 19 ++ .../authlete/common/dto/TslGetResponse.java | 28 +++ .../dto/TslPopulateUnusedIndexesRequest.java | 23 +++ .../authlete/common/dto/TslPublishConfig.java | 36 ++++ .../common/dto/TslPublishConfigsResponse.java | 21 +++ .../common/dto/TslPublishRequest.java | 19 ++ .../dto/TslTokenStatusUpdateRequest.java | 41 +++++ .../authlete/common/types/TslTokenStatus.java | 110 ++++++++++++ 13 files changed, 580 insertions(+), 37 deletions(-) create mode 100644 src/main/java/com/authlete/common/dto/TslEntriesResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslEntry.java create mode 100644 src/main/java/com/authlete/common/dto/TslGetRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslGetResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfig.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java create mode 100644 src/main/java/com/authlete/common/types/TslTokenStatus.java diff --git a/pom.xml b/pom.xml index eb186dee48..a058e7664b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,11 +4,15 @@ com.authlete authlete-java-common +<<<<<<< HEAD <<<<<<< HEAD 4.33-SNAPSHOT ======= 4.21 >>>>>>> b3dde3000 (tsl support in progress) +======= + 4.31 +>>>>>>> ef348607f (tsl support) jar ${project.groupId}:${project.artifactId} diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 3c1da56887..efb12275dd 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1964,19 +1964,19 @@ public class Service implements Serializable * The flag indicating whether the feature of Trust status list publishing for * this service is enabled or not. * - * @since TODO - * @since Authlete TODO + * @since 4.30 + * @since Authlete 3.1 */ private boolean tslPublishingEnabled; /** - * Trust status list configuration data. + * TSL configuration data. * - * @since TODO - * @since Authlete TODO + * @since 4.30 + * @since Authlete 3.1 * - * @see + * @see * Trust Status List */ private TslConfigData tslConfigData; @@ -12227,6 +12227,16 @@ public Service setOid4vciVersion(String version) return this; } + /* + * Sets whether TSL publishing is enabled for this service. + * + * @param tslPublishingEnabled {@code true} to enable TSL publishing; + * {@code false} to disable it. + * @return this {@link Service} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) { this.tslPublishingEnabled = tslPublishingEnabled; @@ -12234,6 +12244,15 @@ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) return this; } + /** + * Get the flag indicating whether the feature of TSL publishing + * for this service is enabled or not. + * + * @return {@code true} if the feature of TSL publishing is enabled. + * + * @since 4.30 + * @since Authlete 3.1 + */ public boolean isTslPublishingEnabled() { return tslPublishingEnabled; @@ -12298,7 +12317,10 @@ public Service setClientIdMetadataDocumentSupported(boolean supported) * @param tslConfigData the configuration data to be applied * @return this {@code Service} instance for method chaining * - * @see + * @since 4.30 + * @since Authlete 3.1 + * + * @see * Trust Status List */ public Service setTslConfigData(TslConfigData tslConfigData) @@ -12849,6 +12871,9 @@ public Service setHttpAliasProhibited(boolean prohibited) { * Retrieves the {@link TslConfigData} associated with this service. * * @return the current {@link TslConfigData} + * + * @since 4.30 + * @since Authlete 3.1 */ public TslConfigData getTslConfigData() { diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 94cb390d8f..1bf9b4dcf7 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -6,7 +6,7 @@ import java.net.URI; /** - * A class that represents trust status list configurations data + * A class that represents TSL configurations data * The set consists of the following. * *
    @@ -17,48 +17,54 @@ *
  • {@code publishEndpoint} *
* - * @since TODO - * @since Authlete TODO + * @since 4.30 + * @since Authlete 3.1 * - * @see Token Status List (TSL) */ -public class TslConfigData implements Serializable { +public class TslConfigData implements Serializable +{ private static final long serialVersionUID = 1L; /** * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ private TslPublishFormat format; /** * The validity of the TSL in hours * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ - private int validity; + private long validity; /** * Publish TSL after every X hours * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ - private int publishFrequency; + private long publishFrequency; /** * Time to live in hours which provides indication to verifiers to cache this TSL * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ - private int timeToLive; + private long timeToLive; /** * Endpoint where to publish this TSL * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ private URI publishEndpoint; @@ -70,12 +76,11 @@ public TslConfigData() { /** * Copy constructor. - * - * @param tslConfigData - * Source to copy data from. {@code null} won't raise any exception. */ - public TslConfigData(TslConfigData tslConfigData) { - if (tslConfigData == null) { + public TslConfigData(TslConfigData tslConfigData) + { + if (tslConfigData == null) + { return; } format = tslConfigData.getFormat(); @@ -85,49 +90,150 @@ public TslConfigData(TslConfigData tslConfigData) { publishEndpoint = tslConfigData.getPublishEndpoint(); } - public TslConfigData setFormat(TslPublishFormat format) { + /** + * Sets the TSL publish format. + * + * @param format the {@link TslPublishFormat} to use for publishing. + * + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setFormat(TslPublishFormat format) + { this.format = format; return this; } - public TslPublishFormat getFormat() { + + /** + * Returns the configured TSL publish format. + * + * @return the {@link TslPublishFormat} in use. + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslPublishFormat getFormat() + { return format; } - public TslConfigData setValidity(int validity) { + /** + * Sets the validity period for the TSL in hours. + * + * @param validity the validity duration + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setValidity(long validity) { this.validity = validity; return this; } - public int getValidity() { + + /** + * Returns the validity period of the TSL. + * + * @return the validity duration + * + * @since 4.30 + * @since Authlete 3.1 + */ + public long getValidity() + { return validity; } - public TslConfigData setPublishFrequency(int publishFrequency) { + /** + * Sets the frequency in hours at which the TSL should be published. + * + * @param publishFrequency the publishing frequency + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + * + */ + public TslConfigData setPublishFrequency(long publishFrequency) + { this.publishFrequency = publishFrequency; return this; } - public int getPublishFrequency() { + + /** + * Returns the publish frequency of the TSL. + * + * @return the publishing frequency + * + * @since 4.30 + * @since Authlete 3.1 + */ + public long getPublishFrequency() + { return publishFrequency; } - public TslConfigData setTimeToLive(int timeToLive) { + /** + * Sets the time to live in hours which provides indication to verifiers to cache this TSL + * + * @param timeToLive the TTL value + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setTimeToLive(long timeToLive) + { this.timeToLive = timeToLive; return this; } - public int getTimeToLive() { + + /** + * Returns the time-to-live (TTL) in hours value for the TSL. + * + * @return the TTL value + * + * @since 4.30 + * @since Authlete 3.1 + */ + public long getTimeToLive() + { return timeToLive; } - public TslConfigData setPublishEndpoint(URI publishEndpoint) { + /** + * Sets the endpoint URI where the TSL will be published. + * + * @param publishEndpoint the publish endpoint URI. + * + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setPublishEndpoint(URI publishEndpoint) + { this.publishEndpoint = publishEndpoint; return this; } - public URI getPublishEndpoint() { + + /** + * Returns the endpoint URI where the TSL is published. + * + * @return the publish endpoint URI. + * + * @since 4.30 + * @since Authlete 3.1 + */ + public URI getPublishEndpoint() + { return publishEndpoint; } -} - +} \ No newline at end of file diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java new file mode 100644 index 0000000000..3409d1e159 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -0,0 +1,54 @@ +package com.authlete.common.dto; + +public class TslEntriesResponse { + + private static final long serialVersionUID = 1L; + + private int start; + + private int end; + + private int totalCount; + + private TslEntry[] tslEntries; + + public TslEntriesResponse setStart(int start) { + this.start = start; + + return this; + } + + public int getStart() { + return start; + } + + public TslEntriesResponse setEnd(int end) { + this.end = end; + + return this; + } + + public int getEnd() { + return end; + } + + public TslEntriesResponse setTotalCount(int totalCount) { + this.totalCount = totalCount; + + return this; + } + + public int getTotalCount() { + return totalCount; + } + + public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) { + this.tslEntries = tslEntries; + + return this; + } + + public TslEntry[] getTslEntries() { + return tslEntries; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java new file mode 100644 index 0000000000..ee4c95cbc2 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -0,0 +1,57 @@ +package com.authlete.common.dto; + +import com.authlete.common.types.TslTokenStatus; + +public class TslEntry { + + private static final long serialVersionUID = 1L; + + private int tokenIndex; + + private String tokenId; + + private TslTokenStatus tokenStatus; + + private boolean isUsed; + + public TslEntry setTokenIndex(int tokenIndex) { + this.tokenIndex = tokenIndex; + + return this; + } + + public int getTokenIndex() { + return tokenIndex; + } + + public TslEntry setTokenId(String tokenId) { + this.tokenId = tokenId; + + return this; + } + + public String getTokenId() { + return tokenId; + } + + public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { + this.tokenStatus = tokenStatus; + + return this; + } + + public TslTokenStatus getTokenStatus() { + return tokenStatus; + } + + public TslEntry setIsUsed(boolean isUsed) { + this.isUsed = isUsed; + + return this; + } + + public boolean isUsed() { + return isUsed; + } + +} diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/TslGetRequest.java new file mode 100644 index 0000000000..4695efdf99 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslGetRequest.java @@ -0,0 +1,19 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +public class TslGetRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } +} + diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/TslGetResponse.java new file mode 100644 index 0000000000..a86d614fbf --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslGetResponse.java @@ -0,0 +1,28 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +public class TslGetResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + private String format; + + private String tsl; + + public void setFormat(String format) { + this.format = format; + } + + public String getFormat() { + return format; + } + + public void setTsl(String tsl) { + this.tsl = tsl; + } + + public String getTsl() { + return tsl; + } + } diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java new file mode 100644 index 0000000000..71bc711fed --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java @@ -0,0 +1,23 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +/** + * A request to Authlete's {@code /service/populate/unused/indexes} API. + * + * @since TODO + */ +public class TslPopulateUnusedIndexesRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java new file mode 100644 index 0000000000..dcc38195c1 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -0,0 +1,36 @@ +package com.authlete.common.dto; + +/** + * This DTO holds the information when next TSL will be published + * per service. + * + * @since TODO + */ +public class TslPublishConfig { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + /** + * It specifies the time when next TSL will be published. It is in seconds + */ + private long nextTslPublishTime; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } + + public void setNextTslPublishTime(long nextTslPublishTime) { + this.nextTslPublishTime = nextTslPublishTime; + } + + public long getNextTslPublishTime() { + return nextTslPublishTime; + } + +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java new file mode 100644 index 0000000000..ef0e554456 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -0,0 +1,21 @@ +package com.authlete.common.dto; + +/** + * Response from Authlete's {@code service/tsl/publish/configs} API. + * + * @since TODO + */ +public class TslPublishConfigsResponse extends ApiResponse { + + private static final long serialVersionUID = 1L; + + private TslPublishConfig[] tslPublishConfigs; + + public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { + this.tslPublishConfigs = tslPublishConfigs; + } + + public TslPublishConfig[] getTslPublishConfigs() { + return tslPublishConfigs; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java new file mode 100644 index 0000000000..616845aad5 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -0,0 +1,19 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +public class TslPublishRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } +} + diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java new file mode 100644 index 0000000000..af836505ac --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -0,0 +1,41 @@ +package com.authlete.common.dto; + +import com.authlete.common.types.TslTokenStatus; + +import java.io.Serializable; + +public class TslTokenStatusUpdateRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private String tokenId; + + private TslTokenStatus tokenStatus; + + private int tokenIndex; + + public void setTokenId(String tokenId) { + this.tokenId = tokenId; + } + + public String getSubject() { + return tokenId; + } + + public void setTokenStatus(TslTokenStatus tokenStatus) { + this.tokenStatus = tokenStatus; + } + + public TslTokenStatus getTokenStatus() { + return tokenStatus; + } + + public void setTokenIndex(int tokenIndex) { + this.tokenIndex = tokenIndex; + } + + public int getIndex() { + return tokenIndex; + } + +} diff --git a/src/main/java/com/authlete/common/types/TslTokenStatus.java b/src/main/java/com/authlete/common/types/TslTokenStatus.java new file mode 100644 index 0000000000..ff8d63867e --- /dev/null +++ b/src/main/java/com/authlete/common/types/TslTokenStatus.java @@ -0,0 +1,110 @@ +package com.authlete.common.types; + +import java.util.EnumSet; + +public enum TslTokenStatus { + + VALID((short)0, "valid"), + INVALID((short)1, "invalid"), + SUSPENDED((short)2, "suspended"); + + + private static final TslTokenStatus[] sValues = values(); + private static final TslTokenStatus.Helper sHelper = new TslTokenStatus.Helper(sValues); + private final short mValue; + private final String mString; + + + private TslTokenStatus(short value, String string) { + mValue = value; + mString = string; + } + + + /** + * Get the integer representation of this enum instance. + */ + public short getValue() { + return mValue; + } + + + /** + * Find an instance of this enum by a value. + * + * @param value + * The integer representation of the instance to find. + * + * @return + * An instance of this enum, or {@code null} if not found. + */ + public static TslTokenStatus getByValue(short value) + { + if (value < 1 || sValues.length < value) + { + // Not found. + return null; + } + + return sValues[value - 1]; + } + + + /** + * Get the string value of TSL token status. + * + * @return + * A string that contains TSL token status. + */ + public String getString() + { + return mString; + } + + + public static int toBits(EnumSet set) + { + return sHelper.toBits(set); + } + + + public static TslTokenStatus[] toArray(int bits) + { + return sHelper.toArray(bits); + } + + + public static EnumSet toSet(int bits) + { + return sHelper.toSet(bits); + } + + + public static EnumSet toSet(TslTokenStatus[] array) + { + return sHelper.toSet(array); + } + + + private static class Helper extends EnumHelper + { + public Helper(TslTokenStatus[] values) + { + super(TslTokenStatus.class, values); + } + + + @Override + protected short getValue(TslTokenStatus entry) + { + return entry.getValue(); + } + + + @Override + protected TslTokenStatus[] newArray(int size) + { + return new TslTokenStatus[size]; + } + } +} From 78bfb2629b8e98b35152569c4b8e68ccc0be5042 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 1 Dec 2025 17:05:13 +0500 Subject: [PATCH 03/52] property name update --- .../com/authlete/common/dto/TslTokenStatusUpdateRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index af836505ac..344a41bca3 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -18,7 +18,7 @@ public void setTokenId(String tokenId) { this.tokenId = tokenId; } - public String getSubject() { + public String getTokenId() { return tokenId; } From 4522eef114b548f764f9788c328adac956fcf358 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 17:00:05 +0500 Subject: [PATCH 04/52] version update --- pom.xml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index a058e7664b..5f67f6cef3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,15 +4,7 @@ com.authlete authlete-java-common -<<<<<<< HEAD -<<<<<<< HEAD - 4.33-SNAPSHOT -======= - 4.21 ->>>>>>> b3dde3000 (tsl support in progress) -======= - 4.31 ->>>>>>> ef348607f (tsl support) + 4.34-SNAPSHOT jar ${project.groupId}:${project.artifactId} From 7a8d3055a26c9fd23cba2dedd8f90fd6a9f34efb Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 17:14:09 +0500 Subject: [PATCH 05/52] version update --- .../java/com/authlete/common/dto/Service.java | 8 +-- .../authlete/common/dto/TslConfigData.java | 64 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index efb12275dd..a17ddfcdb0 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1964,8 +1964,8 @@ public class Service implements Serializable * The flag indicating whether the feature of Trust status list publishing for * this service is enabled or not. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private boolean tslPublishingEnabled; @@ -1973,8 +1973,8 @@ public class Service implements Serializable /** * TSL configuration data. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * * @see * Trust Status List diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 1bf9b4dcf7..9d5a06328f 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -17,8 +17,8 @@ *
  • {@code publishEndpoint} * * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * * @see Token Status List (TSL) @@ -31,40 +31,40 @@ public class TslConfigData implements Serializable /** * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private TslPublishFormat format; /** * The validity of the TSL in hours * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private long validity; /** * Publish TSL after every X hours * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private long publishFrequency; /** * Time to live in hours which provides indication to verifiers to cache this TSL * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private long timeToLive; /** * Endpoint where to publish this TSL * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private URI publishEndpoint; @@ -97,8 +97,8 @@ public TslConfigData(TslConfigData tslConfigData) * * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setFormat(TslPublishFormat format) { @@ -112,8 +112,8 @@ public TslConfigData setFormat(TslPublishFormat format) * * @return the {@link TslPublishFormat} in use. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslPublishFormat getFormat() { @@ -126,8 +126,8 @@ public TslPublishFormat getFormat() * @param validity the validity duration * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setValidity(long validity) { this.validity = validity; @@ -140,8 +140,8 @@ public TslConfigData setValidity(long validity) { * * @return the validity duration * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public long getValidity() { @@ -154,8 +154,8 @@ public long getValidity() * @param publishFrequency the publishing frequency * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * */ public TslConfigData setPublishFrequency(long publishFrequency) @@ -170,8 +170,8 @@ public TslConfigData setPublishFrequency(long publishFrequency) * * @return the publishing frequency * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public long getPublishFrequency() { @@ -184,8 +184,8 @@ public long getPublishFrequency() * @param timeToLive the TTL value * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setTimeToLive(long timeToLive) { @@ -199,8 +199,8 @@ public TslConfigData setTimeToLive(long timeToLive) * * @return the TTL value * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public long getTimeToLive() { @@ -214,8 +214,8 @@ public long getTimeToLive() * * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { @@ -229,8 +229,8 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) * * @return the publish endpoint URI. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public URI getPublishEndpoint() { From 3f12fa8237d81e368f7f4036398e302bb7922542 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 19:30:25 +0500 Subject: [PATCH 06/52] improved code commenting and refactoring --- .idea/compiler.xml | 4 +- .../java/com/authlete/common/dto/Service.java | 16 ++-- .../authlete/common/dto/TslConfigData.java | 88 ------------------- .../common/dto/TslEntriesResponse.java | 34 +++++++ .../com/authlete/common/dto/TslEntry.java | 55 +++++++++--- .../authlete/common/dto/TslGetRequest.java | 31 ++++++- .../authlete/common/dto/TslGetResponse.java | 34 +++++-- .../dto/TslPopulateUnusedIndexesRequest.java | 23 +++-- .../authlete/common/dto/TslPublishConfig.java | 16 +++- .../common/dto/TslPublishConfigsResponse.java | 31 +++++-- .../common/dto/TslPublishRequest.java | 31 ++++++- .../dto/TslTokenStatusUpdateRequest.java | 60 +++++++++++-- 12 files changed, 282 insertions(+), 141 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index cca8335003..df3ef2ec63 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,8 +6,10 @@ - + + + \ No newline at end of file diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index a17ddfcdb0..bc2a179de3 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -12234,8 +12234,8 @@ public Service setOid4vciVersion(String version) * {@code false} to disable it. * @return this {@link Service} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) { @@ -12250,8 +12250,8 @@ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) * * @return {@code true} if the feature of TSL publishing is enabled. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public boolean isTslPublishingEnabled() { @@ -12317,8 +12317,8 @@ public Service setClientIdMetadataDocumentSupported(boolean supported) * @param tslConfigData the configuration data to be applied * @return this {@code Service} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * * @see * Trust Status List @@ -12872,8 +12872,8 @@ public Service setHttpAliasProhibited(boolean prohibited) { * * @return the current {@link TslConfigData} * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData getTslConfigData() { diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 9d5a06328f..e47a54abd8 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -90,16 +90,6 @@ public TslConfigData(TslConfigData tslConfigData) publishEndpoint = tslConfigData.getPublishEndpoint(); } - /** - * Sets the TSL publish format. - * - * @param format the {@link TslPublishFormat} to use for publishing. - * - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setFormat(TslPublishFormat format) { this.format = format; @@ -107,57 +97,22 @@ public TslConfigData setFormat(TslPublishFormat format) return this; } - /** - * Returns the configured TSL publish format. - * - * @return the {@link TslPublishFormat} in use. - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslPublishFormat getFormat() { return format; } - /** - * Sets the validity period for the TSL in hours. - * - * @param validity the validity duration - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setValidity(long validity) { this.validity = validity; return this; } - /** - * Returns the validity period of the TSL. - * - * @return the validity duration - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public long getValidity() { return validity; } - /** - * Sets the frequency in hours at which the TSL should be published. - * - * @param publishFrequency the publishing frequency - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - * - */ public TslConfigData setPublishFrequency(long publishFrequency) { this.publishFrequency = publishFrequency; @@ -165,28 +120,11 @@ public TslConfigData setPublishFrequency(long publishFrequency) return this; } - /** - * Returns the publish frequency of the TSL. - * - * @return the publishing frequency - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public long getPublishFrequency() { return publishFrequency; } - /** - * Sets the time to live in hours which provides indication to verifiers to cache this TSL - * - * @param timeToLive the TTL value - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setTimeToLive(long timeToLive) { this.timeToLive = timeToLive; @@ -194,29 +132,11 @@ public TslConfigData setTimeToLive(long timeToLive) return this; } - /** - * Returns the time-to-live (TTL) in hours value for the TSL. - * - * @return the TTL value - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public long getTimeToLive() { return timeToLive; } - /** - * Sets the endpoint URI where the TSL will be published. - * - * @param publishEndpoint the publish endpoint URI. - * - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { this.publishEndpoint = publishEndpoint; @@ -224,14 +144,6 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) return this; } - /** - * Returns the endpoint URI where the TSL is published. - * - * @return the publish endpoint URI. - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public URI getPublishEndpoint() { return publishEndpoint; diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java index 3409d1e159..d968da6915 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -1,15 +1,49 @@ package com.authlete.common.dto; +/** + * Response from Authlete's {@code /tsl/entries/list} API. + * + * This class contains list of TSL token entries. + * + * @since 4.31 + * @since Authlete 3.0.22 + * + */ public class TslEntriesResponse { private static final long serialVersionUID = 1L; + /** + * The start index (inclusive) for the result set of the query. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int start; + /** + * The end index (exclusive) for the result set of the query. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int end; + /** + * Total count of the entries + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int totalCount; + /** + * TSL token entries + * + * @since 4.31 + * @since Authlete 3.0.22 + */ + private TslEntry[] tslEntries; public TslEntriesResponse setStart(int start) { diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java index ee4c95cbc2..7ba2446aa6 100644 --- a/src/main/java/com/authlete/common/dto/TslEntry.java +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -2,56 +2,89 @@ import com.authlete.common.types.TslTokenStatus; -public class TslEntry { - +/** + * This class contains token entries on which to build the TSL + * + * @since 4.31 + * @since Authlete 3.0.22 + * + */ +public class TslEntry +{ private static final long serialVersionUID = 1L; + /** + * Token index that represents the token in the issued VC/token. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int tokenIndex; + /** + * Unique ID assigned to each issued VC/token. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String tokenId; + /** + * Current status of the issued VC/token. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ + private TslTokenStatus tokenStatus; private boolean isUsed; - public TslEntry setTokenIndex(int tokenIndex) { + public TslEntry setTokenIndex(int tokenIndex) + { this.tokenIndex = tokenIndex; return this; } - public int getTokenIndex() { + public int getTokenIndex() + { return tokenIndex; } - public TslEntry setTokenId(String tokenId) { + public TslEntry setTokenId(String tokenId) + { this.tokenId = tokenId; return this; } - public String getTokenId() { + public String getTokenId() + { return tokenId; } - public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { + public TslEntry setTokenStatus(TslTokenStatus tokenStatus) + { this.tokenStatus = tokenStatus; return this; } - public TslTokenStatus getTokenStatus() { + public TslTokenStatus getTokenStatus() + { return tokenStatus; } - public TslEntry setIsUsed(boolean isUsed) { + public TslEntry setIsUsed(boolean isUsed) + { this.isUsed = isUsed; return this; } - public boolean isUsed() { + public boolean isUsed() + { return isUsed; } - } diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/TslGetRequest.java index 4695efdf99..7360d09efb 100644 --- a/src/main/java/com/authlete/common/dto/TslGetRequest.java +++ b/src/main/java/com/authlete/common/dto/TslGetRequest.java @@ -2,17 +2,42 @@ import java.io.Serializable; -public class TslGetRequest implements Serializable { +/** + * Request to Authlete's {@code /tsl/publish} API. + * + * This class is used to get the published TSL. + * The set consists of the following. + * + *
      + *
    • {@code serviceNumber} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + * + * @see Token Status List (TSL) + */ +public class TslGetRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Service number whose TSL is to be retrieved. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } } diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/TslGetResponse.java index a86d614fbf..95461eca5d 100644 --- a/src/main/java/com/authlete/common/dto/TslGetResponse.java +++ b/src/main/java/com/authlete/common/dto/TslGetResponse.java @@ -2,27 +2,51 @@ import java.io.Serializable; -public class TslGetResponse implements Serializable { +/** + * Response from Authlete's {@code /service/tsl} API. + * + * @since 4.31 + * @since Authlete 3.0.22 + * + */ +public class TslGetResponse implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * TSL format e.g. jwt. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String format; + /** + * TSL + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String tsl; - public void setFormat(String format) { + public void setFormat(String format) + { this.format = format; } - public String getFormat() { + public String getFormat() + { return format; } - public void setTsl(String tsl) { + public void setTsl(String tsl) + { this.tsl = tsl; } - public String getTsl() { + public String getTsl() + { return tsl; } } diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java index 71bc711fed..00f524cc0a 100644 --- a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java @@ -3,21 +3,34 @@ import java.io.Serializable; /** + * This class is used to pre-populate the unused indexes which later will be used in the + * issued VCs/tokens. + * * A request to Authlete's {@code /service/populate/unused/indexes} API. * - * @since TODO - */ -public class TslPopulateUnusedIndexesRequest implements Serializable { + * @since 4.31 + * @since Authlete 3.0.22 + */ +public class TslPopulateUnusedIndexesRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Service number against which unused indexes is populated. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index dcc38195c1..22c260097c 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -1,19 +1,29 @@ package com.authlete.common.dto; /** - * This DTO holds the information when next TSL will be published - * per service. + * This class contains per service TSL publish configurations. + * + * @since 4.31 + * @since Authlete 3.0.22 * - * @since TODO */ public class TslPublishConfig { private static final long serialVersionUID = 1L; + /** + * Service number whose TSL will be published at next publish time. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; /** * It specifies the time when next TSL will be published. It is in seconds + * + * @since 4.31 + * @since Authlete 3.0.22 */ private long nextTslPublishTime; diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java index ef0e554456..316721556c 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -1,21 +1,40 @@ package com.authlete.common.dto; /** - * Response from Authlete's {@code service/tsl/publish/configs} API. + * Response from Authlete's {@code /tsl/publish/configs} API. + * + * This class contains TSL publish configuration response which decided when next TSL + * is going to be published. + * + * @since 4.31 + * @since Authlete 3.0.22 * - * @since TODO */ -public class TslPublishConfigsResponse extends ApiResponse { - +public class TslPublishConfigsResponse extends ApiResponse +{ private static final long serialVersionUID = 1L; + /** + * TSL publish configurations reponse. + * It contains an array of the following information. + * + *
      + *
    • {@code serviceNumber} + *
    • {@code nextTslPublishTime} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private TslPublishConfig[] tslPublishConfigs; - public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { + public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) + { this.tslPublishConfigs = tslPublishConfigs; } - public TslPublishConfig[] getTslPublishConfigs() { + public TslPublishConfig[] getTslPublishConfigs() + { return tslPublishConfigs; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index 616845aad5..e6147f0fd5 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -2,17 +2,42 @@ import java.io.Serializable; -public class TslPublishRequest implements Serializable { +/** + * Request to Authlete's {@code /tsl/publish} API. + * + * This class is used to publish the TSL. + * The set consists of the following. + * + *
      + *
    • {@code serviceNumber} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + * + * @see Token Status List (TSL) + */ +public class TslPublishRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Service number whose TSL is to be published + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } } diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index 344a41bca3..c1337c0216 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -4,38 +4,82 @@ import java.io.Serializable; -public class TslTokenStatusUpdateRequest implements Serializable { +/** + * + * Request to Authlete's {@code /tsl/token/status} API. + * + * A class that updates the status of the issued VCs/tokens which later added in the issued TSL. + * The set consists of the following. + * + *
      + *
    • {@code tokenId} + *
    • {@code tokenStatus} + *
    • {@code tokenIndex} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + * + * @see Token Status List (TSL) + */ +public class TslTokenStatusUpdateRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Token ID used to identity the issued VC/token whose status can be changed. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String tokenId; + /** + * Token status to change. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ + private TslTokenStatus tokenStatus; + /** + * Token index in the issued TSL. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int tokenIndex; - public void setTokenId(String tokenId) { + public void setTokenId(String tokenId) + { this.tokenId = tokenId; } - public String getTokenId() { + public String getTokenId() + { return tokenId; } - public void setTokenStatus(TslTokenStatus tokenStatus) { + public void setTokenStatus(TslTokenStatus tokenStatus) + { this.tokenStatus = tokenStatus; } - public TslTokenStatus getTokenStatus() { + public TslTokenStatus getTokenStatus() + { return tokenStatus; } - public void setTokenIndex(int tokenIndex) { + public void setTokenIndex(int tokenIndex) + { this.tokenIndex = tokenIndex; } - public int getIndex() { + public int getIndex() + { return tokenIndex; } - } From ac3ea13435513cd9e03317366cacf1195f176732 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 19:35:57 +0500 Subject: [PATCH 07/52] improved code commenting and refactoring --- .../dto/CredentialDeferredIssueRequest.java | 36 ------------------- .../dto/CredentialDeferredIssueResponse.java | 6 ---- 2 files changed, 42 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java index 669685ed92..aeb705ff36 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java @@ -77,13 +77,6 @@ public class CredentialDeferredIssueRequest implements Serializable */ private CredentialIssuanceOrder order; - - /** - * The access token that came along with the deferred credential request. - */ - private String accessToken; - - /** * Get the credential order that provides an instruction for issuing a * credential. @@ -113,33 +106,4 @@ public CredentialDeferredIssueRequest setOrder(CredentialIssuanceOrder order) return this; } - - /** - * Get the access token that came along with the deferred credential request. - * - * @return - * The access token that the deferred credential endpoint received. - */ - public String getAccessToken() - { - return accessToken; - } - - - /** - * Set the access token that came along with the deferred credential request. - * - * @param accessToken - * The access token that the deferred credential endpoint received. - * - * @return - * {@code this} object. - */ - public CredentialDeferredIssueRequest setAccessToken(String accessToken) - { - this.accessToken = accessToken; - - return this; - } - } diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java index 9f48159e53..e22a1efb37 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java @@ -222,12 +222,6 @@ public enum Action * The API call is invalid. */ CALLER_ERROR, - - /** - * The deferred credential request does not contain the access token or - * the access token is invalid. - */ - UNAUTHORIZED, } From 945b5095d3a2454ed7fa1daa711d519e71a68a63 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 19:41:59 +0500 Subject: [PATCH 08/52] untracked .idea folder --- .gitignore | 1 + .idea/.gitignore | 3 --- .idea/compiler.xml | 15 --------------- .idea/encodings.xml | 7 ------- .idea/jarRepositories.xml | 20 -------------------- .idea/misc.xml | 12 ------------ .idea/vcs.xml | 6 ------ 7 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/jarRepositories.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index 9c65be4569..b73cecb8fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ target/ +.idea/ authlete.properties .settings .project diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d33521af..0000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index df3ef2ec63..0000000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index aa00ffab78..0000000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index 712ab9d985..0000000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index d31b37ac7b..0000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddfbb..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 59127b4c00245d9c70a7639ba70b24af39dd8493 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 19:45:22 +0500 Subject: [PATCH 09/52] untracked .idea folder --- src/main/java/com/authlete/common/dto/Service.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index bc2a179de3..5ba690db54 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -12861,7 +12861,8 @@ public boolean isHttpAliasProhibited() * @see * OAuth Client ID Metadata Document */ - public Service setHttpAliasProhibited(boolean prohibited) { + public Service setHttpAliasProhibited(boolean prohibited) + { this.httpAliasProhibited = prohibited; return this; From 220232760ac27ca7a0094bdab55a5cfc36a55078 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 21:06:11 +0500 Subject: [PATCH 10/52] added code docs --- .../authlete/common/dto/TslConfigData.java | 89 +++++++++++++++++++ .../common/dto/TslEntriesResponse.java | 27 ++++-- 2 files changed, 107 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index e47a54abd8..e8ca2f8c22 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -90,6 +90,15 @@ public TslConfigData(TslConfigData tslConfigData) publishEndpoint = tslConfigData.getPublishEndpoint(); } + /** + * Sets the publish format for the TSL configuration. + * + * @param format the {@link TslPublishFormat} value to set + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setFormat(TslPublishFormat format) { this.format = format; @@ -97,22 +106,58 @@ public TslConfigData setFormat(TslPublishFormat format) return this; } + /** + * Returns the publish format of the TSL configuration. + * + * @return the {@link TslPublishFormat} value currently configured + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslPublishFormat getFormat() { return format; } + /** + * Sets the TSL validity in hours. + * + * @param TSL validity in hours + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setValidity(long validity) { this.validity = validity; return this; } + /** + * Returns the TSL validity in hours. + * + * @return TSL validity + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public long getValidity() { return validity; } + /** + * Sets the TSL publishing frequency in every X hours. + * + * @param TSL publish frequency + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setPublishFrequency(long publishFrequency) { this.publishFrequency = publishFrequency; @@ -120,11 +165,29 @@ public TslConfigData setPublishFrequency(long publishFrequency) return this; } + /** + * Returns the TSL publishing frequency. + * + * @return TSL publishing frequency + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public long getPublishFrequency() { return publishFrequency; } + /** + * Sets the ttl value of TSL in hours. + * + * @param ttl value + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setTimeToLive(long timeToLive) { this.timeToLive = timeToLive; @@ -132,11 +195,29 @@ public TslConfigData setTimeToLive(long timeToLive) return this; } + /** + * Returns the ttl value. + * + * @return ttl value + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public long getTimeToLive() { return timeToLive; } + /** + * Sets the TSL publishing endpoint. + * + * @param publish endpoint + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { this.publishEndpoint = publishEndpoint; @@ -144,6 +225,14 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) return this; } + /** + * Returns the TSL publishing endpoint. + * + * @return publishing endpoint + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public URI getPublishEndpoint() { return publishEndpoint; diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java index d968da6915..f4eeb5f885 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -9,7 +9,8 @@ * @since Authlete 3.0.22 * */ -public class TslEntriesResponse { +public class TslEntriesResponse +{ private static final long serialVersionUID = 1L; @@ -46,43 +47,51 @@ public class TslEntriesResponse { private TslEntry[] tslEntries; - public TslEntriesResponse setStart(int start) { + public TslEntriesResponse setStart(int start) + { this.start = start; return this; } - public int getStart() { + public int getStart() + { return start; } - public TslEntriesResponse setEnd(int end) { + public TslEntriesResponse setEnd(int end) + { this.end = end; return this; } - public int getEnd() { + public int getEnd() + { return end; } - public TslEntriesResponse setTotalCount(int totalCount) { + public TslEntriesResponse setTotalCount(int totalCount) + { this.totalCount = totalCount; return this; } - public int getTotalCount() { + public int getTotalCount() + { return totalCount; } - public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) { + public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) + { this.tslEntries = tslEntries; return this; } - public TslEntry[] getTslEntries() { + public TslEntry[] getTslEntries() + { return tslEntries; } } From 88132ea08b7e58ab78102848eb3e23dc31e1eb95 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 3 Dec 2025 15:49:49 +0500 Subject: [PATCH 11/52] improved javadocs --- .../java/com/authlete/common/dto/Service.java | 2 +- .../authlete/common/dto/TslConfigData.java | 12 +-- .../common/dto/TslEntriesResponse.java | 79 ++++++++++++++++--- .../com/authlete/common/dto/TslEntry.java | 79 ++++++++++++++++--- .../authlete/common/dto/TslGetRequest.java | 41 +++++++--- .../authlete/common/dto/TslGetResponse.java | 44 +++++++++-- .../dto/TslPopulateUnusedIndexesRequest.java | 29 +++++-- .../authlete/common/dto/TslPublishConfig.java | 46 +++++++++-- .../common/dto/TslPublishConfigsResponse.java | 40 +++++++--- .../common/dto/TslPublishRequest.java | 39 ++++++--- .../dto/TslTokenStatusUpdateRequest.java | 68 ++++++++++++---- 11 files changed, 393 insertions(+), 86 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 5ba690db54..2c00372ef6 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1961,7 +1961,7 @@ public class Service implements Serializable private boolean httpAliasProhibited; /** - * The flag indicating whether the feature of Trust status list publishing for + * The flag indicating whether the feature of TSL publishing for * this service is enabled or not. * * @since 4.31 diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index e8ca2f8c22..d3796ae6fb 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -29,7 +29,7 @@ public class TslConfigData implements Serializable private static final long serialVersionUID = 1L; /** - * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported + * The format of the TSL. Possible values are jwt and cwt. Currently only jwt is supported * * @since 4.31 * @since Authlete 3.0.22 @@ -37,7 +37,7 @@ public class TslConfigData implements Serializable private TslPublishFormat format; /** - * The validity of the TSL in hours + * The validity of the TSL in hours. * * @since 4.31 * @since Authlete 3.0.22 @@ -45,7 +45,7 @@ public class TslConfigData implements Serializable private long validity; /** - * Publish TSL after every X hours + * Publish TSL after every X hours. * * @since 4.31 * @since Authlete 3.0.22 @@ -71,7 +71,8 @@ public class TslConfigData implements Serializable /** * The default constructor. */ - public TslConfigData() { + public TslConfigData() + { } /** @@ -129,7 +130,8 @@ public TslPublishFormat getFormat() * @since 4.31 * @since Authlete 3.0.22 */ - public TslConfigData setValidity(long validity) { + public TslConfigData setValidity(long validity) + { this.validity = validity; return this; diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java index f4eeb5f885..157f312b07 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -3,20 +3,25 @@ /** * Response from Authlete's {@code /tsl/entries/list} API. * - * This class contains list of TSL token entries. + *

    + * This class represents the result of a query that retrieves + * a list of TSL (Token Status List) token entries. It contains + * information about pagination (start and end indexes), total + * entry count, and the actual list of {@link TslEntry} objects. + *

    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslEntriesResponse { - private static final long serialVersionUID = 1L; /** * The start index (inclusive) for the result set of the query. * + * @return The start index. + * * @since 4.31 * @since Authlete 3.0.22 */ @@ -25,13 +30,17 @@ public class TslEntriesResponse /** * The end index (exclusive) for the result set of the query. * + * @return The end index. + * * @since 4.31 * @since Authlete 3.0.22 */ private int end; /** - * Total count of the entries + * The total number of entries available for the query, regardless of pagination. + * + * @return The total count of entries. * * @since 4.31 * @since Authlete 3.0.22 @@ -39,57 +48,107 @@ public class TslEntriesResponse private int totalCount; /** - * TSL token entries + * The array of TSL token entries returned by the query. + * + * @return An array of {@link TslEntry} objects. * * @since 4.31 * @since Authlete 3.0.22 */ - private TslEntry[] tslEntries; + + /** + * Set the start index (inclusive) for the result set. + * + * @param start + * The start index. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setStart(int start) { this.start = start; - return this; } + /** + * Get the start index (inclusive) for the result set. + * + * @return The start index. + */ public int getStart() { return start; } + /** + * Set the end index (exclusive) for the result set. + * + * @param end + * The end index. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setEnd(int end) { this.end = end; - return this; } + /** + * Get the end index (exclusive) for the result set. + * + * @return The end index. + */ public int getEnd() { return end; } + /** + * Set the total count of all entries matching the query. + * + * @param totalCount + * The total number of matching entries. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setTotalCount(int totalCount) { this.totalCount = totalCount; - return this; } + /** + * Get the total number of entries matching the query. + * + * @return The total count. + */ public int getTotalCount() { return totalCount; } + /** + * Set the list of TSL token entries. + * + * @param tslEntries + * An array of {@link TslEntry} objects. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) { this.tslEntries = tslEntries; - return this; } + /** + * Get the list of TSL token entries returned by the query. + * + * @return An array of {@link TslEntry} objects, or {@code null} if none. + */ public TslEntry[] getTslEntries() { return tslEntries; diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java index 7ba2446aa6..96e47fb8d4 100644 --- a/src/main/java/com/authlete/common/dto/TslEntry.java +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -3,18 +3,24 @@ import com.authlete.common.types.TslTokenStatus; /** - * This class contains token entries on which to build the TSL + * Represents a single token entry used in constructing a Token Status List (TSL). + * + *

    + * Each entry corresponds to an issued VC/token and includes its index, unique + * token ID, current status, and usage flag. These objects are typically returned + * as part of a list in {@code /tsl/entries/list} responses. + *

    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslEntry { private static final long serialVersionUID = 1L; /** - * Token index that represents the token in the issued VC/token. + * The token index associated with the issued VC/token. + * This index helps uniquely identify the token within a service. * * @since 4.31 * @since Authlete 3.0.22 @@ -22,7 +28,8 @@ public class TslEntry private int tokenIndex; /** - * Unique ID assigned to each issued VC/token. + * The unique token ID assigned at issuance time. + * This value is globally unique per token/VC. * * @since 4.31 * @since Authlete 3.0.22 @@ -30,59 +37,111 @@ public class TslEntry private String tokenId; /** - * Current status of the issued VC/token. + * The current status of the issued VC/token. + * + * @see TslTokenStatus * * @since 4.31 * @since Authlete 3.0.22 */ - private TslTokenStatus tokenStatus; + /** + * Indicates whether this token entry has been marked as used. + */ private boolean isUsed; + /** + * Set the token index associated with this entry. + * + * @param tokenIndex + * The token index. + * + * @return {@code this} object for method chaining. + */ public TslEntry setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; - return this; } + /** + * Get the token index associated with this entry. + * + * @return The token index. + */ public int getTokenIndex() { return tokenIndex; } + /** + * Set the unique token ID for this entry. + * + * @param tokenId + * The unique token identifier. + * + * @return {@code this} object for method chaining. + */ public TslEntry setTokenId(String tokenId) { this.tokenId = tokenId; - return this; } + /** + * Get the unique token ID associated with this entry. + * + * @return The token ID. + */ public String getTokenId() { return tokenId; } + /** + * Set the current token status. + * + * @param tokenStatus + * The status of the token. + * + * @return {@code this} object for method chaining. + */ public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; - return this; } + /** + * Get the current status of the issued token. + * + * @return The token status. + */ public TslTokenStatus getTokenStatus() { return tokenStatus; } + /** + * Set the usage flag for this token entry. + * + * @param isUsed + * {@code true} if the entry is already used; {@code false} otherwise. + * + * @return {@code this} object for method chaining. + */ public TslEntry setIsUsed(boolean isUsed) { this.isUsed = isUsed; - return this; } + /** + * Check whether this token entry has been marked as used. + * + * @return {@code true} if the entry is used; {@code false} otherwise. + */ public boolean isUsed() { return isUsed; diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/TslGetRequest.java index 7360d09efb..85b7d973d2 100644 --- a/src/main/java/com/authlete/common/dto/TslGetRequest.java +++ b/src/main/java/com/authlete/common/dto/TslGetRequest.java @@ -5,40 +5,59 @@ /** * Request to Authlete's {@code /tsl/publish} API. * - * This class is used to get the published TSL. - * The set consists of the following. + *

    + * This class represents a request to retrieve a published Token Status List (TSL) + * for a specific service. The request requires the caller to specify the + * {@code serviceNumber}, which uniquely identifies the service whose TSL is + * being requested. + *

    * - *
      - *
    • {@code serviceNumber} - *
    + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification * * @since 4.31 * @since Authlete 3.0.22 - * - * @see Token Status List (TSL) */ public class TslGetRequest implements Serializable { - private static final long serialVersionUID = 1L; /** - * Service number whose TSL is to be retrieved. + * The service number for which the TSL is requested. + * + *

    + * This value uniquely identifies a service within Authlete's environment. + * The TSL associated with this service number will be retrieved when the + * request is processed. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private int serviceNumber; + /** + * Set the service number whose Token Status List (TSL) should be retrieved. + * + * @param serviceNumber + * The service number to query. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number whose Token Status List (TSL) is being requested. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; } } - diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/TslGetResponse.java index 95461eca5d..6509269007 100644 --- a/src/main/java/com/authlete/common/dto/TslGetResponse.java +++ b/src/main/java/com/authlete/common/dto/TslGetResponse.java @@ -5,17 +5,25 @@ /** * Response from Authlete's {@code /service/tsl} API. * + *

    + * This class represents the response returned when retrieving a Token Status + * List (TSL) from Authlete. The response includes the TSL format (e.g., JWT) + * and the TSL content itself. + *

    + * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslGetResponse implements Serializable { - private static final long serialVersionUID = 1L; /** - * TSL format e.g. jwt. + * The format of the TSL, such as {@code "jwt"}. + * + *

    + * This value indicates how the TSL is encoded or represented. + *

    * * @since 4.31 * @since Authlete 3.0.22 @@ -23,30 +31,56 @@ public class TslGetResponse implements Serializable private String format; /** - * TSL + * The Token Status List (TSL) in the format specified by {@link #format}. + * + *

    + * The TSL is typically represented as a JWT or another supported encoding. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private String tsl; + /** + * Set the format of the Token Status List (TSL). + * + * @param format + * The TSL format (e.g., {@code "jwt"}). + */ public void setFormat(String format) { this.format = format; } + /** + * Get the format of the Token Status List (TSL). + * + * @return The TSL format. + */ public String getFormat() { return format; } + /** + * Set the Token Status List (TSL). + * + * @param tsl + * The TSL content in the format specified by {@link #format}. + */ public void setTsl(String tsl) { this.tsl = tsl; } + /** + * Get the Token Status List (TSL). + * + * @return The TSL content. + */ public String getTsl() { return tsl; } - } +} diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java index 00f524cc0a..1015cbc458 100644 --- a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java @@ -3,32 +3,51 @@ import java.io.Serializable; /** - * This class is used to pre-populate the unused indexes which later will be used in the - * issued VCs/tokens. + * Request to Authlete's {@code /service/populate/unused/indexes} API. * - * A request to Authlete's {@code /service/populate/unused/indexes} API. + *

    + * This class represents a request to pre-populate unused token indexes for a + * particular service. These unused indexes are later consumed when issuing + * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation + * of token indices within a Token Status List (TSL) environment. + *

    * * @since 4.31 * @since Authlete 3.0.22 - */ public class TslPopulateUnusedIndexesRequest implements Serializable { private static final long serialVersionUID = 1L; /** - * Service number against which unused indexes is populated. + * The service number for which unused token indexes should be populated. + * + *

    + * This value uniquely identifies the service under which the unused + * indexes will be created. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private int serviceNumber; + /** + * Set the service number for which unused token indexes should be populated. + * + * @param serviceNumber + * The service number to populate indexes for. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number for which unused token indexes should be populated. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index 22c260097c..8038ec6903 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -1,18 +1,28 @@ package com.authlete.common.dto; /** - * This class contains per service TSL publish configurations. + * Represents the Token Status List (TSL) publish configuration for a service. + * + *

    + * This class contains per-service settings related to TSL publication, including + * the service identifier and the Unix timestamp (in seconds) indicating when the + * next TSL will be published. + *

    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslPublishConfig { private static final long serialVersionUID = 1L; /** - * Service number whose TSL will be published at next publish time. + * The service number for which the TSL publication schedule applies. + * + *

    + * This uniquely identifies the service whose TSL will be published at + * the configured next publish time. + *

    * * @since 4.31 * @since Authlete 3.0.22 @@ -20,27 +30,53 @@ public class TslPublishConfig { private int serviceNumber; /** - * It specifies the time when next TSL will be published. It is in seconds + * The Unix timestamp (in seconds) indicating when the next TSL + * will be published for this service. + * + *

    + * This value allows services to schedule periodic TSL publication. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private long nextTslPublishTime; + /** + * Set the service number associated with this TSL publish configuration. + * + * @param serviceNumber + * The service number. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number associated with this TSL publish configuration. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; } + /** + * Set the Unix timestamp (in seconds) for the next TSL publication time. + * + * @param nextTslPublishTime + * The next publish time, in seconds. + */ public void setNextTslPublishTime(long nextTslPublishTime) { this.nextTslPublishTime = nextTslPublishTime; } + /** + * Get the Unix timestamp (in seconds) for the next TSL publication time. + * + * @return The next publish time, in seconds. + */ public long getNextTslPublishTime() { return nextTslPublishTime; } - } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java index 316721556c..3d3cba7a13 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -3,36 +3,58 @@ /** * Response from Authlete's {@code /tsl/publish/configs} API. * - * This class contains TSL publish configuration response which decided when next TSL - * is going to be published. + *

    + * This class represents the response containing Token Status List (TSL) + * publication configuration information for one or more services. Each entry + * indicates when the next TSL will be published for the corresponding service. + *

    + * + *

    + * The response includes an array of {@link TslPublishConfig} objects, each + * describing: + *

    + * + *
      + *
    • {@code serviceNumber} – The service identifier.
    • + *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • + *
    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslPublishConfigsResponse extends ApiResponse { private static final long serialVersionUID = 1L; /** - * TSL publish configurations reponse. - * It contains an array of the following information. + * The list of TSL publish configurations. * - *
      - *
    • {@code serviceNumber} - *
    • {@code nextTslPublishTime} - *
    + *

    + * Each element in the array contains the publish schedule for a service, + * including the service number and the next scheduled publish time. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private TslPublishConfig[] tslPublishConfigs; + /** + * Set the list of TSL publish configurations. + * + * @param tslPublishConfigs + * An array of {@link TslPublishConfig} objects. + */ public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { this.tslPublishConfigs = tslPublishConfigs; } + /** + * Get the list of TSL publish configurations. + * + * @return An array of {@link TslPublishConfig} objects. + */ public TslPublishConfig[] getTslPublishConfigs() { return tslPublishConfigs; diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index e6147f0fd5..d3e6858c00 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -5,40 +5,57 @@ /** * Request to Authlete's {@code /tsl/publish} API. * - * This class is used to publish the TSL. - * The set consists of the following. + *

    + * This class represents a request to publish a Token Status List (TSL) for + * a specific service. The request contains the {@code serviceNumber}, which + * uniquely identifies the service whose TSL is to be published. + *

    * - *
      - *
    • {@code serviceNumber} - *
    + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification * * @since 4.31 * @since Authlete 3.0.22 - * - * @see Token Status List (TSL) */ public class TslPublishRequest implements Serializable { - private static final long serialVersionUID = 1L; /** - * Service number whose TSL is to be published + * The service number whose TSL is to be published. + * + *

    + * This uniquely identifies the service within Authlete's environment. When + * this request is processed, the TSL for this service will be published. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private int serviceNumber; + /** + * Set the service number whose TSL is to be published. + * + * @param serviceNumber + * The service number to publish the TSL for. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number whose TSL is to be published. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; } } - diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index c1337c0216..11548a0adf 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -5,31 +5,37 @@ import java.io.Serializable; /** - * * Request to Authlete's {@code /tsl/token/status} API. * - * A class that updates the status of the issued VCs/tokens which later added in the issued TSL. - * The set consists of the following. + *

    + * This class represents a request to update the status of an issued + * Verifiable Credential (VC) or token. The updated status will later + * be included in the issued Token Status List (TSL). The request contains + * the following information: + *

    * *
      - *
    • {@code tokenId} - *
    • {@code tokenStatus} - *
    • {@code tokenIndex} + *
    • {@code tokenId} – The unique identifier of the issued token/VC.
    • + *
    • {@code tokenStatus} – The new status to assign to the token.
    • + *
    • {@code tokenIndex} – The index of the token in the issued TSL.
    • *
    * + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification + * * @since 4.31 * @since Authlete 3.0.22 - * - * @see Token Status List (TSL) */ public class TslTokenStatusUpdateRequest implements Serializable { - private static final long serialVersionUID = 1L; /** - * Token ID used to identity the issued VC/token whose status can be changed. + * The token ID used to identify the issued VC/token whose status is to be changed. * * @since 4.31 * @since Authlete 3.0.22 @@ -37,47 +43,81 @@ public class TslTokenStatusUpdateRequest implements Serializable private String tokenId; /** - * Token status to change. + * The token status to be set. + * + * @see TslTokenStatus * * @since 4.31 * @since Authlete 3.0.22 */ - private TslTokenStatus tokenStatus; /** - * Token index in the issued TSL. + * The index of the token in the issued TSL. * * @since 4.31 * @since Authlete 3.0.22 */ private int tokenIndex; + /** + * Set the token ID of the issued VC/token whose status is to be updated. + * + * @param tokenId + * The unique token identifier. + */ public void setTokenId(String tokenId) { this.tokenId = tokenId; } + /** + * Get the token ID of the issued VC/token whose status is being updated. + * + * @return The token ID. + */ public String getTokenId() { return tokenId; } + /** + * Set the token status to assign to the issued token/VC. + * + * @param tokenStatus + * The new token status. + */ public void setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; } + /** + * Get the token status currently set for this update request. + * + * @return The token status. + */ public TslTokenStatus getTokenStatus() { return tokenStatus; } + /** + * Set the token index in the issued TSL. + * + * @param tokenIndex + * The index of the token. + */ public void setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; } + /** + * Get the token index in the issued TSL. + * + * @return The token index. + */ public int getIndex() { return tokenIndex; From 3a318bdeb58af1e693653e927951f90e442ef79e Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 3 Dec 2025 15:55:09 +0500 Subject: [PATCH 12/52] improved javadocs --- pom.xml | 44 +++++++++---------- .../authlete/common/dto/TslPublishConfig.java | 15 ++++--- .../common/types/TslPublishFormat.java | 3 +- .../authlete/common/types/TslTokenStatus.java | 9 ++-- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index 5f67f6cef3..4b8ea39976 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + E834481D + ${env.GPG_PASSPHRASE} + + --pinentry-mode + loopback + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index 8038ec6903..5321491dc2 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -12,7 +12,8 @@ * @since 4.31 * @since Authlete 3.0.22 */ -public class TslPublishConfig { +public class TslPublishConfig +{ private static final long serialVersionUID = 1L; @@ -48,7 +49,8 @@ public class TslPublishConfig { * @param serviceNumber * The service number. */ - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } @@ -57,7 +59,8 @@ public void setServiceNumber(int serviceNumber) { * * @return The service number. */ - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } @@ -67,7 +70,8 @@ public int getServiceNumber() { * @param nextTslPublishTime * The next publish time, in seconds. */ - public void setNextTslPublishTime(long nextTslPublishTime) { + public void setNextTslPublishTime(long nextTslPublishTime) + { this.nextTslPublishTime = nextTslPublishTime; } @@ -76,7 +80,8 @@ public void setNextTslPublishTime(long nextTslPublishTime) { * * @return The next publish time, in seconds. */ - public long getNextTslPublishTime() { + public long getNextTslPublishTime() + { return nextTslPublishTime; } } diff --git a/src/main/java/com/authlete/common/types/TslPublishFormat.java b/src/main/java/com/authlete/common/types/TslPublishFormat.java index d493a3ba5e..e483d3d2aa 100644 --- a/src/main/java/com/authlete/common/types/TslPublishFormat.java +++ b/src/main/java/com/authlete/common/types/TslPublishFormat.java @@ -2,7 +2,8 @@ import java.util.EnumSet; -public enum TslPublishFormat { +public enum TslPublishFormat +{ /** * Currently jwt is supported. TSL publishing cwt format will be supported in the next iteration diff --git a/src/main/java/com/authlete/common/types/TslTokenStatus.java b/src/main/java/com/authlete/common/types/TslTokenStatus.java index ff8d63867e..c102ea9136 100644 --- a/src/main/java/com/authlete/common/types/TslTokenStatus.java +++ b/src/main/java/com/authlete/common/types/TslTokenStatus.java @@ -2,7 +2,8 @@ import java.util.EnumSet; -public enum TslTokenStatus { +public enum TslTokenStatus +{ VALID((short)0, "valid"), INVALID((short)1, "invalid"), @@ -15,7 +16,8 @@ public enum TslTokenStatus { private final String mString; - private TslTokenStatus(short value, String string) { + private TslTokenStatus(short value, String string) + { mValue = value; mString = string; } @@ -24,7 +26,8 @@ private TslTokenStatus(short value, String string) { /** * Get the integer representation of this enum instance. */ - public short getValue() { + public short getValue() + { return mValue; } From 388297d4aa1f8a0994acc530b31c0bf7826d9c33 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 8 Dec 2025 17:37:54 +0500 Subject: [PATCH 13/52] worked on PR comments --- pom.xml | 46 ++++----- ...quest.java => GetPublishedTslRequest.java} | 23 +++-- ...onse.java => GetPublishedTslResponse.java} | 42 ++++---- ...sponse.java => GetTslEntriesResponse.java} | 68 ++++++------- .../java/com/authlete/common/dto/Service.java | 39 +++++--- .../authlete/common/dto/TslConfigData.java | 97 +++++++------------ .../com/authlete/common/dto/TslEntry.java | 61 ++++++------ .../authlete/common/dto/TslPublishConfig.java | 25 +++-- .../common/dto/TslPublishConfigsResponse.java | 19 ++-- .../common/dto/TslPublishRequest.java | 19 ++-- .../dto/TslTokenStatusUpdateRequest.java | 45 +++++---- ...uest.java => TslUnusedIndexesRequest.java} | 19 ++-- 12 files changed, 249 insertions(+), 254 deletions(-) rename src/main/java/com/authlete/common/dto/{TslGetRequest.java => GetPublishedTslRequest.java} (77%) rename src/main/java/com/authlete/common/dto/{TslGetResponse.java => GetPublishedTslResponse.java} (63%) rename src/main/java/com/authlete/common/dto/{TslEntriesResponse.java => GetTslEntriesResponse.java} (64%) rename src/main/java/com/authlete/common/dto/{TslPopulateUnusedIndexesRequest.java => TslUnusedIndexesRequest.java} (77%) diff --git a/pom.xml b/pom.xml index 4b8ea39976..038d6e4fe2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.authlete authlete-java-common - 4.34-SNAPSHOT + 4.33-SNAPSHOT jar ${project.groupId}:${project.artifactId} @@ -308,28 +308,28 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 3.1.0 - - - sign-artifacts - verify - - sign - - - E834481D - ${env.GPG_PASSPHRASE} - - --pinentry-mode - loopback - - - - - + + + + + + + + + + + + + + + + + + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java similarity index 77% rename from src/main/java/com/authlete/common/dto/TslGetRequest.java rename to src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java index 85b7d973d2..b4fb4fdb3e 100644 --- a/src/main/java/com/authlete/common/dto/TslGetRequest.java +++ b/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java @@ -3,7 +3,7 @@ import java.io.Serializable; /** - * Request to Authlete's {@code /tsl/publish} API. + * Request to Authlete's {@code /service/tsl} API. * *

    * This class represents a request to retrieve a published Token Status List (TSL) @@ -16,13 +16,13 @@ * For more details about Token Status Lists (TSL), see: *

    * - * @see + * @see * Token Status List (TSL) Specification * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslGetRequest implements Serializable +public class GetPublishedTslRequest implements Serializable { private static final long serialVersionUID = 1L; @@ -34,9 +34,6 @@ public class TslGetRequest implements Serializable * The TSL associated with this service number will be retrieved when the * request is processed. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -44,17 +41,23 @@ public class TslGetRequest implements Serializable * Set the service number whose Token Status List (TSL) should be retrieved. * * @param serviceNumber - * The service number to query. + * The service number to query. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public GetPublishedTslRequest setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number whose Token Status List (TSL) is being requested. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java similarity index 63% rename from src/main/java/com/authlete/common/dto/TslGetResponse.java rename to src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java index 6509269007..9d8231f48d 100644 --- a/src/main/java/com/authlete/common/dto/TslGetResponse.java +++ b/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java @@ -7,38 +7,24 @@ * *

    * This class represents the response returned when retrieving a Token Status - * List (TSL) from Authlete. The response includes the TSL format (e.g., JWT) + * List (TSL) from Authlete API. The response includes the TSL format (e.g., JWT) * and the TSL content itself. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslGetResponse implements Serializable +public class GetPublishedTslResponse implements Serializable { private static final long serialVersionUID = 1L; /** * The format of the TSL, such as {@code "jwt"}. - * - *

    - * This value indicates how the TSL is encoded or represented. - *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private String format; /** - * The Token Status List (TSL) in the format specified by {@link #format}. - * - *

    - * The TSL is typically represented as a JWT or another supported encoding. - *

    - * - * @since 4.31 - * @since Authlete 3.0.22 + * The Token Status List (TSL). */ private String tsl; @@ -47,16 +33,22 @@ public class TslGetResponse implements Serializable * * @param format * The TSL format (e.g., {@code "jwt"}). + * + * @return + * {@code this} object. */ - public void setFormat(String format) + public GetPublishedTslResponse setFormat(String format) { this.format = format; + + return this; } /** * Get the format of the Token Status List (TSL). * - * @return The TSL format. + * @return + * The TSL format. */ public String getFormat() { @@ -68,16 +60,22 @@ public String getFormat() * * @param tsl * The TSL content in the format specified by {@link #format}. + * + * @return + * {@code this} object. */ - public void setTsl(String tsl) + public GetPublishedTslResponse setTsl(String tsl) { this.tsl = tsl; + + return this; } /** * Get the Token Status List (TSL). * - * @return The TSL content. + * @return + * The TSL content. */ public String getTsl() { diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/GetTslEntriesResponse.java similarity index 64% rename from src/main/java/com/authlete/common/dto/TslEntriesResponse.java rename to src/main/java/com/authlete/common/dto/GetTslEntriesResponse.java index 157f312b07..40769b2578 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/GetTslEntriesResponse.java @@ -1,5 +1,7 @@ package com.authlete.common.dto; +import java.io.Serializable; + /** * Response from Authlete's {@code /tsl/entries/list} API. * @@ -10,50 +12,30 @@ * entry count, and the actual list of {@link TslEntry} objects. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslEntriesResponse +public class GetTslEntriesResponse implements Serializable { private static final long serialVersionUID = 1L; /** * The start index (inclusive) for the result set of the query. - * - * @return The start index. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int start; /** * The end index (exclusive) for the result set of the query. - * - * @return The end index. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int end; /** * The total number of entries available for the query, regardless of pagination. - * - * @return The total count of entries. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int totalCount; /** * The array of TSL token entries returned by the query. - * - * @return An array of {@link TslEntry} objects. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslEntry[] tslEntries; @@ -64,18 +46,21 @@ public class TslEntriesResponse * @param start * The start index. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setStart(int start) + public GetTslEntriesResponse setStart(int start) { this.start = start; + return this; } /** * Get the start index (inclusive) for the result set. * - * @return The start index. + * @return + * The start index. */ public int getStart() { @@ -86,20 +71,23 @@ public int getStart() * Set the end index (exclusive) for the result set. * * @param end - * The end index. + * The end index. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setEnd(int end) + public GetTslEntriesResponse setEnd(int end) { this.end = end; + return this; } /** * Get the end index (exclusive) for the result set. * - * @return The end index. + * @return + * The end index. */ public int getEnd() { @@ -110,20 +98,23 @@ public int getEnd() * Set the total count of all entries matching the query. * * @param totalCount - * The total number of matching entries. + * The total number of matching entries. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setTotalCount(int totalCount) + public GetTslEntriesResponse setTotalCount(int totalCount) { this.totalCount = totalCount; + return this; } /** * Get the total number of entries matching the query. * - * @return The total count. + * @return + * The total count. */ public int getTotalCount() { @@ -134,20 +125,23 @@ public int getTotalCount() * Set the list of TSL token entries. * * @param tslEntries - * An array of {@link TslEntry} objects. + * An array of {@link TslEntry} objects. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) + public GetTslEntriesResponse setTslEntries(TslEntry[] tslEntries) { this.tslEntries = tslEntries; + return this; } /** * Get the list of TSL token entries returned by the query. * - * @return An array of {@link TslEntry} objects, or {@code null} if none. + * @return + * An array of {@link TslEntry} objects, or {@code null} if none. */ public TslEntry[] getTslEntries() { diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 2c00372ef6..efa499e974 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1955,7 +1955,7 @@ public class Service implements Serializable * Whether to prohibit client ID aliases that start with {@code https://} * or {@code http://}. * - * @since 4.32 + * @since 4.33 * @since Authlete 3.0.22 */ private boolean httpAliasProhibited; @@ -1964,7 +1964,7 @@ public class Service implements Serializable * The flag indicating whether the feature of TSL publishing for * this service is enabled or not. * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ private boolean tslPublishingEnabled; @@ -1973,10 +1973,10 @@ public class Service implements Serializable /** * TSL configuration data. * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 * - * @see + * @see * Trust Status List */ private TslConfigData tslConfigData; @@ -12230,11 +12230,13 @@ public Service setOid4vciVersion(String version) /* * Sets whether TSL publishing is enabled for this service. * - * @param tslPublishingEnabled {@code true} to enable TSL publishing; - * {@code false} to disable it. - * @return this {@link Service} instance for method chaining + * @param tslPublishingEnabled + * {@code true} to enable TSL publishing. {@code false} to disable it. * - * @since 4.31 + * @return + * this {@link Service} instance for method chaining + * + * @since 4.33 * @since Authlete 3.0.22 */ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) @@ -12248,9 +12250,10 @@ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) * Get the flag indicating whether the feature of TSL publishing * for this service is enabled or not. * - * @return {@code true} if the feature of TSL publishing is enabled. + * @return + * {@code true} if the feature of TSL publishing is enabled. * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public boolean isTslPublishingEnabled() @@ -12314,13 +12317,16 @@ public Service setClientIdMetadataDocumentSupported(boolean supported) /** * Sets the {@link TslConfigData} for this service. * - * @param tslConfigData the configuration data to be applied - * @return this {@code Service} instance for method chaining + * @param tslConfigData + * the configuration data to be applied * - * @since 4.31 + * @return + * this {@code Service} instance for method chaining + * + * @since 4.33 * @since Authlete 3.0.22 * - * @see + * @see * Trust Status List */ public Service setTslConfigData(TslConfigData tslConfigData) @@ -12871,9 +12877,10 @@ public Service setHttpAliasProhibited(boolean prohibited) /** * Retrieves the {@link TslConfigData} associated with this service. * - * @return the current {@link TslConfigData} + * @return + * the current {@link TslConfigData} * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public TslConfigData getTslConfigData() diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index d3796ae6fb..96e119e306 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -17,10 +17,10 @@ *
  • {@code publishEndpoint} * * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 * - * @see Token Status List (TSL) */ public class TslConfigData implements Serializable @@ -30,41 +30,26 @@ public class TslConfigData implements Serializable /** * The format of the TSL. Possible values are jwt and cwt. Currently only jwt is supported - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslPublishFormat format; /** * The validity of the TSL in hours. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long validity; /** * Publish TSL after every X hours. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long publishFrequency; /** * Time to live in hours which provides indication to verifiers to cache this TSL - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long timeToLive; /** * Endpoint where to publish this TSL - * - * @since 4.31 - * @since Authlete 3.0.22 */ private URI publishEndpoint; @@ -92,13 +77,13 @@ public TslConfigData(TslConfigData tslConfigData) } /** - * Sets the publish format for the TSL configuration. + * Sets the publishing format for the TSL configuration. * - * @param format the {@link TslPublishFormat} value to set - * @return this {@code TslConfigData} instance for method chaining + * @param format + * the {@link TslPublishFormat} value to set * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setFormat(TslPublishFormat format) { @@ -108,12 +93,10 @@ public TslConfigData setFormat(TslPublishFormat format) } /** - * Returns the publish format of the TSL configuration. - * - * @return the {@link TslPublishFormat} value currently configured + * Returns the publishing format of the TSL configuration. * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * the {@link TslPublishFormat} value currently configured */ public TslPublishFormat getFormat() { @@ -123,12 +106,11 @@ public TslPublishFormat getFormat() /** * Sets the TSL validity in hours. * - * @param TSL validity in hours - * - * @return this {@code TslConfigData} instance for method chaining + * @param validity + * validity in hours * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setValidity(long validity) { @@ -140,10 +122,8 @@ public TslConfigData setValidity(long validity) /** * Returns the TSL validity in hours. * - * @return TSL validity - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * TSL validity */ public long getValidity() { @@ -153,12 +133,11 @@ public long getValidity() /** * Sets the TSL publishing frequency in every X hours. * - * @param TSL publish frequency - * - * @return this {@code TslConfigData} instance for method chaining + * @param publishFrequency + * TSL publish frequency * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setPublishFrequency(long publishFrequency) { @@ -170,10 +149,8 @@ public TslConfigData setPublishFrequency(long publishFrequency) /** * Returns the TSL publishing frequency. * - * @return TSL publishing frequency - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * TSL publishing frequency */ public long getPublishFrequency() { @@ -183,12 +160,11 @@ public long getPublishFrequency() /** * Sets the ttl value of TSL in hours. * - * @param ttl value - * - * @return this {@code TslConfigData} instance for method chaining + * @param timeToLive + * the ttl value * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setTimeToLive(long timeToLive) { @@ -200,10 +176,8 @@ public TslConfigData setTimeToLive(long timeToLive) /** * Returns the ttl value. * - * @return ttl value - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * ttl value */ public long getTimeToLive() { @@ -213,12 +187,11 @@ public long getTimeToLive() /** * Sets the TSL publishing endpoint. * - * @param publish endpoint - * - * @return this {@code TslConfigData} instance for method chaining + * @param publishEndpoint + * TSL publish endpoint * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { @@ -230,10 +203,8 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) /** * Returns the TSL publishing endpoint. * - * @return publishing endpoint - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * TSL publishing endpoint */ public URI getPublishEndpoint() { diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java index 96e47fb8d4..8c037c8957 100644 --- a/src/main/java/com/authlete/common/dto/TslEntry.java +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -11,7 +11,7 @@ * as part of a list in {@code /tsl/entries/list} responses. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslEntry @@ -21,54 +21,46 @@ public class TslEntry /** * The token index associated with the issued VC/token. * This index helps uniquely identify the token within a service. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int tokenIndex; /** * The unique token ID assigned at issuance time. * This value is globally unique per token/VC. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private String tokenId; /** * The current status of the issued VC/token. - * - * @see TslTokenStatus - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslTokenStatus tokenStatus; /** * Indicates whether this token entry has been marked as used. */ - private boolean isUsed; + private boolean used; /** * Set the token index associated with this entry. * * @param tokenIndex - * The token index. + * The token index. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ public TslEntry setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; + return this; } /** * Get the token index associated with this entry. * - * @return The token index. + * @return + * The token index. */ public int getTokenIndex() { @@ -79,20 +71,23 @@ public int getTokenIndex() * Set the unique token ID for this entry. * * @param tokenId - * The unique token identifier. + * The unique token identifier. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ public TslEntry setTokenId(String tokenId) { this.tokenId = tokenId; + return this; } /** * Get the unique token ID associated with this entry. * - * @return The token ID. + * @return + * The token ID. */ public String getTokenId() { @@ -103,20 +98,23 @@ public String getTokenId() * Set the current token status. * * @param tokenStatus - * The status of the token. + * The status of the token. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; + return this; } /** * Get the current status of the issued token. * - * @return The token status. + * @return + * The token status. */ public TslTokenStatus getTokenStatus() { @@ -126,24 +124,27 @@ public TslTokenStatus getTokenStatus() /** * Set the usage flag for this token entry. * - * @param isUsed - * {@code true} if the entry is already used; {@code false} otherwise. + * @param used + * {@code true} if the entry is already used; {@code false} otherwise. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntry setIsUsed(boolean isUsed) + public TslEntry setUsed(boolean used) { - this.isUsed = isUsed; + this.used = used; + return this; } /** * Check whether this token entry has been marked as used. * - * @return {@code true} if the entry is used; {@code false} otherwise. + * @return + * {@code true} if the entry is used; {@code false} otherwise. */ - public boolean isUsed() + public boolean getUsed() { - return isUsed; + return used; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index 5321491dc2..50aa462d8f 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -9,7 +9,7 @@ * next TSL will be published. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslPublishConfig @@ -24,9 +24,6 @@ public class TslPublishConfig * This uniquely identifies the service whose TSL will be published at * the configured next publish time. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -37,9 +34,6 @@ public class TslPublishConfig *

    * This value allows services to schedule periodic TSL publication. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long nextTslPublishTime; @@ -48,16 +42,22 @@ public class TslPublishConfig * * @param serviceNumber * The service number. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public TslPublishConfig setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number associated with this TSL publish configuration. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { @@ -69,10 +69,15 @@ public int getServiceNumber() * * @param nextTslPublishTime * The next publish time, in seconds. + * + * @return + * {@code this} object. */ - public void setNextTslPublishTime(long nextTslPublishTime) + public TslPublishConfig setNextTslPublishTime(long nextTslPublishTime) { this.nextTslPublishTime = nextTslPublishTime; + + return this; } /** diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java index 3d3cba7a13..97d97f4f17 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -1,7 +1,7 @@ package com.authlete.common.dto; /** - * Response from Authlete's {@code /tsl/publish/configs} API. + * Response from Authlete's {@code /service/tsl/publish/configs} API. * *

    * This class represents the response containing Token Status List (TSL) @@ -15,11 +15,11 @@ *

    * *
      - *
    • {@code serviceNumber} – The service identifier.
    • + *
    • {@code serviceNumber} – The service number.
    • *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • *
    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslPublishConfigsResponse extends ApiResponse @@ -33,9 +33,6 @@ public class TslPublishConfigsResponse extends ApiResponse * Each element in the array contains the publish schedule for a service, * including the service number and the next scheduled publish time. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslPublishConfig[] tslPublishConfigs; @@ -44,16 +41,22 @@ public class TslPublishConfigsResponse extends ApiResponse * * @param tslPublishConfigs * An array of {@link TslPublishConfig} objects. + * + * @return + * {@code this} object. */ - public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) + public TslPublishConfigsResponse setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { this.tslPublishConfigs = tslPublishConfigs; + + return this; } /** * Get the list of TSL publish configurations. * - * @return An array of {@link TslPublishConfig} objects. + * @return + * An array of {@link TslPublishConfig} objects. */ public TslPublishConfig[] getTslPublishConfigs() { diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index d3e6858c00..a5c36d8a88 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -3,7 +3,7 @@ import java.io.Serializable; /** - * Request to Authlete's {@code /tsl/publish} API. + * Request to Authlete's {@code /service/tsl/publish} API. * *

    * This class represents a request to publish a Token Status List (TSL) for @@ -15,10 +15,10 @@ * For more details about Token Status Lists (TSL), see: *

    * - * @see + * @see * Token Status List (TSL) Specification * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslPublishRequest implements Serializable @@ -32,9 +32,6 @@ public class TslPublishRequest implements Serializable * This uniquely identifies the service within Authlete's environment. When * this request is processed, the TSL for this service will be published. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -43,16 +40,22 @@ public class TslPublishRequest implements Serializable * * @param serviceNumber * The service number to publish the TSL for. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public TslPublishRequest setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number whose TSL is to be published. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index 11548a0adf..d352bc759d 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -24,10 +24,10 @@ * For more details about Token Status Lists (TSL), see: *

    * - * @see + * @see * Token Status List (TSL) Specification * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslTokenStatusUpdateRequest implements Serializable @@ -36,27 +36,16 @@ public class TslTokenStatusUpdateRequest implements Serializable /** * The token ID used to identify the issued VC/token whose status is to be changed. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private String tokenId; /** * The token status to be set. - * - * @see TslTokenStatus - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslTokenStatus tokenStatus; /** * The index of the token in the issued TSL. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int tokenIndex; @@ -65,16 +54,22 @@ public class TslTokenStatusUpdateRequest implements Serializable * * @param tokenId * The unique token identifier. + * + * @return + * {@code this} object. */ - public void setTokenId(String tokenId) + public TslTokenStatusUpdateRequest setTokenId(String tokenId) { this.tokenId = tokenId; + + return this; } /** * Get the token ID of the issued VC/token whose status is being updated. * - * @return The token ID. + * @return + * The token ID. */ public String getTokenId() { @@ -86,16 +81,22 @@ public String getTokenId() * * @param tokenStatus * The new token status. + * + * @return + * {@code this} object. */ - public void setTokenStatus(TslTokenStatus tokenStatus) + public TslTokenStatusUpdateRequest setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; + + return this; } /** * Get the token status currently set for this update request. * - * @return The token status. + * @return + * The token status. */ public TslTokenStatus getTokenStatus() { @@ -107,16 +108,22 @@ public TslTokenStatus getTokenStatus() * * @param tokenIndex * The index of the token. + * + * @return + * {@code this} object. */ - public void setTokenIndex(int tokenIndex) + public TslTokenStatusUpdateRequest setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; + + return this; } /** * Get the token index in the issued TSL. * - * @return The token index. + * @return + * The token index. */ public int getIndex() { diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java similarity index 77% rename from src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java rename to src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index 1015cbc458..501c71225b 100644 --- a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -3,7 +3,7 @@ import java.io.Serializable; /** - * Request to Authlete's {@code /service/populate/unused/indexes} API. + * Request to Authlete's {@code /service/tsl/unused/indexes} API. * *

    * This class represents a request to pre-populate unused token indexes for a @@ -12,10 +12,10 @@ * of token indices within a Token Status List (TSL) environment. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslPopulateUnusedIndexesRequest implements Serializable +public class TslUnusedIndexesRequest implements Serializable { private static final long serialVersionUID = 1L; @@ -26,9 +26,6 @@ public class TslPopulateUnusedIndexesRequest implements Serializable * This value uniquely identifies the service under which the unused * indexes will be created. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -37,16 +34,22 @@ public class TslPopulateUnusedIndexesRequest implements Serializable * * @param serviceNumber * The service number to populate indexes for. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public TslUnusedIndexesRequest setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number for which unused token indexes should be populated. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { From bef7bf35ecb7891c140b0032ebecce073b1282bb Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 8 Dec 2025 20:43:53 +0500 Subject: [PATCH 14/52] pom.xml file update --- pom.xml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 038d6e4fe2..24682b2364 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + E834481D + ${env.GPG_PASSPHRASE} + + --pinentry-mode + loopback + + + + + org.codehaus.mojo From 9ee8b1770b8d402315af9def85957e6364b32356 Mon Sep 17 00:00:00 2001 From: Takahiko Kawasaki Date: Sat, 13 Dec 2025 18:05:39 +0900 Subject: [PATCH 15/52] feat: CIMD Metadata Policy (#153) --- CHANGES.ja.md | 7 + CHANGES.md | 7 + .../java/com/authlete/common/dto/Service.java | 222 +++++++++++++++++- 3 files changed, 235 insertions(+), 1 deletion(-) diff --git a/CHANGES.ja.md b/CHANGES.ja.md index 8dfd7dcfc1..3657988977 100644 --- a/CHANGES.ja.md +++ b/CHANGES.ja.md @@ -1,6 +1,13 @@ 変更点 ====== +- `Service` クラス + * `isCimdMetadataPolicyEnabled()` メソッドを追加。 + * `setCimdMetadataPolicyEnabled(boolean)` メソッドを追加。 + * `getCimdMetadataPolicy()` メソッドを追加。 + * `setCimdMetadataPolicy(String)` メソッドを追加。 + + 4.32 (2025 年 12 月 01 日) -------------------------- diff --git a/CHANGES.md b/CHANGES.md index 993327dab7..82d4784928 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,13 @@ CHANGES ======= +- `Service` class + * Added the `isCimdMetadataPolicyEnabled()` method. + * Added the `setCimdMetadataPolicyEnabled(boolean)` method. + * Added the `getCimdMetadataPolicy()` method. + * Added the `setCimdMetadataPolicy(String)` method. + + 4.32 (2025-12-01) ----------------- diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 2af8139bad..9bd957527e 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -330,7 +330,7 @@ */ public class Service implements Serializable { - private static final long serialVersionUID = 88L; + private static final long serialVersionUID = 89L; /* @@ -1951,6 +1951,26 @@ public class Service implements Serializable private boolean cimdQueryPermitted; + /** + * Whether to apply the metadata policy to client metadata that is obtained + * through the CIMD mechanism. + * + * @since 4.33 + * @since Authlete 3.0.23 + */ + private boolean cimdMetadataPolicyEnabled; + + + /** + * The metadata policy applied to client metadata that is obtained through + * the CIMD mechanism. + * + * @since 4.33 + * @since Authlete 3.0.23 + */ + private String cimdMetadataPolicy; + + /** * Whether to prohibit client ID aliases that start with {@code https://} * or {@code http://}. @@ -12724,6 +12744,206 @@ public Service setCimdQueryPermitted(boolean permitted) } + /** + * Get the flag that indicates whether to apply the metadata policy to + * client metadata that is obtained through the CIMD mechanism. + * + *

    + * If this flag is set to {@code true}, the metadata policy specified by + * the {@code cimdMetadataPolicy} property, if available, is applied to + * the client metadata that is obtained through the CIMD mechanism. + *

    + * + * @return + * {@code true} if the metadata policy is applied to client + * metadata that is obtained through the CIMD mechanism. + * + * @since 4.33 + * @since Authlete 3.0.23 + * + * @see + * OAuth Client ID Metadata Document + */ + public boolean isCimdMetadataPolicyEnabled() + { + return cimdMetadataPolicyEnabled; + } + + + /** + * Set the flag that indicates whether to apply the metadata policy to + * client metadata that is obtained through the CIMD mechanism. + * + *

    + * If this flag is set to {@code true}, the metadata policy specified by + * the {@code cimdMetadataPolicy} property, if available, is applied to + * the client metadata that is obtained through the CIMD mechanism. + *

    + * + * @param enabled + * {@code true} to apply the metadata policy to client metadata + * that is obtained through the CIMD mechanism. + * + * @return + * {@code this} object. + * + * @since 4.33 + * @since Authlete 3.0.23 + * + * @see + * OAuth Client ID Metadata Document + */ + public Service setCimdMetadataPolicyEnabled(boolean enabled) + { + this.cimdMetadataPolicyEnabled = enabled; + + return this; + } + + + /** + * Get the metadata policy applied to client metadata that is obtained + * through the CIMD mechanism. + * + *

    + * If the {@code cimdMetadataPolicyEnabled} property is set to {@code true}, + * the metadata policy specified by this {@code cimdMetadataPolicy} property + * is applied to client metadata that is obtained through the CIMD mechanism. + *

    + * + *

    + * The metadata policy must comply with the grammar defined in 6.1. Metadata Policy of the OpenID Federation + * 1.0 specification. Below is an example of metadata policy: + *

    + * + *
    +     * {
    +     *   "grant_types": {
    +     *     "default": [
    +     *       "authorization_code"
    +     *     ],
    +     *     "subset_of": [
    +     *       "authorization_code",
    +     *       "refresh_token"
    +     *     ],
    +     *     "superset_of": [
    +     *       "authorization_code"
    +     *     ]
    +     *   },
    +     *   "token_endpoint_auth_method": {
    +     *     "one_of": [
    +     *       "private_key_jwt",
    +     *       "self_signed_tls_client_auth"
    +     *     ],
    +     *     "essential": true
    +     *   },
    +     *   "token_endpoint_auth_signing_alg" : {
    +     *     "one_of": [
    +     *       "PS256",
    +     *       "ES256"
    +     *     ]
    +     *   }
    +     * }
    + * + * @return + * The metadata policy applied to client metadata that is obtained + * through the CIMD mechanism. + * + * @since 4.33 + * @since Authlete 3.0.23 + * + * @see + * OAuth Client ID Metadata Document + * @see + * OpenID Federation 1.0, Section 6.1. Metadata Policy + */ + public String getCimdMetadataPolicy() + { + return cimdMetadataPolicy; + } + + + /** + * Set the metadata policy applied to client metadata that is obtained + * through the CIMD mechanism. + * + *

    + * If the {@code cimdMetadataPolicyEnabled} property is set to {@code true}, + * the metadata policy specified by this {@code cimdMetadataPolicy} property + * is applied to client metadata that is obtained through the CIMD mechanism. + *

    + * + *

    + * The metadata policy must comply with the grammar defined in 6.1. Metadata Policy of the OpenID Federation + * 1.0 specification. Below is an example of metadata policy: + *

    + * + *
    +     * {
    +     *   "grant_types": {
    +     *     "default": [
    +     *       "authorization_code"
    +     *     ],
    +     *     "subset_of": [
    +     *       "authorization_code",
    +     *       "refresh_token"
    +     *     ],
    +     *     "superset_of": [
    +     *       "authorization_code"
    +     *     ]
    +     *   },
    +     *   "token_endpoint_auth_method": {
    +     *     "one_of": [
    +     *       "private_key_jwt",
    +     *       "self_signed_tls_client_auth"
    +     *     ],
    +     *     "essential": true
    +     *   },
    +     *   "token_endpoint_auth_signing_alg" : {
    +     *     "one_of": [
    +     *       "PS256",
    +     *       "ES256"
    +     *     ]
    +     *   }
    +     * }
    + * + * @param policy + * The metadata policy applied to client metadata that is obtained + * through the CIMD mechanism. + * + * @return + * {@code this} object. + * + * @since 4.33 + * @since Authlete 3.0.23 + * + * @see + * OAuth Client ID Metadata Document + * @see + * OpenID Federation 1.0, Section 6.1. Metadata Policy + */ + public Service setCimdMetadataPolicy(String policy) + { + this.cimdMetadataPolicy = policy; + + return this; + } + + /** * Get the flag that indicates whether to prohibit client ID aliases that * start with {@code https://} or {@code http://}. From c6b55bbf57c09c40a5dd624bf4f8f1f8e515a665 Mon Sep 17 00:00:00 2001 From: Takahiko Kawasaki Date: Sat, 13 Dec 2025 18:07:02 +0900 Subject: [PATCH 16/52] Update CHANGES files for version 4.33 --- CHANGES.ja.md | 3 +++ CHANGES.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.ja.md b/CHANGES.ja.md index 3657988977..531633f275 100644 --- a/CHANGES.ja.md +++ b/CHANGES.ja.md @@ -1,6 +1,9 @@ 変更点 ====== +4.33 (2025 年 12 月 13 日) +-------------------------- + - `Service` クラス * `isCimdMetadataPolicyEnabled()` メソッドを追加。 * `setCimdMetadataPolicyEnabled(boolean)` メソッドを追加。 diff --git a/CHANGES.md b/CHANGES.md index 82d4784928..2dec847781 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ CHANGES ======= +4.33 (2025-12-13) +----------------- + - `Service` class * Added the `isCimdMetadataPolicyEnabled()` method. * Added the `setCimdMetadataPolicyEnabled(boolean)` method. From 5ddb215c676c02e456f57683301de767294631f5 Mon Sep 17 00:00:00 2001 From: Authlete OPS Date: Sat, 13 Dec 2025 09:10:02 +0000 Subject: [PATCH 17/52] [maven-release-plugin] prepare release authlete-java-common-4.33 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 24682b2364..dfdf58b8df 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.authlete authlete-java-common - 4.33-SNAPSHOT + 4.33 jar ${project.groupId}:${project.artifactId} @@ -39,7 +39,7 @@ ${git.connection} ${git.connection} ${git.url} - authlete-java-common-4.21 + authlete-java-common-4.33 From 6a01d3bd2806d1523ea7b7ebd5b78b2691dce1da Mon Sep 17 00:00:00 2001 From: Authlete OPS Date: Sat, 13 Dec 2025 09:10:04 +0000 Subject: [PATCH 18/52] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dfdf58b8df..4b8ea39976 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.authlete authlete-java-common - 4.33 + 4.34-SNAPSHOT jar ${project.groupId}:${project.artifactId} @@ -39,7 +39,7 @@ ${git.connection} ${git.connection} ${git.url} - authlete-java-common-4.33 + authlete-java-common-4.21 From b08abb8294cabbe452b5579da88c8b21ab2b4d38 Mon Sep 17 00:00:00 2001 From: Takahiko Kawasaki Date: Sat, 3 Jan 2026 15:40:29 +0900 Subject: [PATCH 19/52] Add a copy constructor to AuthzDetailsElement --- .../common/dto/AuthzDetailsElement.java | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java b/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java index be8b29d4d9..f69bf8ab8b 100644 --- a/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java +++ b/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Authlete, Inc. + * Copyright (C) 2019-2026 Authlete, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ */ public class AuthzDetailsElement implements Serializable { - private static final long serialVersionUID = 4L; + private static final long serialVersionUID = 5L; private String type; @@ -42,6 +42,43 @@ public class AuthzDetailsElement implements Serializable private String otherFields; + /** + * The default constructor. + */ + public AuthzDetailsElement() + { + } + + + /** + * The copy constructor. + * + * @param element + * The source instance. + * + * @since 4.34 + */ + public AuthzDetailsElement(AuthzDetailsElement element) + { + if (element != null) + { + this.type = element.type; + this.locations = copy(element.locations); + this.actions = copy(element.actions); + this.dataTypes = copy(element.dataTypes); + this.identifier = element.identifier; + this.privileges = copy(element.privileges); + this.otherFields = element.otherFields; + } + } + + + private static String[] copy(String[] source) + { + return (source != null) ? source.clone() : null; + } + + /** * Get the type of this element. * From 414fb35a56e04bf9f5e79684aced60be31743395 Mon Sep 17 00:00:00 2001 From: Takahiko Kawasaki Date: Sat, 3 Jan 2026 15:45:15 +0900 Subject: [PATCH 20/52] Add credentialConfigurationId and credentialIdentifier properties to CredentialRequestInfo --- .../common/dto/CredentialRequestInfo.java | 159 +++++++++++++++++- 1 file changed, 153 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/CredentialRequestInfo.java b/src/main/java/com/authlete/common/dto/CredentialRequestInfo.java index 97644f91bd..eb9fc95823 100644 --- a/src/main/java/com/authlete/common/dto/CredentialRequestInfo.java +++ b/src/main/java/com/authlete/common/dto/CredentialRequestInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023-2024 Authlete, Inc. + * Copyright (C) 2023-2026 Authlete, Inc. * * 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 @@ -32,12 +32,12 @@ * @since 3.66 * @since Authlete 3.0 * - * @see OpenID for Verifiable Credential Issuance + * @see + * OpenID for Verifiable Credential Issuance 1.0 */ public class CredentialRequestInfo implements Serializable { - private static final long serialVersionUID = 2L; + private static final long serialVersionUID = 3L; /** @@ -72,6 +72,25 @@ public class CredentialRequestInfo implements Serializable private String details; + /** + * The {@code credential_configuration_id} parameter in the credential + * request. + * + * @since 4.34 + * @since Authlete 3.0.25 + */ + private String credentialConfigurationId; + + + /** + * The {@code credential_identifier} parameter in the credential request. + * + * @since 4.34; + * @since Authlete 3.0.25 + */ + private String credentialIdentifier; + + /** * Get the identifier of the credential request. * @@ -118,9 +137,18 @@ public CredentialRequestInfo setIdentifier(String identifier) /** * Get the value of the {@code format} parameter in the credential request. * + *

    + * This {@code format} property is available only when the supported OID4VCI + * specification version is {@code "1.0-ID1"} (i.e., when the Service's + * {@code oid4vciVersion} is unset or set to {@code "1.0-ID1"}) and the + * credential request contains the {@code format} parameter. Note that in + * the final version of the specification, the {@code format} parameter is + * deprecated. + *

    + * * @return * The value of the {@code format} parameter in the credential request. - * Such as {@code "vc+sd-jwt"}. + * Such as {@code "dc+sd-jwt"}. */ public String getFormat() { @@ -131,9 +159,18 @@ public String getFormat() /** * Set the value of the {@code format} parameter in the credential request. * + *

    + * This {@code format} property is available only when the supported OID4VCI + * specification version is {@code "1.0-ID1"} (i.e., when the Service's + * {@code oid4vciVersion} is unset or set to {@code "1.0-ID1"}) and the + * credential request contains the {@code format} parameter. Note that in + * the final version of the specification, the {@code format} parameter is + * deprecated. + *

    + * * @param format * The value of the {@code format} parameter in the credential request. - * Such as {@code "jwt_vc_json"} and {@code "vc+sd-jwt"}. + * Such as {@code "jwt_vc_json"} and {@code "dc+sd-jwt"}. * * @return * {@code this} object. @@ -299,4 +336,114 @@ public CredentialRequestInfo setDetails(String details) return this; } + + + /** + * Get the value of the {@code credential_configuration_id} parameter in + * the credential request. + * + *

    + * This property is not available when the supported OID4VCI specification + * version is {@code "1.0-ID1"} (i.e., when the Service's + * {@code oid4vciVersion} is unset or set to {@code "1.0-ID1"}), because + * the {@code credential_configuration_id} parameter does not exist in + * OID4VCI 1.0 ID1. + *

    + * + * @return + * The value of the {@code credential_configuration_id} parameter + * in the credential request. + * + * @since 4.34 + * @since Authlete 3.0.25 + */ + public String getCredentialConfigurationId() + { + return credentialConfigurationId; + } + + + /** + * Set the value of the {@code credential_configuration_id} parameter in + * the credential request. + * + *

    + * This property is not available when the supported OID4VCI specification + * version is {@code "1.0-ID1"} (i.e., when the Service's + * {@code oid4vciVersion} is unset or set to {@code "1.0-ID1"}), because + * the {@code credential_configuration_id} parameter does not exist in + * OID4VCI 1.0 ID1. + *

    + * + * @param id + * The value of the {@code credential_configuration_id} parameter + * in the credential request. + * + * @return + * {@code this} object. + * + * @since 4.34 + * @since Authlete 3.0.25 + */ + public CredentialRequestInfo setCredentialConfigurationId(String id) + { + this.credentialConfigurationId = id; + + return this; + } + + + /** + * Get the value of the {@code credential_identifier} parameter in the + * credential request. + * + *

    + * This property is not available when the supported OID4VCI specification + * version is {@code "1.0-ID1"} (i.e., when the Service's + * {@code oid4vciVersion} is unset or set to {@code "1.0-ID1"}), because + * Authlete does not support the {@code credential_identifier} parameter + * for OID4VCI 1.0 ID1. + *

    + * + * @return + * The value of the {@code credential_identifier} parameter in the + * credential request. + * + * @since 4.34 + * @since Authlete 3.0.25 + */ + public String getCredentialIdentifier() + { + return credentialIdentifier; + } + + + /** + * Set the value of the {@code credential_identifier} parameter in the + * credential request. + * + *

    + * This property is not available when the supported OID4VCI specification + * version is {@code "1.0-ID1"} (i.e., when the Service's + * {@code oid4vciVersion} is unset or set to {@code "1.0-ID1"}), because + * Authlete does not support the {@code credential_identifier} parameter + * for OID4VCI 1.0 ID1. + *

    + * + * @param identifier + * The value of the {@code credential_identifier} parameter in the + * credential request. + * + * @return + * {@code this} object. + * + * @since 4.34 + * @since Authlete 3.0.25 + */ + public CredentialRequestInfo setCredentialIdentifier(String identifier) + { + this.credentialIdentifier = identifier; + + return this; + } } From 42fb203bff8e963727c7669f01f5f9f15d80b169 Mon Sep 17 00:00:00 2001 From: Takahiko Kawasaki Date: Sat, 3 Jan 2026 15:47:57 +0900 Subject: [PATCH 21/52] Updated CHANGES files for version 4.34. --- CHANGES.ja.md | 14 ++++++++++++++ CHANGES.md | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGES.ja.md b/CHANGES.ja.md index 531633f275..c6c0f405d6 100644 --- a/CHANGES.ja.md +++ b/CHANGES.ja.md @@ -1,6 +1,20 @@ 変更点 ====== +4.34 (2026 年 01 月 03 日) +-------------------------- + +- `AuthzDetailsElement` クラス + * デフォルトコンストラクタを明示的に追加。 + * コピーコンストラクタ (`AuthzDetailsElement(AuthzDetailsElement)`) を追加。 + +- `CredentialRequestInfo` クラス + * `getCredentialConfigurationId()` メソッドを追加。 + * `setCredentialConfigurationId(String)` メソッドを追加。 + * `getCredentialIdentifier()` メソッドを追加。 + * `setCredentialIdentifier(String)` メソッドを追加。 + + 4.33 (2025 年 12 月 13 日) -------------------------- diff --git a/CHANGES.md b/CHANGES.md index 2dec847781..fda42bf121 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,20 @@ CHANGES ======= +4.34 (2026-01-03) +----------------- + +- `AuthzDetailsElement` class + * Added the default constructor explicitly. + * Added a copy constructor (`AuthzDetailsElement(AuthzDetailsElement)`). + +- `CredentialRequestInfo` class + * Added the `getCredentialConfigurationId()` method. + * Added the `setCredentialConfigurationId(String)` method. + * Added the `getCredentialIdentifier()` method. + * Added the `setCredentialIdentifier(String)` method. + + 4.33 (2025-12-13) ----------------- From 9838e01cbe63fbf40978f1fbe649bff414421573 Mon Sep 17 00:00:00 2001 From: Authlete OPS Date: Sat, 3 Jan 2026 06:50:32 +0000 Subject: [PATCH 22/52] [maven-release-plugin] prepare release authlete-java-common-4.34 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4b8ea39976..d7555f0dcf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.authlete authlete-java-common - 4.34-SNAPSHOT + 4.34 jar ${project.groupId}:${project.artifactId} @@ -39,7 +39,7 @@ ${git.connection} ${git.connection} ${git.url} - authlete-java-common-4.21 + authlete-java-common-4.34 From 1c71a24b93d8550e791a9e34b6023de81b96fc75 Mon Sep 17 00:00:00 2001 From: Authlete OPS Date: Sat, 3 Jan 2026 06:50:34 +0000 Subject: [PATCH 23/52] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d7555f0dcf..3fb1ac0426 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.authlete authlete-java-common - 4.34 + 4.35-SNAPSHOT jar ${project.groupId}:${project.artifactId} @@ -39,7 +39,7 @@ ${git.connection} ${git.connection} ${git.url} - authlete-java-common-4.34 + authlete-java-common-4.21 From c6ff07fc1e3782e331d7d3d01aa74b1d9593bf36 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 6 Jan 2026 15:34:07 +0500 Subject: [PATCH 24/52] updated as per comments --- pom.xml | 44 +++--- .../common/dto/GetPublishedTslRequest.java | 66 --------- .../common/dto/GetPublishedTslResponse.java | 84 ------------ .../authlete/common/dto/TslConfigData.java | 12 +- ...hConfig.java => TslPublishConfigInfo.java} | 65 ++++++--- .../dto/TslPublishConfigsListResponse.java | 125 ++++++++++++++++++ .../common/dto/TslPublishConfigsResponse.java | 65 --------- .../common/dto/TslPublishRequest.java | 49 ++++--- .../common/dto/TslPublishResponse.java | 114 ++++++++++++++++ .../com/authlete/common/dto/TslRequest.java | 76 +++++++++++ .../com/authlete/common/dto/TslResponse.java | 124 +++++++++++++++++ .../dto/TslTokenStatusUpdateRequest.java | 15 +++ .../dto/TslTokenStatusUpdateResponse.java | 86 ++++++++++++ .../common/dto/TslUnusedIndexesRequest.java | 79 ++++++++--- .../common/dto/TslUnusedIndexesResponse.java | 88 ++++++++++++ .../{TslPublishFormat.java => TslFormat.java} | 30 ++--- 16 files changed, 814 insertions(+), 308 deletions(-) delete mode 100644 src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java delete mode 100644 src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java rename src/main/java/com/authlete/common/dto/{TslPublishConfig.java => TslPublishConfigInfo.java} (50%) create mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java delete mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java rename src/main/java/com/authlete/common/types/{TslPublishFormat.java => TslFormat.java} (62%) diff --git a/pom.xml b/pom.xml index 24682b2364..038d6e4fe2 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@
    - - org.apache.maven.plugins - maven-gpg-plugin - 3.1.0 - - - sign-artifacts - verify - - sign - - - E834481D - ${env.GPG_PASSPHRASE} - - --pinentry-mode - loopback - - - - - + + + + + + + + + + + + + + + + + + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java b/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java deleted file mode 100644 index b4fb4fdb3e..0000000000 --- a/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.authlete.common.dto; - -import java.io.Serializable; - -/** - * Request to Authlete's {@code /service/tsl} API. - * - *

    - * This class represents a request to retrieve a published Token Status List (TSL) - * for a specific service. The request requires the caller to specify the - * {@code serviceNumber}, which uniquely identifies the service whose TSL is - * being requested. - *

    - * - *

    - * For more details about Token Status Lists (TSL), see: - *

    - * - * @see - * Token Status List (TSL) Specification - * - * @since 4.33 - * @since Authlete 3.0.22 - */ -public class GetPublishedTslRequest implements Serializable -{ - private static final long serialVersionUID = 1L; - - /** - * The service number for which the TSL is requested. - * - *

    - * This value uniquely identifies a service within Authlete's environment. - * The TSL associated with this service number will be retrieved when the - * request is processed. - *

    - */ - private int serviceNumber; - - /** - * Set the service number whose Token Status List (TSL) should be retrieved. - * - * @param serviceNumber - * The service number to query. - * - * @return - * {@code this} object. - */ - public GetPublishedTslRequest setServiceNumber(int serviceNumber) - { - this.serviceNumber = serviceNumber; - - return this; - } - - /** - * Get the service number whose Token Status List (TSL) is being requested. - * - * @return - * The service number. - */ - public int getServiceNumber() - { - return serviceNumber; - } -} diff --git a/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java b/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java deleted file mode 100644 index 9d8231f48d..0000000000 --- a/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.authlete.common.dto; - -import java.io.Serializable; - -/** - * Response from Authlete's {@code /service/tsl} API. - * - *

    - * This class represents the response returned when retrieving a Token Status - * List (TSL) from Authlete API. The response includes the TSL format (e.g., JWT) - * and the TSL content itself. - *

    - * - * @since 4.33 - * @since Authlete 3.0.22 - */ -public class GetPublishedTslResponse implements Serializable -{ - private static final long serialVersionUID = 1L; - - /** - * The format of the TSL, such as {@code "jwt"}. - */ - private String format; - - /** - * The Token Status List (TSL). - */ - private String tsl; - - /** - * Set the format of the Token Status List (TSL). - * - * @param format - * The TSL format (e.g., {@code "jwt"}). - * - * @return - * {@code this} object. - */ - public GetPublishedTslResponse setFormat(String format) - { - this.format = format; - - return this; - } - - /** - * Get the format of the Token Status List (TSL). - * - * @return - * The TSL format. - */ - public String getFormat() - { - return format; - } - - /** - * Set the Token Status List (TSL). - * - * @param tsl - * The TSL content in the format specified by {@link #format}. - * - * @return - * {@code this} object. - */ - public GetPublishedTslResponse setTsl(String tsl) - { - this.tsl = tsl; - - return this; - } - - /** - * Get the Token Status List (TSL). - * - * @return - * The TSL content. - */ - public String getTsl() - { - return tsl; - } -} diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 96e119e306..393c235332 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -1,6 +1,6 @@ package com.authlete.common.dto; -import com.authlete.common.types.TslPublishFormat; +import com.authlete.common.types.TslFormat; import java.io.Serializable; import java.net.URI; @@ -31,7 +31,7 @@ public class TslConfigData implements Serializable /** * The format of the TSL. Possible values are jwt and cwt. Currently only jwt is supported */ - private TslPublishFormat format; + private TslFormat format; /** * The validity of the TSL in hours. @@ -80,12 +80,12 @@ public TslConfigData(TslConfigData tslConfigData) * Sets the publishing format for the TSL configuration. * * @param format - * the {@link TslPublishFormat} value to set + * the {@link TslFormat} value to set * * @return * this {@code TslConfigData} instance for method chaining */ - public TslConfigData setFormat(TslPublishFormat format) + public TslConfigData setFormat(TslFormat format) { this.format = format; @@ -96,9 +96,9 @@ public TslConfigData setFormat(TslPublishFormat format) * Returns the publishing format of the TSL configuration. * * @return - * the {@link TslPublishFormat} value currently configured + * the {@link TslFormat} value currently configured */ - public TslPublishFormat getFormat() + public TslFormat getFormat() { return format; } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java similarity index 50% rename from src/main/java/com/authlete/common/dto/TslPublishConfig.java rename to src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java index 50aa462d8f..65cc8417f3 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java @@ -1,31 +1,33 @@ package com.authlete.common.dto; +import com.authlete.common.types.TslFormat; + /** - * Represents the Token Status List (TSL) publish configuration for a service. + * Represents the Token Status List (TSL) publish configurations for a service. * *

    * This class contains per-service settings related to TSL publication, including - * the service identifier and the Unix timestamp (in seconds) indicating when the + * the service ID and the Unix timestamp (in seconds) indicating when the * next TSL will be published. *

    * * @since 4.33 * @since Authlete 3.0.22 */ -public class TslPublishConfig +public class TslPublishConfigInfo { private static final long serialVersionUID = 1L; /** - * The service number for which the TSL publication schedule applies. + * The service ID for which the TSL publication schedule applies. * *

    * This uniquely identifies the service whose TSL will be published at * the configured next publish time. *

    */ - private int serviceNumber; + private long serviceId; /** * The Unix timestamp (in seconds) indicating when the next TSL @@ -38,30 +40,35 @@ public class TslPublishConfig private long nextTslPublishTime; /** - * Set the service number associated with this TSL publish configuration. + * The TSL format of the published TSL for this service. + */ + private TslFormat format; + + /** + * Set the service ID associated with this TSL publish configuration. * - * @param serviceNumber - * The service number. + * @param serviceId + * The service ID. * * @return * {@code this} object. */ - public TslPublishConfig setServiceNumber(int serviceNumber) + public TslPublishConfigInfo setServiceId(long serviceId) { - this.serviceNumber = serviceNumber; + this.serviceId = serviceId; return this; } /** - * Get the service number associated with this TSL publish configuration. + * Get the service ID associated with this TSL publish configuration. * * @return - * The service number. + * The service ID. */ - public int getServiceNumber() + public long getServiceId() { - return serviceNumber; + return serviceId; } /** @@ -73,7 +80,7 @@ public int getServiceNumber() * @return * {@code this} object. */ - public TslPublishConfig setNextTslPublishTime(long nextTslPublishTime) + public TslPublishConfigInfo setNextTslPublishTime(long nextTslPublishTime) { this.nextTslPublishTime = nextTslPublishTime; @@ -89,4 +96,32 @@ public long getNextTslPublishTime() { return nextTslPublishTime; } + + /** + * Sets the format of the published TSL + * + * @param format + * The TSL format. + * + * @return + * {@code this} object. + */ + public TslPublishConfigInfo setTslFormat(TslFormat format) + { + this.format = format; + + return this; + } + + /** + * Gets the format of the TSL. + * + * @return + * The TSL format. + */ + public TslFormat getTslFormat() + { + return format; + } + } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java new file mode 100644 index 0000000000..454f46e7bb --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response from Authlete's {@code /tsl/publish/configs/list} API. + * + *

    + * This class represents the response containing Token Status List (TSL) + * publish configurations for one or more services. Each entry + * indicates when the next TSL will be published for the corresponding service. + *

    + * + *

    + * The response includes an array of {@link TslPublishConfigInfo} objects, each + * describing: + *

    + * + *
      + *
    • {@code serviceID} – The service ID.
    • + *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • + *
    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslPublishConfigsListResponse extends ApiResponse +{ + private static final long serialVersionUID = 1L; + + /** + * The result of the {@code /tsl/publish/configs/list} API call. + */ + public enum Action + { + /** + * Information about the TSL publish configs has been obtained + * successfully. + */ + OK, + } + + /** + * The result of the {@code /tsl/publish/configs/list} API call. + */ + private Action action; + + /** + * The list of TSL publish configurations. + * + *

    + * Each element in the array contains the publishing schedule for a service, + * including the service ID and the next scheduled publish time. + *

    + */ + private TslPublishConfigInfo[] info; + + + /** + * Get the result of the {@code /tsl/publish/configs/list} API call. + * + * @return + * The result of the API call. + */ + public Action getAction() + { + return action; + } + + /** + * Set the result of the {@code /tsl/publish/configs/list} API call. + * + * @param action + * The result of the API call. + * + * @return + * {@code this} object. + */ + public TslPublishConfigsListResponse setAction(Action action) + { + this.action = action; + + return this; + } + + /** + * Set the list of TSL publish configurations. + * + * @param info + * An array of {@link TslPublishConfigInfo} objects. + * + * @return + * {@code this} object. + */ + public TslPublishConfigsListResponse setInfo(TslPublishConfigInfo[] info) + { + this.info = info; + + return this; + } + + /** + * Get the list of TSL publish configurations. + * + * @return + * An array of {@link TslPublishConfigInfo} objects. + */ + public TslPublishConfigInfo[] getInfo() + { + return info; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java deleted file mode 100644 index 97d97f4f17..0000000000 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.authlete.common.dto; - -/** - * Response from Authlete's {@code /service/tsl/publish/configs} API. - * - *

    - * This class represents the response containing Token Status List (TSL) - * publication configuration information for one or more services. Each entry - * indicates when the next TSL will be published for the corresponding service. - *

    - * - *

    - * The response includes an array of {@link TslPublishConfig} objects, each - * describing: - *

    - * - *
      - *
    • {@code serviceNumber} – The service number.
    • - *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • - *
    - * - * @since 4.33 - * @since Authlete 3.0.22 - */ -public class TslPublishConfigsResponse extends ApiResponse -{ - private static final long serialVersionUID = 1L; - - /** - * The list of TSL publish configurations. - * - *

    - * Each element in the array contains the publish schedule for a service, - * including the service number and the next scheduled publish time. - *

    - */ - private TslPublishConfig[] tslPublishConfigs; - - /** - * Set the list of TSL publish configurations. - * - * @param tslPublishConfigs - * An array of {@link TslPublishConfig} objects. - * - * @return - * {@code this} object. - */ - public TslPublishConfigsResponse setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) - { - this.tslPublishConfigs = tslPublishConfigs; - - return this; - } - - /** - * Get the list of TSL publish configurations. - * - * @return - * An array of {@link TslPublishConfig} objects. - */ - public TslPublishConfig[] getTslPublishConfigs() - { - return tslPublishConfigs; - } -} diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index a5c36d8a88..d11954d7ce 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -1,14 +1,30 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; +import com.authlete.common.types.TslFormat; + import java.io.Serializable; /** - * Request to Authlete's {@code /service/tsl/publish} API. + * Request to Authlete's {@code /tsl/publish} API. * *

    * This class represents a request to publish a Token Status List (TSL) for - * a specific service. The request contains the {@code serviceNumber}, which - * uniquely identifies the service whose TSL is to be published. + * a specific service. *

    * *

    @@ -26,39 +42,34 @@ public class TslPublishRequest implements Serializable private static final long serialVersionUID = 1L; /** - * The service number whose TSL is to be published. - * - *

    - * This uniquely identifies the service within Authlete's environment. When - * this request is processed, the TSL for this service will be published. - *

    + * The format of the to be published TSL. */ - private int serviceNumber; + private TslFormat format; /** - * Set the service number whose TSL is to be published. + * Set the to be published TSL format * - * @param serviceNumber - * The service number to publish the TSL for. + * @param format + * The TSL format. * * @return * {@code this} object. */ - public TslPublishRequest setServiceNumber(int serviceNumber) + public TslPublishRequest setTslFormat(TslFormat format) { - this.serviceNumber = serviceNumber; + this.format = format; return this; } /** - * Get the service number whose TSL is to be published. + * Get the to be published TSL format. * * @return - * The service number. + * The TSL format. */ - public int getServiceNumber() + public TslFormat getTslFormat() { - return serviceNumber; + return format; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishResponse.java b/src/main/java/com/authlete/common/dto/TslPublishResponse.java new file mode 100644 index 0000000000..4b020541db --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishResponse.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response from Authlete's {@code /tsl/publish} API. + * + *

    + * This class represents the response returned when publishing a Token Status + * List (TSL) from Authlete API. + *

    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslPublishResponse extends ApiResponse +{ + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the publish TSL endpoint + * should take after getting a response from Authlete's + * {@code /tsl/publish} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A TSL publish response has been prepared successfully. + */ + OK, + + /** + * The feature of TSL publish not enabled in the service + * configuration. + */ + FORBIDDEN, + } + + private Action action; + + private String tsl; + + /** + * Get the next action that the implementation of the TSL publish endpoint should + * take after getting a response from Authlete's {@code /tsl/publish} API. + * + * @return + * The next action. + */ + public Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl/publish} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslPublishResponse setAction(Action action) + { + this.action = action; + + return this; + } + + /** + * Get the published TSL + * + * @return + * The published TSL. + */ + public String getTsl() + { + return tsl; + } + + /** + * Set the published TSL. + * + * @param tsl + * The published TSL. + * + * @return + * {@code this} object. + */ + public TslPublishResponse setTsl(String tsl) + { + this.tsl = tsl; + + return this; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslRequest.java b/src/main/java/com/authlete/common/dto/TslRequest.java new file mode 100644 index 0000000000..17f570956f --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslRequest.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +import com.authlete.common.types.TslFormat; + +import java.io.Serializable; + +/** + * Request to Authlete's {@code /tsl} API. + * + *

    + * This class represents a request to retrieve a published Token Status List (TSL) + * for a specific service. The request requires the caller to specify the + * {@code tslFormat} for the requested TSL. + *

    + * + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslRequest implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** + * The requested TSL format. Currently only JWT format is supported. + */ + private TslFormat format; + + /** + * Set the requested TSL format + * + * @param format + * The TSL format. + * + * @return + * {@code this} object. + */ + public TslRequest setTslFormat(TslFormat format) + { + this.format = format; + + return this; + } + + /** + * Get the requested TSL format. + * + * @return + * The TSL format. + */ + public TslFormat getTslFormat() + { + return format; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslResponse.java b/src/main/java/com/authlete/common/dto/TslResponse.java new file mode 100644 index 0000000000..1883c78b22 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslResponse.java @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response from Authlete's {@code /tsl} API. + * + *

    + * This class represents the response returned when retrieving a Token Status + * List (TSL) from Authlete API. + *

    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslResponse extends ApiResponse +{ + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the TSL endpoint + * should take after getting a response from Authlete's + * {@code /tsl} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A get TSL response has been prepared successfully. + */ + OK, + + /** + * The feature of TSL is not enabled in the service + * configuration. + */ + FORBIDDEN, + + /** + * Invalid TSL format + */ + INVALID_TSL_FORMAT, + } + + private Action action; + + private String responseContent; + + /** + * Get the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl} API. + * + * @return + * The next action. + */ + public Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslResponse setAction(Action action) + { + this.action = action; + + return this; + } + + + /** + * Get the content that the implementation of the TSL endpoint should use + * when it constructs a response. + * + * @return + * The response content in the JSON format. + */ + public String getResponseContent() + { + return responseContent; + } + + + /** + * Set the content that the implementation of the TSL endpoint should use + * when it constructs a response. + * + * @param content + * The response content in the JSON format. + * + * @return + * {@code this} object. + */ + public TslResponse setResponseContent(String content) + { + this.responseContent = content; + + return this; + } + +} diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index d352bc759d..9d1174e600 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; import com.authlete.common.types.TslTokenStatus; diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java new file mode 100644 index 0000000000..79ec7e2682 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response to Authlete's {@code /tsl/token/status} API. + * + *

    + * This class represents a response to update the status of an issued + * Verifiable Credential (VC) or token. The updated status will later + * be included in the issued Token Status List (TSL). + * + * @since 4.33 + * @since Authlete 3.0.22 + * + */ +public class TslTokenStatusUpdateResponse extends ApiResponse { + + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the token status update endpoint + * should take after getting a response from Authlete's + * {@code /tsl/token/status} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A token status update performed successfully. + */ + OK, + + /** + * The feature of TSL publish not enabled in the service + * configuration. + */ + FORBIDDEN, + } + + private TslTokenStatusUpdateResponse.Action action; + + /** + * Get the next action that the implementation of the token status update endpoint should + * take after getting a response from Authlete's {@code /tsl/token/status} API. + * + * @return + * The next action. + */ + public TslTokenStatusUpdateResponse.Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the token status update endpoint should + * take after getting a response from Authlete's {@code /tsl/token/status} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslTokenStatusUpdateResponse setAction(TslTokenStatusUpdateResponse.Action action) + { + this.action = action; + + return this; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index 501c71225b..8ed6d248e2 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -1,9 +1,24 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; import java.io.Serializable; /** - * Request to Authlete's {@code /service/tsl/unused/indexes} API. + * Request to Authlete's {@code /tsl/unused/indexes} API. * *

    * This class represents a request to pre-populate unused token indexes for a @@ -20,39 +35,71 @@ public class TslUnusedIndexesRequest implements Serializable private static final long serialVersionUID = 1L; /** - * The service number for which unused token indexes should be populated. + * If less than this number of unused VC/token indexes left then populate new unused indexes + * specified in {@code unusedTokenIndexesAdd}. + */ + private long unusedTokenIndexesLeft; + + /** + * Add this number of new unused VC/token indexes. + */ + private long unusedTokenIndexesAdd; + + /** + * Set the unused token indexes left value. + * + * @param unusedTokenIndexesLeft + * The unused token indexes left value. + * + * @return + * {@code this} object. + */ + public TslUnusedIndexesRequest setUnusedTokenIndexLeft(long unusedTokenIndexesLeft) + { + this.unusedTokenIndexesLeft = unusedTokenIndexesLeft; + + return this; + } + + /** + * Get the unused token indexes left value. * - *

    - * This value uniquely identifies the service under which the unused - * indexes will be created. - *

    + * @return + * The unused token indexes left value. */ - private int serviceNumber; + public long getUnusedTokenIndexLeft() + { + return unusedTokenIndexesLeft; + } /** - * Set the service number for which unused token indexes should be populated. + * Set the unused token indexes add value. * - * @param serviceNumber - * The service number to populate indexes for. + * @param unusedTokenIndexesAdd + * The unused token indexes add value. * * @return * {@code this} object. */ - public TslUnusedIndexesRequest setServiceNumber(int serviceNumber) + public TslUnusedIndexesRequest setUnusedTokenIndexAdd(long unusedTokenIndexesAdd) { - this.serviceNumber = serviceNumber; + this.unusedTokenIndexesAdd = unusedTokenIndexesAdd; return this; } /** - * Get the service number for which unused token indexes should be populated. + * Get the unused token indexes add value. * * @return - * The service number. + * The unused token indexes add value. */ - public int getServiceNumber() + public long getUnusedTokenIndexAdd() { - return serviceNumber; + return unusedTokenIndexesAdd; } + + + + } diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java new file mode 100644 index 0000000000..1347343782 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response to Authlete's {@code /tsl/unused/indexes} API. + * + *

    + * This class represents a response to pre-populate unused token indexes for a + * particular service. These unused indexes are later consumed when issuing + * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation + * of token indices within a Token Status List (TSL) environment. + *

    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + +public class TslUnusedIndexesResponse extends ApiResponse { + + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the TSL unused indexes endpoint + * should take after getting a response from Authlete's + * {@code /tsl/unused/indexes} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A TSL publish response has been prepared successfully. + */ + OK, + + /** + * The feature of TSL publish not enabled in the service + * configuration. + */ + FORBIDDEN, + } + + private TslUnusedIndexesResponse.Action action; + + /** + * Get the next action that the implementation of the TSL unused indexes endpoint should + * take after getting a response from Authlete's {@code /tsl/unused/indexes} API. + * + * @return + * The next action. + */ + public TslUnusedIndexesResponse.Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the TSL unused indexes endpoint should + * take after getting a response from Authlete's {@code /tsl/unused/indexes} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslUnusedIndexesResponse setAction(TslUnusedIndexesResponse.Action action) + { + this.action = action; + + return this; + } +} diff --git a/src/main/java/com/authlete/common/types/TslPublishFormat.java b/src/main/java/com/authlete/common/types/TslFormat.java similarity index 62% rename from src/main/java/com/authlete/common/types/TslPublishFormat.java rename to src/main/java/com/authlete/common/types/TslFormat.java index e483d3d2aa..dabb11e960 100644 --- a/src/main/java/com/authlete/common/types/TslPublishFormat.java +++ b/src/main/java/com/authlete/common/types/TslFormat.java @@ -2,7 +2,7 @@ import java.util.EnumSet; -public enum TslPublishFormat +public enum TslFormat { /** @@ -11,13 +11,13 @@ public enum TslPublishFormat JWT((short)1, "jwt"); - private static final TslPublishFormat[] sValues = values(); - private static final TslPublishFormat.Helper sHelper = new TslPublishFormat.Helper(sValues); + private static final TslFormat[] sValues = values(); + private static final TslFormat.Helper sHelper = new TslFormat.Helper(sValues); private final short mValue; private final String mString; - private TslPublishFormat(short value, String string) + private TslFormat(short value, String string) { mValue = value; mString = string; @@ -42,7 +42,7 @@ public short getValue() * @return * An instance of this enum, or {@code null} if not found. */ - public static TslPublishFormat getByValue(short value) + public static TslFormat getByValue(short value) { if (value < 1 || sValues.length < value) { @@ -66,49 +66,49 @@ public String getString() } - public static int toBits(EnumSet set) + public static int toBits(EnumSet set) { return sHelper.toBits(set); } - public static TslPublishFormat[] toArray(int bits) + public static TslFormat[] toArray(int bits) { return sHelper.toArray(bits); } - public static EnumSet toSet(int bits) + public static EnumSet toSet(int bits) { return sHelper.toSet(bits); } - public static EnumSet toSet(TslPublishFormat[] array) + public static EnumSet toSet(TslFormat[] array) { return sHelper.toSet(array); } - private static class Helper extends EnumHelper + private static class Helper extends EnumHelper { - public Helper(TslPublishFormat[] values) + public Helper(TslFormat[] values) { - super(TslPublishFormat.class, values); + super(TslFormat.class, values); } @Override - protected short getValue(TslPublishFormat entry) + protected short getValue(TslFormat entry) { return entry.getValue(); } @Override - protected TslPublishFormat[] newArray(int size) + protected TslFormat[] newArray(int size) { - return new TslPublishFormat[size]; + return new TslFormat[size]; } } } From 2223311dda2c74522cce6d2a3a52f0d240588c21 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 6 Jan 2026 17:39:53 +0500 Subject: [PATCH 25/52] updated as per comments --- .../common/dto/TslPublishConfigInfo.java | 10 +++++----- .../dto/TslPublishConfigsListResponse.java | 17 +++++++++++------ .../authlete/common/dto/TslPublishResponse.java | 8 +++++--- .../com/authlete/common/dto/TslResponse.java | 3 --- .../dto/TslTokenStatusUpdateResponse.java | 3 --- .../common/dto/TslUnusedIndexesRequest.java | 5 +---- .../common/dto/TslUnusedIndexesResponse.java | 7 ++----- 7 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java index 65cc8417f3..c52f3f753c 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java @@ -7,7 +7,7 @@ * *

    * This class contains per-service settings related to TSL publication, including - * the service ID and the Unix timestamp (in seconds) indicating when the + * the service ID, format and the Unix timestamp (in seconds) indicating when the * next TSL will be published. *

    * @@ -40,12 +40,12 @@ public class TslPublishConfigInfo private long nextTslPublishTime; /** - * The TSL format of the published TSL for this service. + * The TSL format of the TSL for this service. */ private TslFormat format; /** - * Set the service ID associated with this TSL publish configuration. + * Set the service ID associated with this TSL publish configurations. * * @param serviceId * The service ID. @@ -61,7 +61,7 @@ public TslPublishConfigInfo setServiceId(long serviceId) } /** - * Get the service ID associated with this TSL publish configuration. + * Get the service ID associated with this TSL publish configurations. * * @return * The service ID. @@ -98,7 +98,7 @@ public long getNextTslPublishTime() } /** - * Sets the format of the published TSL + * Sets the format of the TSL * * @param format * The TSL format. diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java index 454f46e7bb..4d60988985 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java @@ -32,6 +32,7 @@ *
      *
    • {@code serviceID} – The service ID.
    • *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • + *
    • {@code format} – The TSL format.
    • *
    * * @since 4.33 @@ -42,7 +43,9 @@ public class TslPublishConfigsListResponse extends ApiResponse private static final long serialVersionUID = 1L; /** - * The result of the {@code /tsl/publish/configs/list} API call. + * The next action that the implementation of the publish TSL endpoint + * should take after getting a response from Authlete's + * {@code /tsl/publish/configs/list} API. */ public enum Action { @@ -63,17 +66,18 @@ public enum Action * *

    * Each element in the array contains the publishing schedule for a service, - * including the service ID and the next scheduled publish time. + * including the service ID, format and the next TSL scheduled publish time. *

    */ private TslPublishConfigInfo[] info; /** - * Get the result of the {@code /tsl/publish/configs/list} API call. + * Get the next action that the implementation of the TSL publish endpoint should + * take after getting a response from Authlete's {@code /tsl/publish/configs/list} API. * * @return - * The result of the API call. + * The next action. */ public Action getAction() { @@ -81,10 +85,11 @@ public Action getAction() } /** - * Set the result of the {@code /tsl/publish/configs/list} API call. + * Set the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl/publish/configs/list} API. * * @param action - * The result of the API call. + * The next action. * * @return * {@code this} object. diff --git a/src/main/java/com/authlete/common/dto/TslPublishResponse.java b/src/main/java/com/authlete/common/dto/TslPublishResponse.java index 4b020541db..01cd959a0d 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishResponse.java @@ -34,9 +34,6 @@ public class TslPublishResponse extends ApiResponse * The next action that the implementation of the publish TSL endpoint * should take after getting a response from Authlete's * {@code /tsl/publish} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { @@ -50,6 +47,11 @@ public enum Action * configuration. */ FORBIDDEN, + + /** + * Invalid TSL format + */ + INVALID_TSL_FORMAT, } private Action action; diff --git a/src/main/java/com/authlete/common/dto/TslResponse.java b/src/main/java/com/authlete/common/dto/TslResponse.java index 1883c78b22..7ec00285d5 100644 --- a/src/main/java/com/authlete/common/dto/TslResponse.java +++ b/src/main/java/com/authlete/common/dto/TslResponse.java @@ -34,9 +34,6 @@ public class TslResponse extends ApiResponse * The next action that the implementation of the TSL endpoint * should take after getting a response from Authlete's * {@code /tsl} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java index 79ec7e2682..4eb10cbd11 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java @@ -35,9 +35,6 @@ public class TslTokenStatusUpdateResponse extends ApiResponse { * The next action that the implementation of the token status update endpoint * should take after getting a response from Authlete's * {@code /tsl/token/status} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index 8ed6d248e2..d1f4ebc9df 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -24,7 +24,7 @@ * This class represents a request to pre-populate unused token indexes for a * particular service. These unused indexes are later consumed when issuing * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation - * of token indices within a Token Status List (TSL) environment. + * of token indexes within a Token Status List (TSL) environment. *

    * * @since 4.33 @@ -99,7 +99,4 @@ public long getUnusedTokenIndexAdd() return unusedTokenIndexesAdd; } - - - } diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java index 1347343782..ce38b5bae6 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java @@ -22,7 +22,7 @@ * This class represents a response to pre-populate unused token indexes for a * particular service. These unused indexes are later consumed when issuing * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation - * of token indices within a Token Status List (TSL) environment. + * of token indexes within a Token Status List (TSL) environment. *

    * * @since 4.33 @@ -37,14 +37,11 @@ public class TslUnusedIndexesResponse extends ApiResponse { * The next action that the implementation of the TSL unused indexes endpoint * should take after getting a response from Authlete's * {@code /tsl/unused/indexes} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { /** - * A TSL publish response has been prepared successfully. + * A TSL unused indexes has been populated successfully. */ OK, From 2a21b8f0f6d1a18bd704c057b9de72a6898998e1 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 7 Jan 2026 13:37:24 +0500 Subject: [PATCH 26/52] minor updates in variable names --- .../com/authlete/common/dto/TslUnusedIndexesRequest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index d1f4ebc9df..a345e9b1a7 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -54,7 +54,7 @@ public class TslUnusedIndexesRequest implements Serializable * @return * {@code this} object. */ - public TslUnusedIndexesRequest setUnusedTokenIndexLeft(long unusedTokenIndexesLeft) + public TslUnusedIndexesRequest setUnusedTokenIndexesLeft(long unusedTokenIndexesLeft) { this.unusedTokenIndexesLeft = unusedTokenIndexesLeft; @@ -67,7 +67,7 @@ public TslUnusedIndexesRequest setUnusedTokenIndexLeft(long unusedTokenIndexesLe * @return * The unused token indexes left value. */ - public long getUnusedTokenIndexLeft() + public long getUnusedTokenIndexesLeft() { return unusedTokenIndexesLeft; } @@ -81,7 +81,7 @@ public long getUnusedTokenIndexLeft() * @return * {@code this} object. */ - public TslUnusedIndexesRequest setUnusedTokenIndexAdd(long unusedTokenIndexesAdd) + public TslUnusedIndexesRequest setUnusedTokenIndexesAdd(long unusedTokenIndexesAdd) { this.unusedTokenIndexesAdd = unusedTokenIndexesAdd; @@ -94,7 +94,7 @@ public TslUnusedIndexesRequest setUnusedTokenIndexAdd(long unusedTokenIndexesAdd * @return * The unused token indexes add value. */ - public long getUnusedTokenIndexAdd() + public long getUnusedTokenIndexesAdd() { return unusedTokenIndexesAdd; } From f28e81b71234b2d9969f208f8444978183282ef1 Mon Sep 17 00:00:00 2001 From: Takahiko Kawasaki Date: Sat, 10 Jan 2026 14:28:30 +0900 Subject: [PATCH 27/52] feat: OID4VCI 1.0 Final / parameters for (deferred) credential responses (#154) --- CHANGES.ja.md | 17 ++ CHANGES.md | 17 ++ .../dto/CredentialDeferredIssueRequest.java | 264 +++++++++++++++++- .../dto/CredentialDeferredIssueResponse.java | 79 +++++- .../dto/CredentialDeferredParseResponse.java | 13 +- .../dto/CredentialSingleIssueRequest.java | 184 +++++++++++- .../dto/CredentialSingleIssueResponse.java | 9 +- 7 files changed, 559 insertions(+), 24 deletions(-) diff --git a/CHANGES.ja.md b/CHANGES.ja.md index c6c0f405d6..fadd1fa752 100644 --- a/CHANGES.ja.md +++ b/CHANGES.ja.md @@ -1,6 +1,23 @@ 変更点 ====== +- `CredentialDeferredIssueRequest` クラス + * `isDenied()` メソッドを追加。 + * `setDenied(boolean)` メソッドを追加。 + * `getInterval()` メソッドを追加。 + * `setInterval(int)` メソッドを追加。 + +- `CredentialDeferredIssueResponse.Action` 列挙型 + * `ACCEPTED` を追加。 + * `ACCEPTED_JWT` を追加。 + +- `CredentialSingleIssueRequest` クラス + * `isDenied()` メソッドを追加。 + * `setDenied(boolean)` メソッドを追加。 + * `getInterval()` メソッドを追加。 + * `setInterval(int)` メソッドを追加。 + + 4.34 (2026 年 01 月 03 日) -------------------------- diff --git a/CHANGES.md b/CHANGES.md index fda42bf121..0df2b86e13 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,23 @@ CHANGES ======= +- `CredentialDeferredIssueRequest` class + * Added the `isDenied()` method. + * Added the `setDenied(boolean)` method. + * Added the `getInterval()` method. + * Added the `setInterval(int)` method. + +- `CredentialDeferredIssueResponse.Action` enum + * Added `ACCEPTED`. + * Added `ACCEPTED_JWT`. + +- `CredentialSingleIssueRequest` class + * Added the `isDenied()` method. + * Added the `setDenied(boolean)` method. + * Added the `getInterval()` method. + * Added the `setInterval(int)` method. + + 4.34 (2026-01-03) ----------------- diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java index 586316c0d6..a8f419fa39 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Authlete, Inc. + * Copyright (C) 2023-2026 Authlete, Inc. * * 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 @@ -26,7 +26,7 @@ * The Authlete API is supposed to be called by the implementation of the * deferred credential endpoint. The endpoint is defined in the "OpenID for Verifiable Credential Issuance" (OID4VCI) specification. + * >OpenID for Verifiable Credential Issuance 1.0" (OID4VCI) specification. *

    * *

    @@ -41,14 +41,59 @@ * * *

    - * The role of the {@code /vci/deferred/issue} API is to issue a credential. + * The {@code /vci/deferred/issue} API is used for one of the following purposes: *

    * + *
      + *
    1. To issue a credential + *
    2. To deny the deferred credential request + *
    3. To notify that the requested credential is not ready yet + *
    + * + *

    Issuing a credential

    + * *

    - * If the credential for the transaction ID is not ready, the implementation - * of the deferred credential endpoint should prepare an error response with - * {@code "error":"issuance_pending"} manually and return it to the request - * sender, without calling the {@code /vci/deferred/issue} API. + * To issue a credential, the {@code order} request parameter must be set up + * properly, and both the {@code denied} and {@code order.issuanceDeferred} + * request parameters must be set to {@code false}. + *

    + * + *

    Denying a deferred credential request

    + * + *

    + * To deny the deferred credential request, the {@code denied} request parameter + * in the API call must be set to {@code true}. In this case, Authlete prepares + * a response containing {@code "error":"credential_request_denied"} and returns + * "action":"{@link CredentialDeferredIssueResponse.Action#BAD_REQUEST BAD_REQUEST}". + *

    + * + *

    + * Note that the {@code credential_request_denied} error code does not exist in + * OID4VCI 1.0 ID1. Therefore, you should not call the API with {@code denied} + * set to {@code true} when the target specification version is "1.0-ID1". + *

    + * + *

    Notifying that the credential is not ready yet

    + * + *

    + * To notify that the requested credential is not ready yet, the + * {@code order.issuanceDeferred} request parameter in the API call must be + * set to {@code true}. In this case, Authlete will do one of the following: + *

    + * + *
      + *
    1. + * Prepare an error response with the {@code issuance_pending} error code for + * OID4VCI 1.0 ID1. + *
    2. + * Prepare a successful response containing the {@code transaction_id} and + * {@code interval} parameters for OID4VCI 1.0 Final or later. + *
    + * + *

    + * Note that if the Authlete Server version is older than 3.0.25 and the target + * specification version is "1.0-ID1", you need to manually construct an error + * response as shown below, without using the {@code /vci/deferred/issue} API. *

    * *
    @@ -61,15 +106,38 @@
      * }
      * 
    * + *

    Interval handling

    + * + *

    + * If the {@code interval} request parameter in the API call is present and its + * value is positive, it is used as the value of the {@code interval} response + * parameter in the deferred credential response. If the {@code interval} + * request parameter is missing, zero, or negative, Authlete uses the default + * value. + *

    + * + *

    + * Note that the {@code interval} response parameter does not exist in OID4VCI + * 1.0 ID1. Therefore, you don't have to care about the {@code interval} request + * parameter if the target specification version is "1.0-ID1". + *

    + * + *

    Important note

    + * + *

    + * In all cases, the {@code order.requestIdentifier} request parameter must be + * set properly. + *

    + * * @since 3.70 * @since Authlete 3.0 * - * @see OpenID for Verifiable Credential Issuance + * @see + * OpenID for Verifiable Credential Issuance 1.0 */ public class CredentialDeferredIssueRequest implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2L; /** @@ -78,6 +146,26 @@ public class CredentialDeferredIssueRequest implements Serializable private CredentialIssuanceOrder order; + /** + * The flag that indicates whether to deny the deferred credential request. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + private boolean denied; + + + /** + * The minimum amount of time in seconds that the Wallet SHOULD wait after + * receiving the response before sending a new request to the Deferred + * Credential Endpoint. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + private int interval; + + /** * Get the credential order that provides an instruction for issuing a * credential. @@ -107,4 +195,160 @@ public CredentialDeferredIssueRequest setOrder(CredentialIssuanceOrder order) return this; } + + + /** + * Get the flag that indicates whether to deny the deferred credential + * request. + * + *

    + * If this parameter is set to {@code true}, the response content prepared + * by Authlete will contain {@code "error":"credential_request_denied"} + * like below. + *

    + * + *
    +     * {
    +     *     "error": "credential_request_denied"
    +     * }
    +     * 
    + * + *

    + * Note that the {@code credential_request_denied} error code does not + * exist in OID4VCI 1.0 ID1. + *

    + * + * @return + * {@code true} for generating a response content containing + * {@code "error":"credential_request_denied"}. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public boolean isDenied() + { + return denied; + } + + + /** + * Set the flag that indicates whether to deny the deferred credential + * request. + * + *

    + * If this parameter is set to {@code true}, the response content prepared + * by Authlete will contain {@code "error":"credential_request_denied"} + * like below. + *

    + * + *
    +     * {
    +     *     "error": "credential_request_denied"
    +     * }
    +     * 
    + * + *

    + * Note that the {@code credential_request_denied} error code does not + * exist in OID4VCI 1.0 ID1. + *

    + * + * @param denied + * {@code true} for generating a response content containing + * {@code "error":"credential_request_denied"}. + * + * @return + * {@code this} object. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public CredentialDeferredIssueRequest setDenied(boolean denied) + { + this.denied = denied; + + return this; + } + + + /** + * Get the minimum amount of time in seconds that the Wallet SHOULD wait + * after receiving the response before sending a new request to the + * Deferred Credential Endpoint. + * + *

    + * The value of this parameter is used as the value of the {@code interval} + * parameter in the deferred credential response. However, the + * {@code interval} parameter is included in the deferred credential + * response only when the following conditions are met: + *

    + * + *
      + *
    • + * The value of the {@code order.issuanceDeferred} request parameter is + * {@code true}. + *
    • + * + *
    • + * The version of the OID4VCI specification is 1.0-Final or later (that is, + * the {@code oid4vciVersion} property of {@link Service} is set and its + * value is not {@code "1.0-ID1"}). + *
    • + *
    + * + * @return + * The minimum amount of time in seconds that the Wallet SHOULD + * wait after receiving the response before sending a new request + * to the Deferred Credential Endpoint. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public int getInterval() + { + return interval; + } + + + /** + * Set the minimum amount of time in seconds that the Wallet SHOULD wait + * after receiving the response before sending a new request to the + * Deferred Credential Endpoint. + * + *

    + * The value of this parameter is used as the value of the {@code interval} + * parameter in the deferred credential response. However, the + * {@code interval} parameter is included in the deferred credential + * response only when the following conditions are met: + *

    + * + *
      + *
    • + * The value of the {@code order.issuanceDeferred} request parameter is + * {@code true}. + *
    • + * + *
    • + * The version of the OID4VCI specification is 1.0-Final or later (that is, + * the {@code oid4vciVersion} property of {@link Service} is set and its + * value is not {@code "1.0-ID1"}). + *
    • + *
    + * + * @param interval + * The minimum amount of time in seconds that the Wallet SHOULD + * wait after receiving the response before sending a new request + * to the Deferred Credential Endpoint. + * + * @return + * {@code this} object. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public CredentialDeferredIssueRequest setInterval(int interval) + { + this.interval = interval; + + return this; + } } diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java index e22a1efb37..3121285169 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Authlete, Inc. + * Copyright (C) 2023-2026 Authlete, Inc. * * 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 @@ -71,6 +71,51 @@ * * *
    + *

    {@code action} = {@link Action#ACCEPTED ACCEPTED}

    + * + *

    + * The {@code action} value {@link Action#ACCEPTED ACCEPTED} means that + * the requested credential is not ready yet. In this case, the + * implementation of the deferred credential endpoint should return a + * successful response to the request sender. The HTTP status code and the + * content type of the response should be 202 and {@code application/json}, + * respectively. The value of the {@code responseContent} parameter can + * be used as the message body of the response. It contains the + * "{@code transaction_id}" parameter that conforms to the specification + * of "Deferred Credential Response". + *

    + * + *
    + * HTTP/1.1 202 Accepted
    + * Content-Type: application/json
    + * Cache-Control: no-store
    + *
    + * (Put the value of the "responseContent" parameter here.)
    + * 
    + * + *
    + *

    {@code action} = {@link Action#ACCEPTED_JWT ACCEPTED_JWT}

    + * + *

    + * The {@code action} value {@link Action#ACCEPTED_JWT ACCEPTED_JWT} means + * that the requested credential is not ready yet and the deferred credential + * response should be encrypted. In this case, the implementation of the + * deferred credential endpoint should return a successful response to the + * request sender. The HTTP status code and the content type of the response + * should be 202 and {@code application/jwt}, respectively. The value of the + * {@code responseContent} parameter is an encrypted JWT and can be used + * as the message body of the response. + *

    + * + *
    + * HTTP/1.1 202 Accepted
    + * Content-Type: application/jwt
    + * Cache-Control: no-store
    + *
    + * (Put the value of the "responseContent" parameter here.)
    + * 
    + * + *
    *

    {@code action} = {@link Action#BAD_REQUEST BAD_REQUEST}

    * *

    @@ -169,7 +214,7 @@ */ public class CredentialDeferredIssueResponse extends ApiResponse { - private static final long serialVersionUID = 2L; + private static final long serialVersionUID = 3L; /** @@ -197,12 +242,42 @@ public enum Action */ OK_JWT, + /** + * The requested credential is not ready yet. The implementation of + * the deferred credential endpoint should return a successful response + * with the HTTP status code "202 Accepted" and the content type + * {@code application/json}. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + ACCEPTED, + + /** + * The requested credential is not ready yet and the deferred + * credential response should be encrypted. The implementation of the + * deferred credential endpoint should return a successful response + * with the HTTP status code "202 Accepted" and the content type + * {@code application/jwt}. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + ACCEPTED_JWT, + /** * The original deferred credential request is wrong. This can happen, * for example, when the process for encrypting the deferred credential * response with the encryption parameters specified in the deferred * credential request failed. * + *

    + * Since Authlete 3.0.25, this action is returned also when the + * credential issuer has decided not to issue a credential for the + * presented transaction ID (that is, when the {@code /vci/deferred/issue} + * API is called with {@code denied} set to {@code true}). + *

    + * * @since 3.86 */ BAD_REQUEST, diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredParseResponse.java b/src/main/java/com/authlete/common/dto/CredentialDeferredParseResponse.java index 778bfda188..3891482730 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredParseResponse.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredParseResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Authlete, Inc. + * Copyright (C) 2023-2026 Authlete, Inc. * * 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 @@ -33,14 +33,15 @@ * The {@code action} value {@link Action#OK OK} means that the deferred * credential request is valid. In this case, the implementation of the * deferred credential endpoint should call the {@code /vci/deferred/issue} - * API in order to issue a verifiable credential, or return the - * {@code issuance_pending} error if the verifiable credential is not ready - * yet. + * API in order to issue a verifiable credential, deny the deferred credential + * request, or notify that the requested credential is not ready yet. *

    * *

    - * The following is an example error response telling the request sender - * that the verifiable credential is not ready yet. + * Note that if the Authlete Server version is older than 3.0.25 and the + * target specification version is "1.0-ID1", you need to manually construct + * an error response containing {@code "error":"issuance_pending"}, as shown + * below, without using the {@code /vci/deferred/issue} API. *

    * *
    diff --git a/src/main/java/com/authlete/common/dto/CredentialSingleIssueRequest.java b/src/main/java/com/authlete/common/dto/CredentialSingleIssueRequest.java
    index a1a36d61af..e116ca52c3 100644
    --- a/src/main/java/com/authlete/common/dto/CredentialSingleIssueRequest.java
    +++ b/src/main/java/com/authlete/common/dto/CredentialSingleIssueRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (C) 2023 Authlete, Inc.
    + * Copyright (C) 2023-2026 Authlete, Inc.
      *
      * 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
    @@ -26,7 +26,7 @@
      * The Authlete API is supposed to be called by the implementation of the
      * credential endpoint. The endpoint is defined in the "OpenID for Verifiable Credential Issuance" (OID4VCI) specification.
    + * >OpenID for Verifiable Credential Issuance 1.0" (OID4VCI) specification.
      * 

    * *

    @@ -49,12 +49,12 @@ * @since 3.67 * @since Authlete 3.0 * - * @see OpenID for Verifiable Credential Issuance + * @see + * OpenID for Verifiable Credential Issuance 1.0 */ public class CredentialSingleIssueRequest implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2L; /** @@ -69,6 +69,26 @@ public class CredentialSingleIssueRequest implements Serializable private CredentialIssuanceOrder order; + /** + * The flag that indicates whether to deny the credential request. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + private boolean denied; + + + /** + * The minimum amount of time in seconds that the Wallet SHOULD wait after + * receiving the response before sending a new request to the Deferred + * Credential Endpoint. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + private int interval; + + /** * Get the access token that was presented at the credential endpoint. * @@ -127,4 +147,158 @@ public CredentialSingleIssueRequest setOrder(CredentialIssuanceOrder order) return this; } + + + /** + * Get the flag that indicates whether to deny the credential request. + * + *

    + * If this parameter is set to {@code true}, the response content prepared + * by Authlete will contain {@code "error":"credential_request_denied"} + * like below. + *

    + * + *
    +     * {
    +     *     "error": "credential_request_denied"
    +     * }
    +     * 
    + * + *

    + * Note that the {@code credential_request_denied} error code does not + * exist in OID4VCI 1.0 ID1. + *

    + * + * @return + * {@code true} for generating a response content containing + * {@code "error":"credential_request_denied"}. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public boolean isDenied() + { + return denied; + } + + + /** + * Set the flag that indicates whether to deny the credential request. + * + *

    + * If this parameter is set to {@code true}, the response content prepared + * by Authlete will contain {@code "error":"credential_request_denied"} + * like below. + *

    + * + *
    +     * {
    +     *     "error": "credential_request_denied"
    +     * }
    +     * 
    + * + *

    + * Note that the {@code credential_request_denied} error code does not + * exist in OID4VCI 1.0 ID1. + *

    + * + * @param denied + * {@code true} for generating a response content containing + * {@code "error":"credential_request_denied"}. + * + * @return + * {@code this} object. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public CredentialSingleIssueRequest setDenied(boolean denied) + { + this.denied = denied; + + return this; + } + + + /** + * Get the minimum amount of time in seconds that the Wallet SHOULD wait + * after receiving the response before sending a new request to the + * Deferred Credential Endpoint. + * + *

    + * The value of this parameter is used as the value of the {@code interval} + * parameter in the credential response. However, the {@code interval} + * parameter is included in the credential response only when the following + * conditions are met: + *

    + * + *
      + *
    • + * The value of the {@code order.issuanceDeferred} request parameter is + * {@code true}. + *
    • + * + *
    • + * The version of the OID4VCI specification is 1.0-Final or later (that is, + * the {@code oid4vciVersion} property of {@link Service} is set and its + * value is not {@code "1.0-ID1"}). + *
    • + *
    + * + * @return + * The minimum amount of time in seconds that the Wallet SHOULD + * wait after receiving the response before sending a new request + * to the Deferred Credential Endpoint. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public int getInterval() + { + return interval; + } + + + /** + * Set the minimum amount of time in seconds that the Wallet SHOULD wait + * after receiving the response before sending a new request to the + * Deferred Credential Endpoint. + * + *

    + * The value of this parameter is used as the value of the {@code interval} + * parameter in the credential response. However, the {@code interval} + * parameter is included in the credential response only when the following + * conditions are met: + *

    + * + *
      + *
    • + * The value of the {@code order.issuanceDeferred} request parameter is + * {@code true}. + *
    • + * + *
    • + * The version of the OID4VCI specification is 1.0-Final or later (that is, + * the {@code oid4vciVersion} property of {@link Service} is set and its + * value is not {@code "1.0-ID1"}). + *
    • + *
    + * + * @param interval + * The minimum amount of time in seconds that the Wallet SHOULD + * wait after receiving the response before sending a new request + * to the Deferred Credential Endpoint. + * + * @return + * {@code this} object. + * + * @since 4.35 + * @since Authlete 3.0.25 + */ + public CredentialSingleIssueRequest setInterval(int interval) + { + this.interval = interval; + + return this; + } } diff --git a/src/main/java/com/authlete/common/dto/CredentialSingleIssueResponse.java b/src/main/java/com/authlete/common/dto/CredentialSingleIssueResponse.java index c91f0f67d3..64940b10c6 100644 --- a/src/main/java/com/authlete/common/dto/CredentialSingleIssueResponse.java +++ b/src/main/java/com/authlete/common/dto/CredentialSingleIssueResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Authlete, Inc. + * Copyright (C) 2023-2026 Authlete, Inc. * * 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 @@ -292,6 +292,13 @@ public enum Action * with the encryption parameters specified in the credential request * failed. * + *

    + * Since Authlete 3.0.25, this action is returned also when the + * credential issuer has decided not to issue a credential for the + * presented transaction ID (that is, when the {@code /vci/single/issue} + * API is called with {@code denied} set to {@code true}). + *

    + * * @since 3.86 */ BAD_REQUEST, From 0a7a7fd40395bfeaa5ca6e5e57c30531c4a38710 Mon Sep 17 00:00:00 2001 From: Takahiko Kawasaki Date: Sat, 10 Jan 2026 14:29:52 +0900 Subject: [PATCH 28/52] Updated CHANGES files for version 4.35. --- CHANGES.ja.md | 3 +++ CHANGES.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.ja.md b/CHANGES.ja.md index fadd1fa752..10a058c208 100644 --- a/CHANGES.ja.md +++ b/CHANGES.ja.md @@ -1,6 +1,9 @@ 変更点 ====== +4.35 (2026 年 01 月 10 日) +-------------------------- + - `CredentialDeferredIssueRequest` クラス * `isDenied()` メソッドを追加。 * `setDenied(boolean)` メソッドを追加。 diff --git a/CHANGES.md b/CHANGES.md index 0df2b86e13..dce085556a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ CHANGES ======= +4.35 (2026-01-10) +----------------- + - `CredentialDeferredIssueRequest` class * Added the `isDenied()` method. * Added the `setDenied(boolean)` method. From 2c323ec73f0e9175b0c2e848c376ae1c647ddd3c Mon Sep 17 00:00:00 2001 From: Authlete OPS Date: Sat, 10 Jan 2026 05:32:50 +0000 Subject: [PATCH 29/52] [maven-release-plugin] prepare release authlete-java-common-4.35 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3fb1ac0426..688da75820 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.authlete authlete-java-common - 4.35-SNAPSHOT + 4.35 jar ${project.groupId}:${project.artifactId} @@ -39,7 +39,7 @@ ${git.connection} ${git.connection} ${git.url} - authlete-java-common-4.21 + authlete-java-common-4.35 From a5b5c8281bd1596c8632d9544de079d5ddeb9290 Mon Sep 17 00:00:00 2001 From: Authlete OPS Date: Sat, 10 Jan 2026 05:32:51 +0000 Subject: [PATCH 30/52] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 688da75820..b253790a59 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.authlete authlete-java-common - 4.35 + 4.36-SNAPSHOT jar ${project.groupId}:${project.artifactId} @@ -39,7 +39,7 @@ ${git.connection} ${git.connection} ${git.url} - authlete-java-common-4.35 + authlete-java-common-4.21 From 4e5d83b7026a41c6fa80fdbe3c00dd210685ab1b Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 14 Jan 2026 21:37:31 +0500 Subject: [PATCH 31/52] uncomment plugin tag in the pom.xml file --- pom.xml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 038d6e4fe2..24682b2364 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + E834481D + ${env.GPG_PASSPHRASE} + + --pinentry-mode + loopback + + + + + org.codehaus.mojo From 5bdc3e497e47af022e68ed39e7a98ad2445f674e Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Thu, 22 Jan 2026 17:20:23 +0500 Subject: [PATCH 32/52] new action added --- src/main/java/com/authlete/common/dto/TslResponse.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/authlete/common/dto/TslResponse.java b/src/main/java/com/authlete/common/dto/TslResponse.java index 7ec00285d5..c715f9e06f 100644 --- a/src/main/java/com/authlete/common/dto/TslResponse.java +++ b/src/main/java/com/authlete/common/dto/TslResponse.java @@ -52,6 +52,11 @@ public enum Action * Invalid TSL format */ INVALID_TSL_FORMAT, + + /** + * TSL not found + */ + NO_TSL_FOUND } private Action action; From 7bcdb2cd3deb88b430001529a3c8d81293e5f4aa Mon Sep 17 00:00:00 2001 From: "bilal.ashraf" Date: Sat, 25 Oct 2025 00:44:47 +0500 Subject: [PATCH 33/52] tsl support in progress --- .idea/.gitignore | 3 + .idea/compiler.xml | 13 ++ .idea/encodings.xml | 7 + .idea/jarRepositories.xml | 20 +++ .idea/misc.xml | 12 ++ .idea/vcs.xml | 6 + pom.xml | 44 +++--- .../dto/CredentialDeferredIssueRequest.java | 3 - .../dto/CredentialDeferredIssueResponse.java | 6 + .../java/com/authlete/common/dto/Service.java | 62 +++++++- .../authlete/common/dto/TslConfigData.java | 133 ++++++++++++++++++ .../common/types/TslPublishFormat.java | 113 +++++++++++++++ 12 files changed, 393 insertions(+), 29 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 src/main/java/com/authlete/common/dto/TslConfigData.java create mode 100644 src/main/java/com/authlete/common/types/TslPublishFormat.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..26d33521af --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000000..cca8335003 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000000..aa00ffab78 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000000..712ab9d985 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000..9e0563eb9c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..35eb1ddfbb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index b253790a59..e38080d82f 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 3.1.0 - - - sign-artifacts - verify - - sign - - - E834481D - ${env.GPG_PASSPHRASE} - - --pinentry-mode - loopback - - - - - + + + + + + + + + + + + + + + + + + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java index a8f419fa39..c70f4e5c8a 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java @@ -165,7 +165,6 @@ public class CredentialDeferredIssueRequest implements Serializable */ private int interval; - /** * Get the credential order that provides an instruction for issuing a * credential. @@ -196,7 +195,6 @@ public CredentialDeferredIssueRequest setOrder(CredentialIssuanceOrder order) return this; } - /** * Get the flag that indicates whether to deny the deferred credential * request. @@ -269,7 +267,6 @@ public CredentialDeferredIssueRequest setDenied(boolean denied) return this; } - /** * Get the minimum amount of time in seconds that the Wallet SHOULD wait * after receiving the response before sending a new request to the diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java index 3121285169..e643dc84fd 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java @@ -297,6 +297,12 @@ public enum Action * The API call is invalid. */ CALLER_ERROR, + + /** + * The deferred credential request does not contain the access token or + * the access token is invalid. + */ + UNAUTHORIZED, } diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 9bd957527e..7aae57e443 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1980,6 +1980,26 @@ public class Service implements Serializable */ private boolean httpAliasProhibited; + /** + * The flag indicating whether the feature of Trust status list publishing for + * this service is enabled or not. + * + * @since TODO + * @since Authlete TODO + */ + private boolean tslPublishingEnabled; + + + /** + * Trust status list configuration data. + * + * @since TODO + * @since Authlete TODO + * + * @see + * Trust Status List + */ + private TslConfigData tslConfigData; /** * Get the service number. @@ -12117,7 +12137,6 @@ public Service setNativeSsoSupported(boolean supported) return this; } - /** * Get the version of the OpenID for Verifiable Credential Issuance * specification to support. @@ -12228,6 +12247,17 @@ public Service setOid4vciVersion(String version) return this; } + public Service setTslPublishingEnabled(boolean tslPublishingEnabled) + { + this.tslPublishingEnabled = tslPublishingEnabled; + + return this; + } + + public boolean isTslPublishingEnabled() + { + return tslPublishingEnabled; + } /** * Get the flag to determine to support + * Trust Status List + */ + public Service setTslConfigData(TslConfigData tslConfigData) + { + this.tslConfigData = tslConfigData; + + return this; + } /** * Get the flag that indicates whether the allowlist for client IDs @@ -13015,10 +13059,20 @@ public boolean isHttpAliasProhibited() * @see * OAuth Client ID Metadata Document */ - public Service setHttpAliasProhibited(boolean prohibited) - { + public Service setHttpAliasProhibited(boolean prohibited) { this.httpAliasProhibited = prohibited; return this; } + + /** + * Retrieves the {@link TslConfigData} associated with this service. + * + * @return the current {@link TslConfigData} + */ + public TslConfigData getTslConfigData() + { + return tslConfigData; + + } } diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java new file mode 100644 index 0000000000..94cb390d8f --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -0,0 +1,133 @@ +package com.authlete.common.dto; + +import com.authlete.common.types.TslPublishFormat; + +import java.io.Serializable; +import java.net.URI; + +/** + * A class that represents trust status list configurations data + * The set consists of the following. + * + *
      + *
    • {@code format} + *
    • {@code validity} + *
    • {@code publishFrequency} + *
    • {@code timeToLive} + *
    • {@code publishEndpoint} + *
    + * + * @since TODO + * @since Authlete TODO + * + * @see Token Status List (TSL) + */ +public class TslConfigData implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported + * + * @since TODO + */ + private TslPublishFormat format; + + /** + * The validity of the TSL in hours + * + * @since TODO + */ + private int validity; + + /** + * Publish TSL after every X hours + * + * @since TODO + */ + private int publishFrequency; + + /** + * Time to live in hours which provides indication to verifiers to cache this TSL + * + * @since TODO + */ + private int timeToLive; + + /** + * Endpoint where to publish this TSL + * + * @since TODO + */ + private URI publishEndpoint; + + /** + * The default constructor. + */ + public TslConfigData() { + } + + /** + * Copy constructor. + * + * @param tslConfigData + * Source to copy data from. {@code null} won't raise any exception. + */ + public TslConfigData(TslConfigData tslConfigData) { + if (tslConfigData == null) { + return; + } + format = tslConfigData.getFormat(); + validity = tslConfigData.getValidity(); + publishFrequency = tslConfigData.getPublishFrequency(); + timeToLive = tslConfigData.getTimeToLive(); + publishEndpoint = tslConfigData.getPublishEndpoint(); + } + + public TslConfigData setFormat(TslPublishFormat format) { + this.format = format; + + return this; + } + public TslPublishFormat getFormat() { + return format; + } + + public TslConfigData setValidity(int validity) { + this.validity = validity; + + return this; + } + public int getValidity() { + return validity; + } + + public TslConfigData setPublishFrequency(int publishFrequency) { + this.publishFrequency = publishFrequency; + + return this; + } + public int getPublishFrequency() { + return publishFrequency; + } + + public TslConfigData setTimeToLive(int timeToLive) { + this.timeToLive = timeToLive; + + return this; + } + public int getTimeToLive() { + return timeToLive; + } + + public TslConfigData setPublishEndpoint(URI publishEndpoint) { + this.publishEndpoint = publishEndpoint; + + return this; + } + public URI getPublishEndpoint() { + return publishEndpoint; + } +} + diff --git a/src/main/java/com/authlete/common/types/TslPublishFormat.java b/src/main/java/com/authlete/common/types/TslPublishFormat.java new file mode 100644 index 0000000000..d493a3ba5e --- /dev/null +++ b/src/main/java/com/authlete/common/types/TslPublishFormat.java @@ -0,0 +1,113 @@ +package com.authlete.common.types; + +import java.util.EnumSet; + +public enum TslPublishFormat { + + /** + * Currently jwt is supported. TSL publishing cwt format will be supported in the next iteration + */ + JWT((short)1, "jwt"); + + + private static final TslPublishFormat[] sValues = values(); + private static final TslPublishFormat.Helper sHelper = new TslPublishFormat.Helper(sValues); + private final short mValue; + private final String mString; + + + private TslPublishFormat(short value, String string) + { + mValue = value; + mString = string; + } + + + /** + * Get the integer representation of this enum instance. + */ + public short getValue() + { + return mValue; + } + + + /** + * Find an instance of this enum by a value. + * + * @param value + * The integer representation of the instance to find. + * + * @return + * An instance of this enum, or {@code null} if not found. + */ + public static TslPublishFormat getByValue(short value) + { + if (value < 1 || sValues.length < value) + { + // Not found. + return null; + } + + return sValues[value - 1]; + } + + + /** + * Get the string value of TSL publish format. + * + * @return + * A string that contains TSL publish format. + */ + public String getString() + { + return mString; + } + + + public static int toBits(EnumSet set) + { + return sHelper.toBits(set); + } + + + public static TslPublishFormat[] toArray(int bits) + { + return sHelper.toArray(bits); + } + + + public static EnumSet toSet(int bits) + { + return sHelper.toSet(bits); + } + + + public static EnumSet toSet(TslPublishFormat[] array) + { + return sHelper.toSet(array); + } + + + private static class Helper extends EnumHelper + { + public Helper(TslPublishFormat[] values) + { + super(TslPublishFormat.class, values); + } + + + @Override + protected short getValue(TslPublishFormat entry) + { + return entry.getValue(); + } + + + @Override + protected TslPublishFormat[] newArray(int size) + { + return new TslPublishFormat[size]; + } + } +} From b7158e0ee1dc0b021eabf8b8bc80c053b528aca0 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Fri, 28 Nov 2025 17:59:44 +0500 Subject: [PATCH 34/52] tsl support --- .../java/com/authlete/common/dto/Service.java | 39 +++- .../authlete/common/dto/TslConfigData.java | 166 ++++++++++++++---- .../common/dto/TslEntriesResponse.java | 54 ++++++ .../com/authlete/common/dto/TslEntry.java | 57 ++++++ .../authlete/common/dto/TslGetRequest.java | 19 ++ .../authlete/common/dto/TslGetResponse.java | 28 +++ .../dto/TslPopulateUnusedIndexesRequest.java | 23 +++ .../authlete/common/dto/TslPublishConfig.java | 36 ++++ .../common/dto/TslPublishConfigsResponse.java | 21 +++ .../common/dto/TslPublishRequest.java | 19 ++ .../dto/TslTokenStatusUpdateRequest.java | 41 +++++ .../authlete/common/types/TslTokenStatus.java | 110 ++++++++++++ 12 files changed, 576 insertions(+), 37 deletions(-) create mode 100644 src/main/java/com/authlete/common/dto/TslEntriesResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslEntry.java create mode 100644 src/main/java/com/authlete/common/dto/TslGetRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslGetResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfig.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java create mode 100644 src/main/java/com/authlete/common/types/TslTokenStatus.java diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 7aae57e443..2d863bf1d7 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1984,19 +1984,19 @@ public class Service implements Serializable * The flag indicating whether the feature of Trust status list publishing for * this service is enabled or not. * - * @since TODO - * @since Authlete TODO + * @since 4.30 + * @since Authlete 3.1 */ private boolean tslPublishingEnabled; /** - * Trust status list configuration data. + * TSL configuration data. * - * @since TODO - * @since Authlete TODO + * @since 4.30 + * @since Authlete 3.1 * - * @see + * @see * Trust Status List */ private TslConfigData tslConfigData; @@ -12247,6 +12247,16 @@ public Service setOid4vciVersion(String version) return this; } + /* + * Sets whether TSL publishing is enabled for this service. + * + * @param tslPublishingEnabled {@code true} to enable TSL publishing; + * {@code false} to disable it. + * @return this {@link Service} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) { this.tslPublishingEnabled = tslPublishingEnabled; @@ -12254,6 +12264,15 @@ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) return this; } + /** + * Get the flag indicating whether the feature of TSL publishing + * for this service is enabled or not. + * + * @return {@code true} if the feature of TSL publishing is enabled. + * + * @since 4.30 + * @since Authlete 3.1 + */ public boolean isTslPublishingEnabled() { return tslPublishingEnabled; @@ -12318,7 +12337,10 @@ public Service setClientIdMetadataDocumentSupported(boolean supported) * @param tslConfigData the configuration data to be applied * @return this {@code Service} instance for method chaining * - * @see + * @since 4.30 + * @since Authlete 3.1 + * + * @see * Trust Status List */ public Service setTslConfigData(TslConfigData tslConfigData) @@ -13069,6 +13091,9 @@ public Service setHttpAliasProhibited(boolean prohibited) { * Retrieves the {@link TslConfigData} associated with this service. * * @return the current {@link TslConfigData} + * + * @since 4.30 + * @since Authlete 3.1 */ public TslConfigData getTslConfigData() { diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 94cb390d8f..1bf9b4dcf7 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -6,7 +6,7 @@ import java.net.URI; /** - * A class that represents trust status list configurations data + * A class that represents TSL configurations data * The set consists of the following. * *
      @@ -17,48 +17,54 @@ *
    • {@code publishEndpoint} *
    * - * @since TODO - * @since Authlete TODO + * @since 4.30 + * @since Authlete 3.1 * - * @see Token Status List (TSL) */ -public class TslConfigData implements Serializable { +public class TslConfigData implements Serializable +{ private static final long serialVersionUID = 1L; /** * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ private TslPublishFormat format; /** * The validity of the TSL in hours * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ - private int validity; + private long validity; /** * Publish TSL after every X hours * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ - private int publishFrequency; + private long publishFrequency; /** * Time to live in hours which provides indication to verifiers to cache this TSL * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ - private int timeToLive; + private long timeToLive; /** * Endpoint where to publish this TSL * - * @since TODO + * @since 4.30 + * @since Authlete 3.1 */ private URI publishEndpoint; @@ -70,12 +76,11 @@ public TslConfigData() { /** * Copy constructor. - * - * @param tslConfigData - * Source to copy data from. {@code null} won't raise any exception. */ - public TslConfigData(TslConfigData tslConfigData) { - if (tslConfigData == null) { + public TslConfigData(TslConfigData tslConfigData) + { + if (tslConfigData == null) + { return; } format = tslConfigData.getFormat(); @@ -85,49 +90,150 @@ public TslConfigData(TslConfigData tslConfigData) { publishEndpoint = tslConfigData.getPublishEndpoint(); } - public TslConfigData setFormat(TslPublishFormat format) { + /** + * Sets the TSL publish format. + * + * @param format the {@link TslPublishFormat} to use for publishing. + * + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setFormat(TslPublishFormat format) + { this.format = format; return this; } - public TslPublishFormat getFormat() { + + /** + * Returns the configured TSL publish format. + * + * @return the {@link TslPublishFormat} in use. + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslPublishFormat getFormat() + { return format; } - public TslConfigData setValidity(int validity) { + /** + * Sets the validity period for the TSL in hours. + * + * @param validity the validity duration + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setValidity(long validity) { this.validity = validity; return this; } - public int getValidity() { + + /** + * Returns the validity period of the TSL. + * + * @return the validity duration + * + * @since 4.30 + * @since Authlete 3.1 + */ + public long getValidity() + { return validity; } - public TslConfigData setPublishFrequency(int publishFrequency) { + /** + * Sets the frequency in hours at which the TSL should be published. + * + * @param publishFrequency the publishing frequency + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + * + */ + public TslConfigData setPublishFrequency(long publishFrequency) + { this.publishFrequency = publishFrequency; return this; } - public int getPublishFrequency() { + + /** + * Returns the publish frequency of the TSL. + * + * @return the publishing frequency + * + * @since 4.30 + * @since Authlete 3.1 + */ + public long getPublishFrequency() + { return publishFrequency; } - public TslConfigData setTimeToLive(int timeToLive) { + /** + * Sets the time to live in hours which provides indication to verifiers to cache this TSL + * + * @param timeToLive the TTL value + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setTimeToLive(long timeToLive) + { this.timeToLive = timeToLive; return this; } - public int getTimeToLive() { + + /** + * Returns the time-to-live (TTL) in hours value for the TSL. + * + * @return the TTL value + * + * @since 4.30 + * @since Authlete 3.1 + */ + public long getTimeToLive() + { return timeToLive; } - public TslConfigData setPublishEndpoint(URI publishEndpoint) { + /** + * Sets the endpoint URI where the TSL will be published. + * + * @param publishEndpoint the publish endpoint URI. + * + * @return this {@link TslConfigData} instance for method chaining + * + * @since 4.30 + * @since Authlete 3.1 + */ + public TslConfigData setPublishEndpoint(URI publishEndpoint) + { this.publishEndpoint = publishEndpoint; return this; } - public URI getPublishEndpoint() { + + /** + * Returns the endpoint URI where the TSL is published. + * + * @return the publish endpoint URI. + * + * @since 4.30 + * @since Authlete 3.1 + */ + public URI getPublishEndpoint() + { return publishEndpoint; } -} - +} \ No newline at end of file diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java new file mode 100644 index 0000000000..3409d1e159 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -0,0 +1,54 @@ +package com.authlete.common.dto; + +public class TslEntriesResponse { + + private static final long serialVersionUID = 1L; + + private int start; + + private int end; + + private int totalCount; + + private TslEntry[] tslEntries; + + public TslEntriesResponse setStart(int start) { + this.start = start; + + return this; + } + + public int getStart() { + return start; + } + + public TslEntriesResponse setEnd(int end) { + this.end = end; + + return this; + } + + public int getEnd() { + return end; + } + + public TslEntriesResponse setTotalCount(int totalCount) { + this.totalCount = totalCount; + + return this; + } + + public int getTotalCount() { + return totalCount; + } + + public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) { + this.tslEntries = tslEntries; + + return this; + } + + public TslEntry[] getTslEntries() { + return tslEntries; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java new file mode 100644 index 0000000000..ee4c95cbc2 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -0,0 +1,57 @@ +package com.authlete.common.dto; + +import com.authlete.common.types.TslTokenStatus; + +public class TslEntry { + + private static final long serialVersionUID = 1L; + + private int tokenIndex; + + private String tokenId; + + private TslTokenStatus tokenStatus; + + private boolean isUsed; + + public TslEntry setTokenIndex(int tokenIndex) { + this.tokenIndex = tokenIndex; + + return this; + } + + public int getTokenIndex() { + return tokenIndex; + } + + public TslEntry setTokenId(String tokenId) { + this.tokenId = tokenId; + + return this; + } + + public String getTokenId() { + return tokenId; + } + + public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { + this.tokenStatus = tokenStatus; + + return this; + } + + public TslTokenStatus getTokenStatus() { + return tokenStatus; + } + + public TslEntry setIsUsed(boolean isUsed) { + this.isUsed = isUsed; + + return this; + } + + public boolean isUsed() { + return isUsed; + } + +} diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/TslGetRequest.java new file mode 100644 index 0000000000..4695efdf99 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslGetRequest.java @@ -0,0 +1,19 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +public class TslGetRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } +} + diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/TslGetResponse.java new file mode 100644 index 0000000000..a86d614fbf --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslGetResponse.java @@ -0,0 +1,28 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +public class TslGetResponse implements Serializable { + + private static final long serialVersionUID = 1L; + + private String format; + + private String tsl; + + public void setFormat(String format) { + this.format = format; + } + + public String getFormat() { + return format; + } + + public void setTsl(String tsl) { + this.tsl = tsl; + } + + public String getTsl() { + return tsl; + } + } diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java new file mode 100644 index 0000000000..71bc711fed --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java @@ -0,0 +1,23 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +/** + * A request to Authlete's {@code /service/populate/unused/indexes} API. + * + * @since TODO + */ +public class TslPopulateUnusedIndexesRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java new file mode 100644 index 0000000000..dcc38195c1 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -0,0 +1,36 @@ +package com.authlete.common.dto; + +/** + * This DTO holds the information when next TSL will be published + * per service. + * + * @since TODO + */ +public class TslPublishConfig { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + /** + * It specifies the time when next TSL will be published. It is in seconds + */ + private long nextTslPublishTime; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } + + public void setNextTslPublishTime(long nextTslPublishTime) { + this.nextTslPublishTime = nextTslPublishTime; + } + + public long getNextTslPublishTime() { + return nextTslPublishTime; + } + +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java new file mode 100644 index 0000000000..ef0e554456 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -0,0 +1,21 @@ +package com.authlete.common.dto; + +/** + * Response from Authlete's {@code service/tsl/publish/configs} API. + * + * @since TODO + */ +public class TslPublishConfigsResponse extends ApiResponse { + + private static final long serialVersionUID = 1L; + + private TslPublishConfig[] tslPublishConfigs; + + public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { + this.tslPublishConfigs = tslPublishConfigs; + } + + public TslPublishConfig[] getTslPublishConfigs() { + return tslPublishConfigs; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java new file mode 100644 index 0000000000..616845aad5 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -0,0 +1,19 @@ +package com.authlete.common.dto; + +import java.io.Serializable; + +public class TslPublishRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private int serviceNumber; + + public void setServiceNumber(int serviceNumber) { + this.serviceNumber = serviceNumber; + } + + public int getServiceNumber() { + return serviceNumber; + } +} + diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java new file mode 100644 index 0000000000..af836505ac --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -0,0 +1,41 @@ +package com.authlete.common.dto; + +import com.authlete.common.types.TslTokenStatus; + +import java.io.Serializable; + +public class TslTokenStatusUpdateRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + private String tokenId; + + private TslTokenStatus tokenStatus; + + private int tokenIndex; + + public void setTokenId(String tokenId) { + this.tokenId = tokenId; + } + + public String getSubject() { + return tokenId; + } + + public void setTokenStatus(TslTokenStatus tokenStatus) { + this.tokenStatus = tokenStatus; + } + + public TslTokenStatus getTokenStatus() { + return tokenStatus; + } + + public void setTokenIndex(int tokenIndex) { + this.tokenIndex = tokenIndex; + } + + public int getIndex() { + return tokenIndex; + } + +} diff --git a/src/main/java/com/authlete/common/types/TslTokenStatus.java b/src/main/java/com/authlete/common/types/TslTokenStatus.java new file mode 100644 index 0000000000..ff8d63867e --- /dev/null +++ b/src/main/java/com/authlete/common/types/TslTokenStatus.java @@ -0,0 +1,110 @@ +package com.authlete.common.types; + +import java.util.EnumSet; + +public enum TslTokenStatus { + + VALID((short)0, "valid"), + INVALID((short)1, "invalid"), + SUSPENDED((short)2, "suspended"); + + + private static final TslTokenStatus[] sValues = values(); + private static final TslTokenStatus.Helper sHelper = new TslTokenStatus.Helper(sValues); + private final short mValue; + private final String mString; + + + private TslTokenStatus(short value, String string) { + mValue = value; + mString = string; + } + + + /** + * Get the integer representation of this enum instance. + */ + public short getValue() { + return mValue; + } + + + /** + * Find an instance of this enum by a value. + * + * @param value + * The integer representation of the instance to find. + * + * @return + * An instance of this enum, or {@code null} if not found. + */ + public static TslTokenStatus getByValue(short value) + { + if (value < 1 || sValues.length < value) + { + // Not found. + return null; + } + + return sValues[value - 1]; + } + + + /** + * Get the string value of TSL token status. + * + * @return + * A string that contains TSL token status. + */ + public String getString() + { + return mString; + } + + + public static int toBits(EnumSet set) + { + return sHelper.toBits(set); + } + + + public static TslTokenStatus[] toArray(int bits) + { + return sHelper.toArray(bits); + } + + + public static EnumSet toSet(int bits) + { + return sHelper.toSet(bits); + } + + + public static EnumSet toSet(TslTokenStatus[] array) + { + return sHelper.toSet(array); + } + + + private static class Helper extends EnumHelper + { + public Helper(TslTokenStatus[] values) + { + super(TslTokenStatus.class, values); + } + + + @Override + protected short getValue(TslTokenStatus entry) + { + return entry.getValue(); + } + + + @Override + protected TslTokenStatus[] newArray(int size) + { + return new TslTokenStatus[size]; + } + } +} From 8dd97ca892fb5a05227d38981b4eecbbb1da9be1 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 1 Dec 2025 17:05:13 +0500 Subject: [PATCH 35/52] property name update --- .../com/authlete/common/dto/TslTokenStatusUpdateRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index af836505ac..344a41bca3 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -18,7 +18,7 @@ public void setTokenId(String tokenId) { this.tokenId = tokenId; } - public String getSubject() { + public String getTokenId() { return tokenId; } From a75b807b8103362c26281a1a37eb05222b90037b Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 17:14:09 +0500 Subject: [PATCH 36/52] version update --- .../java/com/authlete/common/dto/Service.java | 8 +-- .../authlete/common/dto/TslConfigData.java | 64 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 2d863bf1d7..19b15dc15e 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1984,8 +1984,8 @@ public class Service implements Serializable * The flag indicating whether the feature of Trust status list publishing for * this service is enabled or not. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private boolean tslPublishingEnabled; @@ -1993,8 +1993,8 @@ public class Service implements Serializable /** * TSL configuration data. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * * @see * Trust Status List diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 1bf9b4dcf7..9d5a06328f 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -17,8 +17,8 @@ *
  • {@code publishEndpoint} * * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * * @see Token Status List (TSL) @@ -31,40 +31,40 @@ public class TslConfigData implements Serializable /** * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private TslPublishFormat format; /** * The validity of the TSL in hours * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private long validity; /** * Publish TSL after every X hours * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private long publishFrequency; /** * Time to live in hours which provides indication to verifiers to cache this TSL * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private long timeToLive; /** * Endpoint where to publish this TSL * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ private URI publishEndpoint; @@ -97,8 +97,8 @@ public TslConfigData(TslConfigData tslConfigData) * * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setFormat(TslPublishFormat format) { @@ -112,8 +112,8 @@ public TslConfigData setFormat(TslPublishFormat format) * * @return the {@link TslPublishFormat} in use. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslPublishFormat getFormat() { @@ -126,8 +126,8 @@ public TslPublishFormat getFormat() * @param validity the validity duration * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setValidity(long validity) { this.validity = validity; @@ -140,8 +140,8 @@ public TslConfigData setValidity(long validity) { * * @return the validity duration * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public long getValidity() { @@ -154,8 +154,8 @@ public long getValidity() * @param publishFrequency the publishing frequency * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * */ public TslConfigData setPublishFrequency(long publishFrequency) @@ -170,8 +170,8 @@ public TslConfigData setPublishFrequency(long publishFrequency) * * @return the publishing frequency * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public long getPublishFrequency() { @@ -184,8 +184,8 @@ public long getPublishFrequency() * @param timeToLive the TTL value * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setTimeToLive(long timeToLive) { @@ -199,8 +199,8 @@ public TslConfigData setTimeToLive(long timeToLive) * * @return the TTL value * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public long getTimeToLive() { @@ -214,8 +214,8 @@ public long getTimeToLive() * * @return this {@link TslConfigData} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { @@ -229,8 +229,8 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) * * @return the publish endpoint URI. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public URI getPublishEndpoint() { From be8dbc6f665c9d9beda5d469ba9c853c1d1d9a46 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 19:30:25 +0500 Subject: [PATCH 37/52] improved code commenting and refactoring --- .idea/compiler.xml | 4 +- .../java/com/authlete/common/dto/Service.java | 16 ++-- .../authlete/common/dto/TslConfigData.java | 88 ------------------- .../common/dto/TslEntriesResponse.java | 34 +++++++ .../com/authlete/common/dto/TslEntry.java | 55 +++++++++--- .../authlete/common/dto/TslGetRequest.java | 31 ++++++- .../authlete/common/dto/TslGetResponse.java | 34 +++++-- .../dto/TslPopulateUnusedIndexesRequest.java | 23 +++-- .../authlete/common/dto/TslPublishConfig.java | 16 +++- .../common/dto/TslPublishConfigsResponse.java | 31 +++++-- .../common/dto/TslPublishRequest.java | 31 ++++++- .../dto/TslTokenStatusUpdateRequest.java | 60 +++++++++++-- 12 files changed, 282 insertions(+), 141 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index cca8335003..df3ef2ec63 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,8 +6,10 @@ - + + + \ No newline at end of file diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 19b15dc15e..7f0604bc8e 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -12254,8 +12254,8 @@ public Service setOid4vciVersion(String version) * {@code false} to disable it. * @return this {@link Service} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) { @@ -12270,8 +12270,8 @@ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) * * @return {@code true} if the feature of TSL publishing is enabled. * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public boolean isTslPublishingEnabled() { @@ -12337,8 +12337,8 @@ public Service setClientIdMetadataDocumentSupported(boolean supported) * @param tslConfigData the configuration data to be applied * @return this {@code Service} instance for method chaining * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 * * @see * Trust Status List @@ -13092,8 +13092,8 @@ public Service setHttpAliasProhibited(boolean prohibited) { * * @return the current {@link TslConfigData} * - * @since 4.30 - * @since Authlete 3.1 + * @since 4.31 + * @since Authlete 3.0.22 */ public TslConfigData getTslConfigData() { diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 9d5a06328f..e47a54abd8 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -90,16 +90,6 @@ public TslConfigData(TslConfigData tslConfigData) publishEndpoint = tslConfigData.getPublishEndpoint(); } - /** - * Sets the TSL publish format. - * - * @param format the {@link TslPublishFormat} to use for publishing. - * - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setFormat(TslPublishFormat format) { this.format = format; @@ -107,57 +97,22 @@ public TslConfigData setFormat(TslPublishFormat format) return this; } - /** - * Returns the configured TSL publish format. - * - * @return the {@link TslPublishFormat} in use. - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslPublishFormat getFormat() { return format; } - /** - * Sets the validity period for the TSL in hours. - * - * @param validity the validity duration - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setValidity(long validity) { this.validity = validity; return this; } - /** - * Returns the validity period of the TSL. - * - * @return the validity duration - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public long getValidity() { return validity; } - /** - * Sets the frequency in hours at which the TSL should be published. - * - * @param publishFrequency the publishing frequency - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - * - */ public TslConfigData setPublishFrequency(long publishFrequency) { this.publishFrequency = publishFrequency; @@ -165,28 +120,11 @@ public TslConfigData setPublishFrequency(long publishFrequency) return this; } - /** - * Returns the publish frequency of the TSL. - * - * @return the publishing frequency - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public long getPublishFrequency() { return publishFrequency; } - /** - * Sets the time to live in hours which provides indication to verifiers to cache this TSL - * - * @param timeToLive the TTL value - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setTimeToLive(long timeToLive) { this.timeToLive = timeToLive; @@ -194,29 +132,11 @@ public TslConfigData setTimeToLive(long timeToLive) return this; } - /** - * Returns the time-to-live (TTL) in hours value for the TSL. - * - * @return the TTL value - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public long getTimeToLive() { return timeToLive; } - /** - * Sets the endpoint URI where the TSL will be published. - * - * @param publishEndpoint the publish endpoint URI. - * - * @return this {@link TslConfigData} instance for method chaining - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { this.publishEndpoint = publishEndpoint; @@ -224,14 +144,6 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) return this; } - /** - * Returns the endpoint URI where the TSL is published. - * - * @return the publish endpoint URI. - * - * @since 4.31 - * @since Authlete 3.0.22 - */ public URI getPublishEndpoint() { return publishEndpoint; diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java index 3409d1e159..d968da6915 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -1,15 +1,49 @@ package com.authlete.common.dto; +/** + * Response from Authlete's {@code /tsl/entries/list} API. + * + * This class contains list of TSL token entries. + * + * @since 4.31 + * @since Authlete 3.0.22 + * + */ public class TslEntriesResponse { private static final long serialVersionUID = 1L; + /** + * The start index (inclusive) for the result set of the query. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int start; + /** + * The end index (exclusive) for the result set of the query. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int end; + /** + * Total count of the entries + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int totalCount; + /** + * TSL token entries + * + * @since 4.31 + * @since Authlete 3.0.22 + */ + private TslEntry[] tslEntries; public TslEntriesResponse setStart(int start) { diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java index ee4c95cbc2..7ba2446aa6 100644 --- a/src/main/java/com/authlete/common/dto/TslEntry.java +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -2,56 +2,89 @@ import com.authlete.common.types.TslTokenStatus; -public class TslEntry { - +/** + * This class contains token entries on which to build the TSL + * + * @since 4.31 + * @since Authlete 3.0.22 + * + */ +public class TslEntry +{ private static final long serialVersionUID = 1L; + /** + * Token index that represents the token in the issued VC/token. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int tokenIndex; + /** + * Unique ID assigned to each issued VC/token. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String tokenId; + /** + * Current status of the issued VC/token. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ + private TslTokenStatus tokenStatus; private boolean isUsed; - public TslEntry setTokenIndex(int tokenIndex) { + public TslEntry setTokenIndex(int tokenIndex) + { this.tokenIndex = tokenIndex; return this; } - public int getTokenIndex() { + public int getTokenIndex() + { return tokenIndex; } - public TslEntry setTokenId(String tokenId) { + public TslEntry setTokenId(String tokenId) + { this.tokenId = tokenId; return this; } - public String getTokenId() { + public String getTokenId() + { return tokenId; } - public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { + public TslEntry setTokenStatus(TslTokenStatus tokenStatus) + { this.tokenStatus = tokenStatus; return this; } - public TslTokenStatus getTokenStatus() { + public TslTokenStatus getTokenStatus() + { return tokenStatus; } - public TslEntry setIsUsed(boolean isUsed) { + public TslEntry setIsUsed(boolean isUsed) + { this.isUsed = isUsed; return this; } - public boolean isUsed() { + public boolean isUsed() + { return isUsed; } - } diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/TslGetRequest.java index 4695efdf99..7360d09efb 100644 --- a/src/main/java/com/authlete/common/dto/TslGetRequest.java +++ b/src/main/java/com/authlete/common/dto/TslGetRequest.java @@ -2,17 +2,42 @@ import java.io.Serializable; -public class TslGetRequest implements Serializable { +/** + * Request to Authlete's {@code /tsl/publish} API. + * + * This class is used to get the published TSL. + * The set consists of the following. + * + *
      + *
    • {@code serviceNumber} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + * + * @see Token Status List (TSL) + */ +public class TslGetRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Service number whose TSL is to be retrieved. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } } diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/TslGetResponse.java index a86d614fbf..95461eca5d 100644 --- a/src/main/java/com/authlete/common/dto/TslGetResponse.java +++ b/src/main/java/com/authlete/common/dto/TslGetResponse.java @@ -2,27 +2,51 @@ import java.io.Serializable; -public class TslGetResponse implements Serializable { +/** + * Response from Authlete's {@code /service/tsl} API. + * + * @since 4.31 + * @since Authlete 3.0.22 + * + */ +public class TslGetResponse implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * TSL format e.g. jwt. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String format; + /** + * TSL + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String tsl; - public void setFormat(String format) { + public void setFormat(String format) + { this.format = format; } - public String getFormat() { + public String getFormat() + { return format; } - public void setTsl(String tsl) { + public void setTsl(String tsl) + { this.tsl = tsl; } - public String getTsl() { + public String getTsl() + { return tsl; } } diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java index 71bc711fed..00f524cc0a 100644 --- a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java @@ -3,21 +3,34 @@ import java.io.Serializable; /** + * This class is used to pre-populate the unused indexes which later will be used in the + * issued VCs/tokens. + * * A request to Authlete's {@code /service/populate/unused/indexes} API. * - * @since TODO - */ -public class TslPopulateUnusedIndexesRequest implements Serializable { + * @since 4.31 + * @since Authlete 3.0.22 + */ +public class TslPopulateUnusedIndexesRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Service number against which unused indexes is populated. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index dcc38195c1..22c260097c 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -1,19 +1,29 @@ package com.authlete.common.dto; /** - * This DTO holds the information when next TSL will be published - * per service. + * This class contains per service TSL publish configurations. + * + * @since 4.31 + * @since Authlete 3.0.22 * - * @since TODO */ public class TslPublishConfig { private static final long serialVersionUID = 1L; + /** + * Service number whose TSL will be published at next publish time. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; /** * It specifies the time when next TSL will be published. It is in seconds + * + * @since 4.31 + * @since Authlete 3.0.22 */ private long nextTslPublishTime; diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java index ef0e554456..316721556c 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -1,21 +1,40 @@ package com.authlete.common.dto; /** - * Response from Authlete's {@code service/tsl/publish/configs} API. + * Response from Authlete's {@code /tsl/publish/configs} API. + * + * This class contains TSL publish configuration response which decided when next TSL + * is going to be published. + * + * @since 4.31 + * @since Authlete 3.0.22 * - * @since TODO */ -public class TslPublishConfigsResponse extends ApiResponse { - +public class TslPublishConfigsResponse extends ApiResponse +{ private static final long serialVersionUID = 1L; + /** + * TSL publish configurations reponse. + * It contains an array of the following information. + * + *
      + *
    • {@code serviceNumber} + *
    • {@code nextTslPublishTime} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private TslPublishConfig[] tslPublishConfigs; - public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { + public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) + { this.tslPublishConfigs = tslPublishConfigs; } - public TslPublishConfig[] getTslPublishConfigs() { + public TslPublishConfig[] getTslPublishConfigs() + { return tslPublishConfigs; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index 616845aad5..e6147f0fd5 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -2,17 +2,42 @@ import java.io.Serializable; -public class TslPublishRequest implements Serializable { +/** + * Request to Authlete's {@code /tsl/publish} API. + * + * This class is used to publish the TSL. + * The set consists of the following. + * + *
      + *
    • {@code serviceNumber} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + * + * @see Token Status List (TSL) + */ +public class TslPublishRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Service number whose TSL is to be published + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int serviceNumber; - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } } diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index 344a41bca3..c1337c0216 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -4,38 +4,82 @@ import java.io.Serializable; -public class TslTokenStatusUpdateRequest implements Serializable { +/** + * + * Request to Authlete's {@code /tsl/token/status} API. + * + * A class that updates the status of the issued VCs/tokens which later added in the issued TSL. + * The set consists of the following. + * + *
      + *
    • {@code tokenId} + *
    • {@code tokenStatus} + *
    • {@code tokenIndex} + *
    + * + * @since 4.31 + * @since Authlete 3.0.22 + * + * @see Token Status List (TSL) + */ +public class TslTokenStatusUpdateRequest implements Serializable +{ private static final long serialVersionUID = 1L; + /** + * Token ID used to identity the issued VC/token whose status can be changed. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private String tokenId; + /** + * Token status to change. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ + private TslTokenStatus tokenStatus; + /** + * Token index in the issued TSL. + * + * @since 4.31 + * @since Authlete 3.0.22 + */ private int tokenIndex; - public void setTokenId(String tokenId) { + public void setTokenId(String tokenId) + { this.tokenId = tokenId; } - public String getTokenId() { + public String getTokenId() + { return tokenId; } - public void setTokenStatus(TslTokenStatus tokenStatus) { + public void setTokenStatus(TslTokenStatus tokenStatus) + { this.tokenStatus = tokenStatus; } - public TslTokenStatus getTokenStatus() { + public TslTokenStatus getTokenStatus() + { return tokenStatus; } - public void setTokenIndex(int tokenIndex) { + public void setTokenIndex(int tokenIndex) + { this.tokenIndex = tokenIndex; } - public int getIndex() { + public int getIndex() + { return tokenIndex; } - } From ea8d1da8ef24fa4a63af1df7fcc24d61cb3a1127 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 19:35:57 +0500 Subject: [PATCH 38/52] improved code commenting and refactoring --- .../authlete/common/dto/CredentialDeferredIssueRequest.java | 1 - .../common/dto/CredentialDeferredIssueResponse.java | 6 ------ 2 files changed, 7 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java index c70f4e5c8a..4a482873fe 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java @@ -145,7 +145,6 @@ public class CredentialDeferredIssueRequest implements Serializable */ private CredentialIssuanceOrder order; - /** * The flag that indicates whether to deny the deferred credential request. * diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java index e643dc84fd..3121285169 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueResponse.java @@ -297,12 +297,6 @@ public enum Action * The API call is invalid. */ CALLER_ERROR, - - /** - * The deferred credential request does not contain the access token or - * the access token is invalid. - */ - UNAUTHORIZED, } From f2d8db276b565ac6cf90f666a364650c7233a278 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 19:45:22 +0500 Subject: [PATCH 39/52] untracked .idea folder --- src/main/java/com/authlete/common/dto/Service.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 7f0604bc8e..959659d8db 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -13081,7 +13081,8 @@ public boolean isHttpAliasProhibited() * @see * OAuth Client ID Metadata Document */ - public Service setHttpAliasProhibited(boolean prohibited) { + public Service setHttpAliasProhibited(boolean prohibited) + { this.httpAliasProhibited = prohibited; return this; From 474abdb56b87d099a4005181df5e5a3cb0dbd8d3 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 2 Dec 2025 21:06:11 +0500 Subject: [PATCH 40/52] added code docs --- .../authlete/common/dto/TslConfigData.java | 89 +++++++++++++++++++ .../common/dto/TslEntriesResponse.java | 27 ++++-- 2 files changed, 107 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index e47a54abd8..e8ca2f8c22 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -90,6 +90,15 @@ public TslConfigData(TslConfigData tslConfigData) publishEndpoint = tslConfigData.getPublishEndpoint(); } + /** + * Sets the publish format for the TSL configuration. + * + * @param format the {@link TslPublishFormat} value to set + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setFormat(TslPublishFormat format) { this.format = format; @@ -97,22 +106,58 @@ public TslConfigData setFormat(TslPublishFormat format) return this; } + /** + * Returns the publish format of the TSL configuration. + * + * @return the {@link TslPublishFormat} value currently configured + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslPublishFormat getFormat() { return format; } + /** + * Sets the TSL validity in hours. + * + * @param TSL validity in hours + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setValidity(long validity) { this.validity = validity; return this; } + /** + * Returns the TSL validity in hours. + * + * @return TSL validity + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public long getValidity() { return validity; } + /** + * Sets the TSL publishing frequency in every X hours. + * + * @param TSL publish frequency + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setPublishFrequency(long publishFrequency) { this.publishFrequency = publishFrequency; @@ -120,11 +165,29 @@ public TslConfigData setPublishFrequency(long publishFrequency) return this; } + /** + * Returns the TSL publishing frequency. + * + * @return TSL publishing frequency + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public long getPublishFrequency() { return publishFrequency; } + /** + * Sets the ttl value of TSL in hours. + * + * @param ttl value + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setTimeToLive(long timeToLive) { this.timeToLive = timeToLive; @@ -132,11 +195,29 @@ public TslConfigData setTimeToLive(long timeToLive) return this; } + /** + * Returns the ttl value. + * + * @return ttl value + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public long getTimeToLive() { return timeToLive; } + /** + * Sets the TSL publishing endpoint. + * + * @param publish endpoint + * + * @return this {@code TslConfigData} instance for method chaining + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { this.publishEndpoint = publishEndpoint; @@ -144,6 +225,14 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) return this; } + /** + * Returns the TSL publishing endpoint. + * + * @return publishing endpoint + * + * @since 4.31 + * @since Authlete 3.0.22 + */ public URI getPublishEndpoint() { return publishEndpoint; diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java index d968da6915..f4eeb5f885 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -9,7 +9,8 @@ * @since Authlete 3.0.22 * */ -public class TslEntriesResponse { +public class TslEntriesResponse +{ private static final long serialVersionUID = 1L; @@ -46,43 +47,51 @@ public class TslEntriesResponse { private TslEntry[] tslEntries; - public TslEntriesResponse setStart(int start) { + public TslEntriesResponse setStart(int start) + { this.start = start; return this; } - public int getStart() { + public int getStart() + { return start; } - public TslEntriesResponse setEnd(int end) { + public TslEntriesResponse setEnd(int end) + { this.end = end; return this; } - public int getEnd() { + public int getEnd() + { return end; } - public TslEntriesResponse setTotalCount(int totalCount) { + public TslEntriesResponse setTotalCount(int totalCount) + { this.totalCount = totalCount; return this; } - public int getTotalCount() { + public int getTotalCount() + { return totalCount; } - public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) { + public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) + { this.tslEntries = tslEntries; return this; } - public TslEntry[] getTslEntries() { + public TslEntry[] getTslEntries() + { return tslEntries; } } From 2f8b00ce43c3e858b03d54de3f59ffba890f5a8f Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 3 Dec 2025 15:49:49 +0500 Subject: [PATCH 41/52] improved javadocs --- .../java/com/authlete/common/dto/Service.java | 2 +- .../authlete/common/dto/TslConfigData.java | 12 +-- .../common/dto/TslEntriesResponse.java | 79 ++++++++++++++++--- .../com/authlete/common/dto/TslEntry.java | 79 ++++++++++++++++--- .../authlete/common/dto/TslGetRequest.java | 41 +++++++--- .../authlete/common/dto/TslGetResponse.java | 44 +++++++++-- .../dto/TslPopulateUnusedIndexesRequest.java | 29 +++++-- .../authlete/common/dto/TslPublishConfig.java | 46 +++++++++-- .../common/dto/TslPublishConfigsResponse.java | 40 +++++++--- .../common/dto/TslPublishRequest.java | 39 ++++++--- .../dto/TslTokenStatusUpdateRequest.java | 68 ++++++++++++---- 11 files changed, 393 insertions(+), 86 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 959659d8db..186945b828 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1981,7 +1981,7 @@ public class Service implements Serializable private boolean httpAliasProhibited; /** - * The flag indicating whether the feature of Trust status list publishing for + * The flag indicating whether the feature of TSL publishing for * this service is enabled or not. * * @since 4.31 diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index e8ca2f8c22..d3796ae6fb 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -29,7 +29,7 @@ public class TslConfigData implements Serializable private static final long serialVersionUID = 1L; /** - * The format of the TSL. Possible values are JWT and CWT. Currently only JWT is supported + * The format of the TSL. Possible values are jwt and cwt. Currently only jwt is supported * * @since 4.31 * @since Authlete 3.0.22 @@ -37,7 +37,7 @@ public class TslConfigData implements Serializable private TslPublishFormat format; /** - * The validity of the TSL in hours + * The validity of the TSL in hours. * * @since 4.31 * @since Authlete 3.0.22 @@ -45,7 +45,7 @@ public class TslConfigData implements Serializable private long validity; /** - * Publish TSL after every X hours + * Publish TSL after every X hours. * * @since 4.31 * @since Authlete 3.0.22 @@ -71,7 +71,8 @@ public class TslConfigData implements Serializable /** * The default constructor. */ - public TslConfigData() { + public TslConfigData() + { } /** @@ -129,7 +130,8 @@ public TslPublishFormat getFormat() * @since 4.31 * @since Authlete 3.0.22 */ - public TslConfigData setValidity(long validity) { + public TslConfigData setValidity(long validity) + { this.validity = validity; return this; diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java index f4eeb5f885..157f312b07 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslEntriesResponse.java @@ -3,20 +3,25 @@ /** * Response from Authlete's {@code /tsl/entries/list} API. * - * This class contains list of TSL token entries. + *

    + * This class represents the result of a query that retrieves + * a list of TSL (Token Status List) token entries. It contains + * information about pagination (start and end indexes), total + * entry count, and the actual list of {@link TslEntry} objects. + *

    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslEntriesResponse { - private static final long serialVersionUID = 1L; /** * The start index (inclusive) for the result set of the query. * + * @return The start index. + * * @since 4.31 * @since Authlete 3.0.22 */ @@ -25,13 +30,17 @@ public class TslEntriesResponse /** * The end index (exclusive) for the result set of the query. * + * @return The end index. + * * @since 4.31 * @since Authlete 3.0.22 */ private int end; /** - * Total count of the entries + * The total number of entries available for the query, regardless of pagination. + * + * @return The total count of entries. * * @since 4.31 * @since Authlete 3.0.22 @@ -39,57 +48,107 @@ public class TslEntriesResponse private int totalCount; /** - * TSL token entries + * The array of TSL token entries returned by the query. + * + * @return An array of {@link TslEntry} objects. * * @since 4.31 * @since Authlete 3.0.22 */ - private TslEntry[] tslEntries; + + /** + * Set the start index (inclusive) for the result set. + * + * @param start + * The start index. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setStart(int start) { this.start = start; - return this; } + /** + * Get the start index (inclusive) for the result set. + * + * @return The start index. + */ public int getStart() { return start; } + /** + * Set the end index (exclusive) for the result set. + * + * @param end + * The end index. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setEnd(int end) { this.end = end; - return this; } + /** + * Get the end index (exclusive) for the result set. + * + * @return The end index. + */ public int getEnd() { return end; } + /** + * Set the total count of all entries matching the query. + * + * @param totalCount + * The total number of matching entries. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setTotalCount(int totalCount) { this.totalCount = totalCount; - return this; } + /** + * Get the total number of entries matching the query. + * + * @return The total count. + */ public int getTotalCount() { return totalCount; } + /** + * Set the list of TSL token entries. + * + * @param tslEntries + * An array of {@link TslEntry} objects. + * + * @return {@code this} object for method chaining. + */ public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) { this.tslEntries = tslEntries; - return this; } + /** + * Get the list of TSL token entries returned by the query. + * + * @return An array of {@link TslEntry} objects, or {@code null} if none. + */ public TslEntry[] getTslEntries() { return tslEntries; diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java index 7ba2446aa6..96e47fb8d4 100644 --- a/src/main/java/com/authlete/common/dto/TslEntry.java +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -3,18 +3,24 @@ import com.authlete.common.types.TslTokenStatus; /** - * This class contains token entries on which to build the TSL + * Represents a single token entry used in constructing a Token Status List (TSL). + * + *

    + * Each entry corresponds to an issued VC/token and includes its index, unique + * token ID, current status, and usage flag. These objects are typically returned + * as part of a list in {@code /tsl/entries/list} responses. + *

    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslEntry { private static final long serialVersionUID = 1L; /** - * Token index that represents the token in the issued VC/token. + * The token index associated with the issued VC/token. + * This index helps uniquely identify the token within a service. * * @since 4.31 * @since Authlete 3.0.22 @@ -22,7 +28,8 @@ public class TslEntry private int tokenIndex; /** - * Unique ID assigned to each issued VC/token. + * The unique token ID assigned at issuance time. + * This value is globally unique per token/VC. * * @since 4.31 * @since Authlete 3.0.22 @@ -30,59 +37,111 @@ public class TslEntry private String tokenId; /** - * Current status of the issued VC/token. + * The current status of the issued VC/token. + * + * @see TslTokenStatus * * @since 4.31 * @since Authlete 3.0.22 */ - private TslTokenStatus tokenStatus; + /** + * Indicates whether this token entry has been marked as used. + */ private boolean isUsed; + /** + * Set the token index associated with this entry. + * + * @param tokenIndex + * The token index. + * + * @return {@code this} object for method chaining. + */ public TslEntry setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; - return this; } + /** + * Get the token index associated with this entry. + * + * @return The token index. + */ public int getTokenIndex() { return tokenIndex; } + /** + * Set the unique token ID for this entry. + * + * @param tokenId + * The unique token identifier. + * + * @return {@code this} object for method chaining. + */ public TslEntry setTokenId(String tokenId) { this.tokenId = tokenId; - return this; } + /** + * Get the unique token ID associated with this entry. + * + * @return The token ID. + */ public String getTokenId() { return tokenId; } + /** + * Set the current token status. + * + * @param tokenStatus + * The status of the token. + * + * @return {@code this} object for method chaining. + */ public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; - return this; } + /** + * Get the current status of the issued token. + * + * @return The token status. + */ public TslTokenStatus getTokenStatus() { return tokenStatus; } + /** + * Set the usage flag for this token entry. + * + * @param isUsed + * {@code true} if the entry is already used; {@code false} otherwise. + * + * @return {@code this} object for method chaining. + */ public TslEntry setIsUsed(boolean isUsed) { this.isUsed = isUsed; - return this; } + /** + * Check whether this token entry has been marked as used. + * + * @return {@code true} if the entry is used; {@code false} otherwise. + */ public boolean isUsed() { return isUsed; diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/TslGetRequest.java index 7360d09efb..85b7d973d2 100644 --- a/src/main/java/com/authlete/common/dto/TslGetRequest.java +++ b/src/main/java/com/authlete/common/dto/TslGetRequest.java @@ -5,40 +5,59 @@ /** * Request to Authlete's {@code /tsl/publish} API. * - * This class is used to get the published TSL. - * The set consists of the following. + *

    + * This class represents a request to retrieve a published Token Status List (TSL) + * for a specific service. The request requires the caller to specify the + * {@code serviceNumber}, which uniquely identifies the service whose TSL is + * being requested. + *

    * - *
      - *
    • {@code serviceNumber} - *
    + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification * * @since 4.31 * @since Authlete 3.0.22 - * - * @see Token Status List (TSL) */ public class TslGetRequest implements Serializable { - private static final long serialVersionUID = 1L; /** - * Service number whose TSL is to be retrieved. + * The service number for which the TSL is requested. + * + *

    + * This value uniquely identifies a service within Authlete's environment. + * The TSL associated with this service number will be retrieved when the + * request is processed. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private int serviceNumber; + /** + * Set the service number whose Token Status List (TSL) should be retrieved. + * + * @param serviceNumber + * The service number to query. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number whose Token Status List (TSL) is being requested. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; } } - diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/TslGetResponse.java index 95461eca5d..6509269007 100644 --- a/src/main/java/com/authlete/common/dto/TslGetResponse.java +++ b/src/main/java/com/authlete/common/dto/TslGetResponse.java @@ -5,17 +5,25 @@ /** * Response from Authlete's {@code /service/tsl} API. * + *

    + * This class represents the response returned when retrieving a Token Status + * List (TSL) from Authlete. The response includes the TSL format (e.g., JWT) + * and the TSL content itself. + *

    + * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslGetResponse implements Serializable { - private static final long serialVersionUID = 1L; /** - * TSL format e.g. jwt. + * The format of the TSL, such as {@code "jwt"}. + * + *

    + * This value indicates how the TSL is encoded or represented. + *

    * * @since 4.31 * @since Authlete 3.0.22 @@ -23,30 +31,56 @@ public class TslGetResponse implements Serializable private String format; /** - * TSL + * The Token Status List (TSL) in the format specified by {@link #format}. + * + *

    + * The TSL is typically represented as a JWT or another supported encoding. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private String tsl; + /** + * Set the format of the Token Status List (TSL). + * + * @param format + * The TSL format (e.g., {@code "jwt"}). + */ public void setFormat(String format) { this.format = format; } + /** + * Get the format of the Token Status List (TSL). + * + * @return The TSL format. + */ public String getFormat() { return format; } + /** + * Set the Token Status List (TSL). + * + * @param tsl + * The TSL content in the format specified by {@link #format}. + */ public void setTsl(String tsl) { this.tsl = tsl; } + /** + * Get the Token Status List (TSL). + * + * @return The TSL content. + */ public String getTsl() { return tsl; } - } +} diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java index 00f524cc0a..1015cbc458 100644 --- a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java @@ -3,32 +3,51 @@ import java.io.Serializable; /** - * This class is used to pre-populate the unused indexes which later will be used in the - * issued VCs/tokens. + * Request to Authlete's {@code /service/populate/unused/indexes} API. * - * A request to Authlete's {@code /service/populate/unused/indexes} API. + *

    + * This class represents a request to pre-populate unused token indexes for a + * particular service. These unused indexes are later consumed when issuing + * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation + * of token indices within a Token Status List (TSL) environment. + *

    * * @since 4.31 * @since Authlete 3.0.22 - */ public class TslPopulateUnusedIndexesRequest implements Serializable { private static final long serialVersionUID = 1L; /** - * Service number against which unused indexes is populated. + * The service number for which unused token indexes should be populated. + * + *

    + * This value uniquely identifies the service under which the unused + * indexes will be created. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private int serviceNumber; + /** + * Set the service number for which unused token indexes should be populated. + * + * @param serviceNumber + * The service number to populate indexes for. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number for which unused token indexes should be populated. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index 22c260097c..8038ec6903 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -1,18 +1,28 @@ package com.authlete.common.dto; /** - * This class contains per service TSL publish configurations. + * Represents the Token Status List (TSL) publish configuration for a service. + * + *

    + * This class contains per-service settings related to TSL publication, including + * the service identifier and the Unix timestamp (in seconds) indicating when the + * next TSL will be published. + *

    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslPublishConfig { private static final long serialVersionUID = 1L; /** - * Service number whose TSL will be published at next publish time. + * The service number for which the TSL publication schedule applies. + * + *

    + * This uniquely identifies the service whose TSL will be published at + * the configured next publish time. + *

    * * @since 4.31 * @since Authlete 3.0.22 @@ -20,27 +30,53 @@ public class TslPublishConfig { private int serviceNumber; /** - * It specifies the time when next TSL will be published. It is in seconds + * The Unix timestamp (in seconds) indicating when the next TSL + * will be published for this service. + * + *

    + * This value allows services to schedule periodic TSL publication. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private long nextTslPublishTime; + /** + * Set the service number associated with this TSL publish configuration. + * + * @param serviceNumber + * The service number. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number associated with this TSL publish configuration. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; } + /** + * Set the Unix timestamp (in seconds) for the next TSL publication time. + * + * @param nextTslPublishTime + * The next publish time, in seconds. + */ public void setNextTslPublishTime(long nextTslPublishTime) { this.nextTslPublishTime = nextTslPublishTime; } + /** + * Get the Unix timestamp (in seconds) for the next TSL publication time. + * + * @return The next publish time, in seconds. + */ public long getNextTslPublishTime() { return nextTslPublishTime; } - } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java index 316721556c..3d3cba7a13 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -3,36 +3,58 @@ /** * Response from Authlete's {@code /tsl/publish/configs} API. * - * This class contains TSL publish configuration response which decided when next TSL - * is going to be published. + *

    + * This class represents the response containing Token Status List (TSL) + * publication configuration information for one or more services. Each entry + * indicates when the next TSL will be published for the corresponding service. + *

    + * + *

    + * The response includes an array of {@link TslPublishConfig} objects, each + * describing: + *

    + * + *
      + *
    • {@code serviceNumber} – The service identifier.
    • + *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • + *
    * * @since 4.31 * @since Authlete 3.0.22 - * */ public class TslPublishConfigsResponse extends ApiResponse { private static final long serialVersionUID = 1L; /** - * TSL publish configurations reponse. - * It contains an array of the following information. + * The list of TSL publish configurations. * - *
      - *
    • {@code serviceNumber} - *
    • {@code nextTslPublishTime} - *
    + *

    + * Each element in the array contains the publish schedule for a service, + * including the service number and the next scheduled publish time. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private TslPublishConfig[] tslPublishConfigs; + /** + * Set the list of TSL publish configurations. + * + * @param tslPublishConfigs + * An array of {@link TslPublishConfig} objects. + */ public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { this.tslPublishConfigs = tslPublishConfigs; } + /** + * Get the list of TSL publish configurations. + * + * @return An array of {@link TslPublishConfig} objects. + */ public TslPublishConfig[] getTslPublishConfigs() { return tslPublishConfigs; diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index e6147f0fd5..d3e6858c00 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -5,40 +5,57 @@ /** * Request to Authlete's {@code /tsl/publish} API. * - * This class is used to publish the TSL. - * The set consists of the following. + *

    + * This class represents a request to publish a Token Status List (TSL) for + * a specific service. The request contains the {@code serviceNumber}, which + * uniquely identifies the service whose TSL is to be published. + *

    * - *
      - *
    • {@code serviceNumber} - *
    + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification * * @since 4.31 * @since Authlete 3.0.22 - * - * @see Token Status List (TSL) */ public class TslPublishRequest implements Serializable { - private static final long serialVersionUID = 1L; /** - * Service number whose TSL is to be published + * The service number whose TSL is to be published. + * + *

    + * This uniquely identifies the service within Authlete's environment. When + * this request is processed, the TSL for this service will be published. + *

    * * @since 4.31 * @since Authlete 3.0.22 */ private int serviceNumber; + /** + * Set the service number whose TSL is to be published. + * + * @param serviceNumber + * The service number to publish the TSL for. + */ public void setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; } + /** + * Get the service number whose TSL is to be published. + * + * @return The service number. + */ public int getServiceNumber() { return serviceNumber; } } - diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index c1337c0216..11548a0adf 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -5,31 +5,37 @@ import java.io.Serializable; /** - * * Request to Authlete's {@code /tsl/token/status} API. * - * A class that updates the status of the issued VCs/tokens which later added in the issued TSL. - * The set consists of the following. + *

    + * This class represents a request to update the status of an issued + * Verifiable Credential (VC) or token. The updated status will later + * be included in the issued Token Status List (TSL). The request contains + * the following information: + *

    * *
      - *
    • {@code tokenId} - *
    • {@code tokenStatus} - *
    • {@code tokenIndex} + *
    • {@code tokenId} – The unique identifier of the issued token/VC.
    • + *
    • {@code tokenStatus} – The new status to assign to the token.
    • + *
    • {@code tokenIndex} – The index of the token in the issued TSL.
    • *
    * + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification + * * @since 4.31 * @since Authlete 3.0.22 - * - * @see Token Status List (TSL) */ public class TslTokenStatusUpdateRequest implements Serializable { - private static final long serialVersionUID = 1L; /** - * Token ID used to identity the issued VC/token whose status can be changed. + * The token ID used to identify the issued VC/token whose status is to be changed. * * @since 4.31 * @since Authlete 3.0.22 @@ -37,47 +43,81 @@ public class TslTokenStatusUpdateRequest implements Serializable private String tokenId; /** - * Token status to change. + * The token status to be set. + * + * @see TslTokenStatus * * @since 4.31 * @since Authlete 3.0.22 */ - private TslTokenStatus tokenStatus; /** - * Token index in the issued TSL. + * The index of the token in the issued TSL. * * @since 4.31 * @since Authlete 3.0.22 */ private int tokenIndex; + /** + * Set the token ID of the issued VC/token whose status is to be updated. + * + * @param tokenId + * The unique token identifier. + */ public void setTokenId(String tokenId) { this.tokenId = tokenId; } + /** + * Get the token ID of the issued VC/token whose status is being updated. + * + * @return The token ID. + */ public String getTokenId() { return tokenId; } + /** + * Set the token status to assign to the issued token/VC. + * + * @param tokenStatus + * The new token status. + */ public void setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; } + /** + * Get the token status currently set for this update request. + * + * @return The token status. + */ public TslTokenStatus getTokenStatus() { return tokenStatus; } + /** + * Set the token index in the issued TSL. + * + * @param tokenIndex + * The index of the token. + */ public void setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; } + /** + * Get the token index in the issued TSL. + * + * @return The token index. + */ public int getIndex() { return tokenIndex; From a84a8817d2881a8a5e87077561458e7ce5a88b1f Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 3 Dec 2025 15:55:09 +0500 Subject: [PATCH 42/52] improved javadocs --- pom.xml | 44 +++++++++---------- .../authlete/common/dto/TslPublishConfig.java | 15 ++++--- .../common/types/TslPublishFormat.java | 3 +- .../authlete/common/types/TslTokenStatus.java | 9 ++-- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index e38080d82f..b253790a59 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + E834481D + ${env.GPG_PASSPHRASE} + + --pinentry-mode + loopback + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index 8038ec6903..5321491dc2 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -12,7 +12,8 @@ * @since 4.31 * @since Authlete 3.0.22 */ -public class TslPublishConfig { +public class TslPublishConfig +{ private static final long serialVersionUID = 1L; @@ -48,7 +49,8 @@ public class TslPublishConfig { * @param serviceNumber * The service number. */ - public void setServiceNumber(int serviceNumber) { + public void setServiceNumber(int serviceNumber) + { this.serviceNumber = serviceNumber; } @@ -57,7 +59,8 @@ public void setServiceNumber(int serviceNumber) { * * @return The service number. */ - public int getServiceNumber() { + public int getServiceNumber() + { return serviceNumber; } @@ -67,7 +70,8 @@ public int getServiceNumber() { * @param nextTslPublishTime * The next publish time, in seconds. */ - public void setNextTslPublishTime(long nextTslPublishTime) { + public void setNextTslPublishTime(long nextTslPublishTime) + { this.nextTslPublishTime = nextTslPublishTime; } @@ -76,7 +80,8 @@ public void setNextTslPublishTime(long nextTslPublishTime) { * * @return The next publish time, in seconds. */ - public long getNextTslPublishTime() { + public long getNextTslPublishTime() + { return nextTslPublishTime; } } diff --git a/src/main/java/com/authlete/common/types/TslPublishFormat.java b/src/main/java/com/authlete/common/types/TslPublishFormat.java index d493a3ba5e..e483d3d2aa 100644 --- a/src/main/java/com/authlete/common/types/TslPublishFormat.java +++ b/src/main/java/com/authlete/common/types/TslPublishFormat.java @@ -2,7 +2,8 @@ import java.util.EnumSet; -public enum TslPublishFormat { +public enum TslPublishFormat +{ /** * Currently jwt is supported. TSL publishing cwt format will be supported in the next iteration diff --git a/src/main/java/com/authlete/common/types/TslTokenStatus.java b/src/main/java/com/authlete/common/types/TslTokenStatus.java index ff8d63867e..c102ea9136 100644 --- a/src/main/java/com/authlete/common/types/TslTokenStatus.java +++ b/src/main/java/com/authlete/common/types/TslTokenStatus.java @@ -2,7 +2,8 @@ import java.util.EnumSet; -public enum TslTokenStatus { +public enum TslTokenStatus +{ VALID((short)0, "valid"), INVALID((short)1, "invalid"), @@ -15,7 +16,8 @@ public enum TslTokenStatus { private final String mString; - private TslTokenStatus(short value, String string) { + private TslTokenStatus(short value, String string) + { mValue = value; mString = string; } @@ -24,7 +26,8 @@ private TslTokenStatus(short value, String string) { /** * Get the integer representation of this enum instance. */ - public short getValue() { + public short getValue() + { return mValue; } From 68e318e5fb8f7fa40c3092c77665ae6b9bdba3c0 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 8 Dec 2025 17:37:54 +0500 Subject: [PATCH 43/52] worked on PR comments --- .idea/compiler.xml | 4 +- pom.xml | 44 ++++----- ...quest.java => GetPublishedTslRequest.java} | 23 +++-- ...onse.java => GetPublishedTslResponse.java} | 42 ++++---- ...sponse.java => GetTslEntriesResponse.java} | 68 ++++++------- .../java/com/authlete/common/dto/Service.java | 39 +++++--- .../authlete/common/dto/TslConfigData.java | 97 +++++++------------ .../com/authlete/common/dto/TslEntry.java | 61 ++++++------ .../authlete/common/dto/TslPublishConfig.java | 25 +++-- .../common/dto/TslPublishConfigsResponse.java | 19 ++-- .../common/dto/TslPublishRequest.java | 19 ++-- .../dto/TslTokenStatusUpdateRequest.java | 45 +++++---- ...uest.java => TslUnusedIndexesRequest.java} | 19 ++-- 13 files changed, 249 insertions(+), 256 deletions(-) rename src/main/java/com/authlete/common/dto/{TslGetRequest.java => GetPublishedTslRequest.java} (77%) rename src/main/java/com/authlete/common/dto/{TslGetResponse.java => GetPublishedTslResponse.java} (63%) rename src/main/java/com/authlete/common/dto/{TslEntriesResponse.java => GetTslEntriesResponse.java} (64%) rename src/main/java/com/authlete/common/dto/{TslPopulateUnusedIndexesRequest.java => TslUnusedIndexesRequest.java} (77%) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index df3ef2ec63..cca8335003 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,10 +6,8 @@ + - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index b253790a59..e38080d82f 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 3.1.0 - - - sign-artifacts - verify - - sign - - - E834481D - ${env.GPG_PASSPHRASE} - - --pinentry-mode - loopback - - - - - + + + + + + + + + + + + + + + + + + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/TslGetRequest.java b/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java similarity index 77% rename from src/main/java/com/authlete/common/dto/TslGetRequest.java rename to src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java index 85b7d973d2..b4fb4fdb3e 100644 --- a/src/main/java/com/authlete/common/dto/TslGetRequest.java +++ b/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java @@ -3,7 +3,7 @@ import java.io.Serializable; /** - * Request to Authlete's {@code /tsl/publish} API. + * Request to Authlete's {@code /service/tsl} API. * *

    * This class represents a request to retrieve a published Token Status List (TSL) @@ -16,13 +16,13 @@ * For more details about Token Status Lists (TSL), see: *

    * - * @see + * @see * Token Status List (TSL) Specification * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslGetRequest implements Serializable +public class GetPublishedTslRequest implements Serializable { private static final long serialVersionUID = 1L; @@ -34,9 +34,6 @@ public class TslGetRequest implements Serializable * The TSL associated with this service number will be retrieved when the * request is processed. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -44,17 +41,23 @@ public class TslGetRequest implements Serializable * Set the service number whose Token Status List (TSL) should be retrieved. * * @param serviceNumber - * The service number to query. + * The service number to query. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public GetPublishedTslRequest setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number whose Token Status List (TSL) is being requested. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { diff --git a/src/main/java/com/authlete/common/dto/TslGetResponse.java b/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java similarity index 63% rename from src/main/java/com/authlete/common/dto/TslGetResponse.java rename to src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java index 6509269007..9d8231f48d 100644 --- a/src/main/java/com/authlete/common/dto/TslGetResponse.java +++ b/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java @@ -7,38 +7,24 @@ * *

    * This class represents the response returned when retrieving a Token Status - * List (TSL) from Authlete. The response includes the TSL format (e.g., JWT) + * List (TSL) from Authlete API. The response includes the TSL format (e.g., JWT) * and the TSL content itself. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslGetResponse implements Serializable +public class GetPublishedTslResponse implements Serializable { private static final long serialVersionUID = 1L; /** * The format of the TSL, such as {@code "jwt"}. - * - *

    - * This value indicates how the TSL is encoded or represented. - *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private String format; /** - * The Token Status List (TSL) in the format specified by {@link #format}. - * - *

    - * The TSL is typically represented as a JWT or another supported encoding. - *

    - * - * @since 4.31 - * @since Authlete 3.0.22 + * The Token Status List (TSL). */ private String tsl; @@ -47,16 +33,22 @@ public class TslGetResponse implements Serializable * * @param format * The TSL format (e.g., {@code "jwt"}). + * + * @return + * {@code this} object. */ - public void setFormat(String format) + public GetPublishedTslResponse setFormat(String format) { this.format = format; + + return this; } /** * Get the format of the Token Status List (TSL). * - * @return The TSL format. + * @return + * The TSL format. */ public String getFormat() { @@ -68,16 +60,22 @@ public String getFormat() * * @param tsl * The TSL content in the format specified by {@link #format}. + * + * @return + * {@code this} object. */ - public void setTsl(String tsl) + public GetPublishedTslResponse setTsl(String tsl) { this.tsl = tsl; + + return this; } /** * Get the Token Status List (TSL). * - * @return The TSL content. + * @return + * The TSL content. */ public String getTsl() { diff --git a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java b/src/main/java/com/authlete/common/dto/GetTslEntriesResponse.java similarity index 64% rename from src/main/java/com/authlete/common/dto/TslEntriesResponse.java rename to src/main/java/com/authlete/common/dto/GetTslEntriesResponse.java index 157f312b07..40769b2578 100644 --- a/src/main/java/com/authlete/common/dto/TslEntriesResponse.java +++ b/src/main/java/com/authlete/common/dto/GetTslEntriesResponse.java @@ -1,5 +1,7 @@ package com.authlete.common.dto; +import java.io.Serializable; + /** * Response from Authlete's {@code /tsl/entries/list} API. * @@ -10,50 +12,30 @@ * entry count, and the actual list of {@link TslEntry} objects. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslEntriesResponse +public class GetTslEntriesResponse implements Serializable { private static final long serialVersionUID = 1L; /** * The start index (inclusive) for the result set of the query. - * - * @return The start index. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int start; /** * The end index (exclusive) for the result set of the query. - * - * @return The end index. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int end; /** * The total number of entries available for the query, regardless of pagination. - * - * @return The total count of entries. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int totalCount; /** * The array of TSL token entries returned by the query. - * - * @return An array of {@link TslEntry} objects. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslEntry[] tslEntries; @@ -64,18 +46,21 @@ public class TslEntriesResponse * @param start * The start index. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setStart(int start) + public GetTslEntriesResponse setStart(int start) { this.start = start; + return this; } /** * Get the start index (inclusive) for the result set. * - * @return The start index. + * @return + * The start index. */ public int getStart() { @@ -86,20 +71,23 @@ public int getStart() * Set the end index (exclusive) for the result set. * * @param end - * The end index. + * The end index. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setEnd(int end) + public GetTslEntriesResponse setEnd(int end) { this.end = end; + return this; } /** * Get the end index (exclusive) for the result set. * - * @return The end index. + * @return + * The end index. */ public int getEnd() { @@ -110,20 +98,23 @@ public int getEnd() * Set the total count of all entries matching the query. * * @param totalCount - * The total number of matching entries. + * The total number of matching entries. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setTotalCount(int totalCount) + public GetTslEntriesResponse setTotalCount(int totalCount) { this.totalCount = totalCount; + return this; } /** * Get the total number of entries matching the query. * - * @return The total count. + * @return + * The total count. */ public int getTotalCount() { @@ -134,20 +125,23 @@ public int getTotalCount() * Set the list of TSL token entries. * * @param tslEntries - * An array of {@link TslEntry} objects. + * An array of {@link TslEntry} objects. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntriesResponse setTslEntries(TslEntry[] tslEntries) + public GetTslEntriesResponse setTslEntries(TslEntry[] tslEntries) { this.tslEntries = tslEntries; + return this; } /** * Get the list of TSL token entries returned by the query. * - * @return An array of {@link TslEntry} objects, or {@code null} if none. + * @return + * An array of {@link TslEntry} objects, or {@code null} if none. */ public TslEntry[] getTslEntries() { diff --git a/src/main/java/com/authlete/common/dto/Service.java b/src/main/java/com/authlete/common/dto/Service.java index 186945b828..0711dcb3f9 100644 --- a/src/main/java/com/authlete/common/dto/Service.java +++ b/src/main/java/com/authlete/common/dto/Service.java @@ -1975,7 +1975,7 @@ public class Service implements Serializable * Whether to prohibit client ID aliases that start with {@code https://} * or {@code http://}. * - * @since 4.32 + * @since 4.33 * @since Authlete 3.0.22 */ private boolean httpAliasProhibited; @@ -1984,7 +1984,7 @@ public class Service implements Serializable * The flag indicating whether the feature of TSL publishing for * this service is enabled or not. * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ private boolean tslPublishingEnabled; @@ -1993,10 +1993,10 @@ public class Service implements Serializable /** * TSL configuration data. * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 * - * @see + * @see * Trust Status List */ private TslConfigData tslConfigData; @@ -12250,11 +12250,13 @@ public Service setOid4vciVersion(String version) /* * Sets whether TSL publishing is enabled for this service. * - * @param tslPublishingEnabled {@code true} to enable TSL publishing; - * {@code false} to disable it. - * @return this {@link Service} instance for method chaining + * @param tslPublishingEnabled + * {@code true} to enable TSL publishing. {@code false} to disable it. * - * @since 4.31 + * @return + * this {@link Service} instance for method chaining + * + * @since 4.33 * @since Authlete 3.0.22 */ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) @@ -12268,9 +12270,10 @@ public Service setTslPublishingEnabled(boolean tslPublishingEnabled) * Get the flag indicating whether the feature of TSL publishing * for this service is enabled or not. * - * @return {@code true} if the feature of TSL publishing is enabled. + * @return + * {@code true} if the feature of TSL publishing is enabled. * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public boolean isTslPublishingEnabled() @@ -12334,13 +12337,16 @@ public Service setClientIdMetadataDocumentSupported(boolean supported) /** * Sets the {@link TslConfigData} for this service. * - * @param tslConfigData the configuration data to be applied - * @return this {@code Service} instance for method chaining + * @param tslConfigData + * the configuration data to be applied * - * @since 4.31 + * @return + * this {@code Service} instance for method chaining + * + * @since 4.33 * @since Authlete 3.0.22 * - * @see + * @see * Trust Status List */ public Service setTslConfigData(TslConfigData tslConfigData) @@ -13091,9 +13097,10 @@ public Service setHttpAliasProhibited(boolean prohibited) /** * Retrieves the {@link TslConfigData} associated with this service. * - * @return the current {@link TslConfigData} + * @return + * the current {@link TslConfigData} * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public TslConfigData getTslConfigData() diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index d3796ae6fb..96e119e306 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -17,10 +17,10 @@ *
  • {@code publishEndpoint} * * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 * - * @see Token Status List (TSL) */ public class TslConfigData implements Serializable @@ -30,41 +30,26 @@ public class TslConfigData implements Serializable /** * The format of the TSL. Possible values are jwt and cwt. Currently only jwt is supported - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslPublishFormat format; /** * The validity of the TSL in hours. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long validity; /** * Publish TSL after every X hours. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long publishFrequency; /** * Time to live in hours which provides indication to verifiers to cache this TSL - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long timeToLive; /** * Endpoint where to publish this TSL - * - * @since 4.31 - * @since Authlete 3.0.22 */ private URI publishEndpoint; @@ -92,13 +77,13 @@ public TslConfigData(TslConfigData tslConfigData) } /** - * Sets the publish format for the TSL configuration. + * Sets the publishing format for the TSL configuration. * - * @param format the {@link TslPublishFormat} value to set - * @return this {@code TslConfigData} instance for method chaining + * @param format + * the {@link TslPublishFormat} value to set * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setFormat(TslPublishFormat format) { @@ -108,12 +93,10 @@ public TslConfigData setFormat(TslPublishFormat format) } /** - * Returns the publish format of the TSL configuration. - * - * @return the {@link TslPublishFormat} value currently configured + * Returns the publishing format of the TSL configuration. * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * the {@link TslPublishFormat} value currently configured */ public TslPublishFormat getFormat() { @@ -123,12 +106,11 @@ public TslPublishFormat getFormat() /** * Sets the TSL validity in hours. * - * @param TSL validity in hours - * - * @return this {@code TslConfigData} instance for method chaining + * @param validity + * validity in hours * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setValidity(long validity) { @@ -140,10 +122,8 @@ public TslConfigData setValidity(long validity) /** * Returns the TSL validity in hours. * - * @return TSL validity - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * TSL validity */ public long getValidity() { @@ -153,12 +133,11 @@ public long getValidity() /** * Sets the TSL publishing frequency in every X hours. * - * @param TSL publish frequency - * - * @return this {@code TslConfigData} instance for method chaining + * @param publishFrequency + * TSL publish frequency * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setPublishFrequency(long publishFrequency) { @@ -170,10 +149,8 @@ public TslConfigData setPublishFrequency(long publishFrequency) /** * Returns the TSL publishing frequency. * - * @return TSL publishing frequency - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * TSL publishing frequency */ public long getPublishFrequency() { @@ -183,12 +160,11 @@ public long getPublishFrequency() /** * Sets the ttl value of TSL in hours. * - * @param ttl value - * - * @return this {@code TslConfigData} instance for method chaining + * @param timeToLive + * the ttl value * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setTimeToLive(long timeToLive) { @@ -200,10 +176,8 @@ public TslConfigData setTimeToLive(long timeToLive) /** * Returns the ttl value. * - * @return ttl value - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * ttl value */ public long getTimeToLive() { @@ -213,12 +187,11 @@ public long getTimeToLive() /** * Sets the TSL publishing endpoint. * - * @param publish endpoint - * - * @return this {@code TslConfigData} instance for method chaining + * @param publishEndpoint + * TSL publish endpoint * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * this {@code TslConfigData} instance for method chaining */ public TslConfigData setPublishEndpoint(URI publishEndpoint) { @@ -230,10 +203,8 @@ public TslConfigData setPublishEndpoint(URI publishEndpoint) /** * Returns the TSL publishing endpoint. * - * @return publishing endpoint - * - * @since 4.31 - * @since Authlete 3.0.22 + * @return + * TSL publishing endpoint */ public URI getPublishEndpoint() { diff --git a/src/main/java/com/authlete/common/dto/TslEntry.java b/src/main/java/com/authlete/common/dto/TslEntry.java index 96e47fb8d4..8c037c8957 100644 --- a/src/main/java/com/authlete/common/dto/TslEntry.java +++ b/src/main/java/com/authlete/common/dto/TslEntry.java @@ -11,7 +11,7 @@ * as part of a list in {@code /tsl/entries/list} responses. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslEntry @@ -21,54 +21,46 @@ public class TslEntry /** * The token index associated with the issued VC/token. * This index helps uniquely identify the token within a service. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int tokenIndex; /** * The unique token ID assigned at issuance time. * This value is globally unique per token/VC. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private String tokenId; /** * The current status of the issued VC/token. - * - * @see TslTokenStatus - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslTokenStatus tokenStatus; /** * Indicates whether this token entry has been marked as used. */ - private boolean isUsed; + private boolean used; /** * Set the token index associated with this entry. * * @param tokenIndex - * The token index. + * The token index. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ public TslEntry setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; + return this; } /** * Get the token index associated with this entry. * - * @return The token index. + * @return + * The token index. */ public int getTokenIndex() { @@ -79,20 +71,23 @@ public int getTokenIndex() * Set the unique token ID for this entry. * * @param tokenId - * The unique token identifier. + * The unique token identifier. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ public TslEntry setTokenId(String tokenId) { this.tokenId = tokenId; + return this; } /** * Get the unique token ID associated with this entry. * - * @return The token ID. + * @return + * The token ID. */ public String getTokenId() { @@ -103,20 +98,23 @@ public String getTokenId() * Set the current token status. * * @param tokenStatus - * The status of the token. + * The status of the token. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ public TslEntry setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; + return this; } /** * Get the current status of the issued token. * - * @return The token status. + * @return + * The token status. */ public TslTokenStatus getTokenStatus() { @@ -126,24 +124,27 @@ public TslTokenStatus getTokenStatus() /** * Set the usage flag for this token entry. * - * @param isUsed - * {@code true} if the entry is already used; {@code false} otherwise. + * @param used + * {@code true} if the entry is already used; {@code false} otherwise. * - * @return {@code this} object for method chaining. + * @return + * {@code this} object for method chaining. */ - public TslEntry setIsUsed(boolean isUsed) + public TslEntry setUsed(boolean used) { - this.isUsed = isUsed; + this.used = used; + return this; } /** * Check whether this token entry has been marked as used. * - * @return {@code true} if the entry is used; {@code false} otherwise. + * @return + * {@code true} if the entry is used; {@code false} otherwise. */ - public boolean isUsed() + public boolean getUsed() { - return isUsed; + return used; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfig.java index 5321491dc2..50aa462d8f 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfig.java @@ -9,7 +9,7 @@ * next TSL will be published. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslPublishConfig @@ -24,9 +24,6 @@ public class TslPublishConfig * This uniquely identifies the service whose TSL will be published at * the configured next publish time. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -37,9 +34,6 @@ public class TslPublishConfig *

    * This value allows services to schedule periodic TSL publication. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private long nextTslPublishTime; @@ -48,16 +42,22 @@ public class TslPublishConfig * * @param serviceNumber * The service number. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public TslPublishConfig setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number associated with this TSL publish configuration. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { @@ -69,10 +69,15 @@ public int getServiceNumber() * * @param nextTslPublishTime * The next publish time, in seconds. + * + * @return + * {@code this} object. */ - public void setNextTslPublishTime(long nextTslPublishTime) + public TslPublishConfig setNextTslPublishTime(long nextTslPublishTime) { this.nextTslPublishTime = nextTslPublishTime; + + return this; } /** diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java index 3d3cba7a13..97d97f4f17 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java @@ -1,7 +1,7 @@ package com.authlete.common.dto; /** - * Response from Authlete's {@code /tsl/publish/configs} API. + * Response from Authlete's {@code /service/tsl/publish/configs} API. * *

    * This class represents the response containing Token Status List (TSL) @@ -15,11 +15,11 @@ *

    * *
      - *
    • {@code serviceNumber} – The service identifier.
    • + *
    • {@code serviceNumber} – The service number.
    • *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • *
    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslPublishConfigsResponse extends ApiResponse @@ -33,9 +33,6 @@ public class TslPublishConfigsResponse extends ApiResponse * Each element in the array contains the publish schedule for a service, * including the service number and the next scheduled publish time. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslPublishConfig[] tslPublishConfigs; @@ -44,16 +41,22 @@ public class TslPublishConfigsResponse extends ApiResponse * * @param tslPublishConfigs * An array of {@link TslPublishConfig} objects. + * + * @return + * {@code this} object. */ - public void setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) + public TslPublishConfigsResponse setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) { this.tslPublishConfigs = tslPublishConfigs; + + return this; } /** * Get the list of TSL publish configurations. * - * @return An array of {@link TslPublishConfig} objects. + * @return + * An array of {@link TslPublishConfig} objects. */ public TslPublishConfig[] getTslPublishConfigs() { diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index d3e6858c00..a5c36d8a88 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -3,7 +3,7 @@ import java.io.Serializable; /** - * Request to Authlete's {@code /tsl/publish} API. + * Request to Authlete's {@code /service/tsl/publish} API. * *

    * This class represents a request to publish a Token Status List (TSL) for @@ -15,10 +15,10 @@ * For more details about Token Status Lists (TSL), see: *

    * - * @see + * @see * Token Status List (TSL) Specification * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslPublishRequest implements Serializable @@ -32,9 +32,6 @@ public class TslPublishRequest implements Serializable * This uniquely identifies the service within Authlete's environment. When * this request is processed, the TSL for this service will be published. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -43,16 +40,22 @@ public class TslPublishRequest implements Serializable * * @param serviceNumber * The service number to publish the TSL for. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public TslPublishRequest setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number whose TSL is to be published. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index 11548a0adf..d352bc759d 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -24,10 +24,10 @@ * For more details about Token Status Lists (TSL), see: *

    * - * @see + * @see * Token Status List (TSL) Specification * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ public class TslTokenStatusUpdateRequest implements Serializable @@ -36,27 +36,16 @@ public class TslTokenStatusUpdateRequest implements Serializable /** * The token ID used to identify the issued VC/token whose status is to be changed. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private String tokenId; /** * The token status to be set. - * - * @see TslTokenStatus - * - * @since 4.31 - * @since Authlete 3.0.22 */ private TslTokenStatus tokenStatus; /** * The index of the token in the issued TSL. - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int tokenIndex; @@ -65,16 +54,22 @@ public class TslTokenStatusUpdateRequest implements Serializable * * @param tokenId * The unique token identifier. + * + * @return + * {@code this} object. */ - public void setTokenId(String tokenId) + public TslTokenStatusUpdateRequest setTokenId(String tokenId) { this.tokenId = tokenId; + + return this; } /** * Get the token ID of the issued VC/token whose status is being updated. * - * @return The token ID. + * @return + * The token ID. */ public String getTokenId() { @@ -86,16 +81,22 @@ public String getTokenId() * * @param tokenStatus * The new token status. + * + * @return + * {@code this} object. */ - public void setTokenStatus(TslTokenStatus tokenStatus) + public TslTokenStatusUpdateRequest setTokenStatus(TslTokenStatus tokenStatus) { this.tokenStatus = tokenStatus; + + return this; } /** * Get the token status currently set for this update request. * - * @return The token status. + * @return + * The token status. */ public TslTokenStatus getTokenStatus() { @@ -107,16 +108,22 @@ public TslTokenStatus getTokenStatus() * * @param tokenIndex * The index of the token. + * + * @return + * {@code this} object. */ - public void setTokenIndex(int tokenIndex) + public TslTokenStatusUpdateRequest setTokenIndex(int tokenIndex) { this.tokenIndex = tokenIndex; + + return this; } /** * Get the token index in the issued TSL. * - * @return The token index. + * @return + * The token index. */ public int getIndex() { diff --git a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java similarity index 77% rename from src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java rename to src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index 1015cbc458..501c71225b 100644 --- a/src/main/java/com/authlete/common/dto/TslPopulateUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -3,7 +3,7 @@ import java.io.Serializable; /** - * Request to Authlete's {@code /service/populate/unused/indexes} API. + * Request to Authlete's {@code /service/tsl/unused/indexes} API. * *

    * This class represents a request to pre-populate unused token indexes for a @@ -12,10 +12,10 @@ * of token indices within a Token Status List (TSL) environment. *

    * - * @since 4.31 + * @since 4.33 * @since Authlete 3.0.22 */ -public class TslPopulateUnusedIndexesRequest implements Serializable +public class TslUnusedIndexesRequest implements Serializable { private static final long serialVersionUID = 1L; @@ -26,9 +26,6 @@ public class TslPopulateUnusedIndexesRequest implements Serializable * This value uniquely identifies the service under which the unused * indexes will be created. *

    - * - * @since 4.31 - * @since Authlete 3.0.22 */ private int serviceNumber; @@ -37,16 +34,22 @@ public class TslPopulateUnusedIndexesRequest implements Serializable * * @param serviceNumber * The service number to populate indexes for. + * + * @return + * {@code this} object. */ - public void setServiceNumber(int serviceNumber) + public TslUnusedIndexesRequest setServiceNumber(int serviceNumber) { this.serviceNumber = serviceNumber; + + return this; } /** * Get the service number for which unused token indexes should be populated. * - * @return The service number. + * @return + * The service number. */ public int getServiceNumber() { From 6ffb3c38099dbb592c9c781bf3d7cb07434cadb5 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 8 Dec 2025 20:43:53 +0500 Subject: [PATCH 44/52] pom.xml file update --- pom.xml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index e38080d82f..b253790a59 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + E834481D + ${env.GPG_PASSPHRASE} + + --pinentry-mode + loopback + + + + + org.codehaus.mojo From 68038a72b62e80f4e109218bf55299c673eb02e6 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 6 Jan 2026 15:34:07 +0500 Subject: [PATCH 45/52] updated as per comments --- pom.xml | 44 +++--- .../common/dto/GetPublishedTslRequest.java | 66 --------- .../common/dto/GetPublishedTslResponse.java | 84 ------------ .../authlete/common/dto/TslConfigData.java | 12 +- ...hConfig.java => TslPublishConfigInfo.java} | 65 ++++++--- .../dto/TslPublishConfigsListResponse.java | 125 ++++++++++++++++++ .../common/dto/TslPublishConfigsResponse.java | 65 --------- .../common/dto/TslPublishRequest.java | 49 ++++--- .../common/dto/TslPublishResponse.java | 114 ++++++++++++++++ .../com/authlete/common/dto/TslRequest.java | 76 +++++++++++ .../com/authlete/common/dto/TslResponse.java | 124 +++++++++++++++++ .../dto/TslTokenStatusUpdateRequest.java | 15 +++ .../dto/TslTokenStatusUpdateResponse.java | 86 ++++++++++++ .../common/dto/TslUnusedIndexesRequest.java | 79 ++++++++--- .../common/dto/TslUnusedIndexesResponse.java | 88 ++++++++++++ .../{TslPublishFormat.java => TslFormat.java} | 30 ++--- 16 files changed, 814 insertions(+), 308 deletions(-) delete mode 100644 src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java delete mode 100644 src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java rename src/main/java/com/authlete/common/dto/{TslPublishConfig.java => TslPublishConfigInfo.java} (50%) create mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java delete mode 100644 src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslPublishResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslRequest.java create mode 100644 src/main/java/com/authlete/common/dto/TslResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java create mode 100644 src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java rename src/main/java/com/authlete/common/types/{TslPublishFormat.java => TslFormat.java} (62%) diff --git a/pom.xml b/pom.xml index b253790a59..e38080d82f 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 3.1.0 - - - sign-artifacts - verify - - sign - - - E834481D - ${env.GPG_PASSPHRASE} - - --pinentry-mode - loopback - - - - - + + + + + + + + + + + + + + + + + + + + + + org.codehaus.mojo diff --git a/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java b/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java deleted file mode 100644 index b4fb4fdb3e..0000000000 --- a/src/main/java/com/authlete/common/dto/GetPublishedTslRequest.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.authlete.common.dto; - -import java.io.Serializable; - -/** - * Request to Authlete's {@code /service/tsl} API. - * - *

    - * This class represents a request to retrieve a published Token Status List (TSL) - * for a specific service. The request requires the caller to specify the - * {@code serviceNumber}, which uniquely identifies the service whose TSL is - * being requested. - *

    - * - *

    - * For more details about Token Status Lists (TSL), see: - *

    - * - * @see - * Token Status List (TSL) Specification - * - * @since 4.33 - * @since Authlete 3.0.22 - */ -public class GetPublishedTslRequest implements Serializable -{ - private static final long serialVersionUID = 1L; - - /** - * The service number for which the TSL is requested. - * - *

    - * This value uniquely identifies a service within Authlete's environment. - * The TSL associated with this service number will be retrieved when the - * request is processed. - *

    - */ - private int serviceNumber; - - /** - * Set the service number whose Token Status List (TSL) should be retrieved. - * - * @param serviceNumber - * The service number to query. - * - * @return - * {@code this} object. - */ - public GetPublishedTslRequest setServiceNumber(int serviceNumber) - { - this.serviceNumber = serviceNumber; - - return this; - } - - /** - * Get the service number whose Token Status List (TSL) is being requested. - * - * @return - * The service number. - */ - public int getServiceNumber() - { - return serviceNumber; - } -} diff --git a/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java b/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java deleted file mode 100644 index 9d8231f48d..0000000000 --- a/src/main/java/com/authlete/common/dto/GetPublishedTslResponse.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.authlete.common.dto; - -import java.io.Serializable; - -/** - * Response from Authlete's {@code /service/tsl} API. - * - *

    - * This class represents the response returned when retrieving a Token Status - * List (TSL) from Authlete API. The response includes the TSL format (e.g., JWT) - * and the TSL content itself. - *

    - * - * @since 4.33 - * @since Authlete 3.0.22 - */ -public class GetPublishedTslResponse implements Serializable -{ - private static final long serialVersionUID = 1L; - - /** - * The format of the TSL, such as {@code "jwt"}. - */ - private String format; - - /** - * The Token Status List (TSL). - */ - private String tsl; - - /** - * Set the format of the Token Status List (TSL). - * - * @param format - * The TSL format (e.g., {@code "jwt"}). - * - * @return - * {@code this} object. - */ - public GetPublishedTslResponse setFormat(String format) - { - this.format = format; - - return this; - } - - /** - * Get the format of the Token Status List (TSL). - * - * @return - * The TSL format. - */ - public String getFormat() - { - return format; - } - - /** - * Set the Token Status List (TSL). - * - * @param tsl - * The TSL content in the format specified by {@link #format}. - * - * @return - * {@code this} object. - */ - public GetPublishedTslResponse setTsl(String tsl) - { - this.tsl = tsl; - - return this; - } - - /** - * Get the Token Status List (TSL). - * - * @return - * The TSL content. - */ - public String getTsl() - { - return tsl; - } -} diff --git a/src/main/java/com/authlete/common/dto/TslConfigData.java b/src/main/java/com/authlete/common/dto/TslConfigData.java index 96e119e306..393c235332 100644 --- a/src/main/java/com/authlete/common/dto/TslConfigData.java +++ b/src/main/java/com/authlete/common/dto/TslConfigData.java @@ -1,6 +1,6 @@ package com.authlete.common.dto; -import com.authlete.common.types.TslPublishFormat; +import com.authlete.common.types.TslFormat; import java.io.Serializable; import java.net.URI; @@ -31,7 +31,7 @@ public class TslConfigData implements Serializable /** * The format of the TSL. Possible values are jwt and cwt. Currently only jwt is supported */ - private TslPublishFormat format; + private TslFormat format; /** * The validity of the TSL in hours. @@ -80,12 +80,12 @@ public TslConfigData(TslConfigData tslConfigData) * Sets the publishing format for the TSL configuration. * * @param format - * the {@link TslPublishFormat} value to set + * the {@link TslFormat} value to set * * @return * this {@code TslConfigData} instance for method chaining */ - public TslConfigData setFormat(TslPublishFormat format) + public TslConfigData setFormat(TslFormat format) { this.format = format; @@ -96,9 +96,9 @@ public TslConfigData setFormat(TslPublishFormat format) * Returns the publishing format of the TSL configuration. * * @return - * the {@link TslPublishFormat} value currently configured + * the {@link TslFormat} value currently configured */ - public TslPublishFormat getFormat() + public TslFormat getFormat() { return format; } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfig.java b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java similarity index 50% rename from src/main/java/com/authlete/common/dto/TslPublishConfig.java rename to src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java index 50aa462d8f..65cc8417f3 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfig.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java @@ -1,31 +1,33 @@ package com.authlete.common.dto; +import com.authlete.common.types.TslFormat; + /** - * Represents the Token Status List (TSL) publish configuration for a service. + * Represents the Token Status List (TSL) publish configurations for a service. * *

    * This class contains per-service settings related to TSL publication, including - * the service identifier and the Unix timestamp (in seconds) indicating when the + * the service ID and the Unix timestamp (in seconds) indicating when the * next TSL will be published. *

    * * @since 4.33 * @since Authlete 3.0.22 */ -public class TslPublishConfig +public class TslPublishConfigInfo { private static final long serialVersionUID = 1L; /** - * The service number for which the TSL publication schedule applies. + * The service ID for which the TSL publication schedule applies. * *

    * This uniquely identifies the service whose TSL will be published at * the configured next publish time. *

    */ - private int serviceNumber; + private long serviceId; /** * The Unix timestamp (in seconds) indicating when the next TSL @@ -38,30 +40,35 @@ public class TslPublishConfig private long nextTslPublishTime; /** - * Set the service number associated with this TSL publish configuration. + * The TSL format of the published TSL for this service. + */ + private TslFormat format; + + /** + * Set the service ID associated with this TSL publish configuration. * - * @param serviceNumber - * The service number. + * @param serviceId + * The service ID. * * @return * {@code this} object. */ - public TslPublishConfig setServiceNumber(int serviceNumber) + public TslPublishConfigInfo setServiceId(long serviceId) { - this.serviceNumber = serviceNumber; + this.serviceId = serviceId; return this; } /** - * Get the service number associated with this TSL publish configuration. + * Get the service ID associated with this TSL publish configuration. * * @return - * The service number. + * The service ID. */ - public int getServiceNumber() + public long getServiceId() { - return serviceNumber; + return serviceId; } /** @@ -73,7 +80,7 @@ public int getServiceNumber() * @return * {@code this} object. */ - public TslPublishConfig setNextTslPublishTime(long nextTslPublishTime) + public TslPublishConfigInfo setNextTslPublishTime(long nextTslPublishTime) { this.nextTslPublishTime = nextTslPublishTime; @@ -89,4 +96,32 @@ public long getNextTslPublishTime() { return nextTslPublishTime; } + + /** + * Sets the format of the published TSL + * + * @param format + * The TSL format. + * + * @return + * {@code this} object. + */ + public TslPublishConfigInfo setTslFormat(TslFormat format) + { + this.format = format; + + return this; + } + + /** + * Gets the format of the TSL. + * + * @return + * The TSL format. + */ + public TslFormat getTslFormat() + { + return format; + } + } diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java new file mode 100644 index 0000000000..454f46e7bb --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response from Authlete's {@code /tsl/publish/configs/list} API. + * + *

    + * This class represents the response containing Token Status List (TSL) + * publish configurations for one or more services. Each entry + * indicates when the next TSL will be published for the corresponding service. + *

    + * + *

    + * The response includes an array of {@link TslPublishConfigInfo} objects, each + * describing: + *

    + * + *
      + *
    • {@code serviceID} – The service ID.
    • + *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • + *
    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslPublishConfigsListResponse extends ApiResponse +{ + private static final long serialVersionUID = 1L; + + /** + * The result of the {@code /tsl/publish/configs/list} API call. + */ + public enum Action + { + /** + * Information about the TSL publish configs has been obtained + * successfully. + */ + OK, + } + + /** + * The result of the {@code /tsl/publish/configs/list} API call. + */ + private Action action; + + /** + * The list of TSL publish configurations. + * + *

    + * Each element in the array contains the publishing schedule for a service, + * including the service ID and the next scheduled publish time. + *

    + */ + private TslPublishConfigInfo[] info; + + + /** + * Get the result of the {@code /tsl/publish/configs/list} API call. + * + * @return + * The result of the API call. + */ + public Action getAction() + { + return action; + } + + /** + * Set the result of the {@code /tsl/publish/configs/list} API call. + * + * @param action + * The result of the API call. + * + * @return + * {@code this} object. + */ + public TslPublishConfigsListResponse setAction(Action action) + { + this.action = action; + + return this; + } + + /** + * Set the list of TSL publish configurations. + * + * @param info + * An array of {@link TslPublishConfigInfo} objects. + * + * @return + * {@code this} object. + */ + public TslPublishConfigsListResponse setInfo(TslPublishConfigInfo[] info) + { + this.info = info; + + return this; + } + + /** + * Get the list of TSL publish configurations. + * + * @return + * An array of {@link TslPublishConfigInfo} objects. + */ + public TslPublishConfigInfo[] getInfo() + { + return info; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java deleted file mode 100644 index 97d97f4f17..0000000000 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsResponse.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.authlete.common.dto; - -/** - * Response from Authlete's {@code /service/tsl/publish/configs} API. - * - *

    - * This class represents the response containing Token Status List (TSL) - * publication configuration information for one or more services. Each entry - * indicates when the next TSL will be published for the corresponding service. - *

    - * - *

    - * The response includes an array of {@link TslPublishConfig} objects, each - * describing: - *

    - * - *
      - *
    • {@code serviceNumber} – The service number.
    • - *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • - *
    - * - * @since 4.33 - * @since Authlete 3.0.22 - */ -public class TslPublishConfigsResponse extends ApiResponse -{ - private static final long serialVersionUID = 1L; - - /** - * The list of TSL publish configurations. - * - *

    - * Each element in the array contains the publish schedule for a service, - * including the service number and the next scheduled publish time. - *

    - */ - private TslPublishConfig[] tslPublishConfigs; - - /** - * Set the list of TSL publish configurations. - * - * @param tslPublishConfigs - * An array of {@link TslPublishConfig} objects. - * - * @return - * {@code this} object. - */ - public TslPublishConfigsResponse setTslPublishConfigs(TslPublishConfig[] tslPublishConfigs) - { - this.tslPublishConfigs = tslPublishConfigs; - - return this; - } - - /** - * Get the list of TSL publish configurations. - * - * @return - * An array of {@link TslPublishConfig} objects. - */ - public TslPublishConfig[] getTslPublishConfigs() - { - return tslPublishConfigs; - } -} diff --git a/src/main/java/com/authlete/common/dto/TslPublishRequest.java b/src/main/java/com/authlete/common/dto/TslPublishRequest.java index a5c36d8a88..d11954d7ce 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishRequest.java +++ b/src/main/java/com/authlete/common/dto/TslPublishRequest.java @@ -1,14 +1,30 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; +import com.authlete.common.types.TslFormat; + import java.io.Serializable; /** - * Request to Authlete's {@code /service/tsl/publish} API. + * Request to Authlete's {@code /tsl/publish} API. * *

    * This class represents a request to publish a Token Status List (TSL) for - * a specific service. The request contains the {@code serviceNumber}, which - * uniquely identifies the service whose TSL is to be published. + * a specific service. *

    * *

    @@ -26,39 +42,34 @@ public class TslPublishRequest implements Serializable private static final long serialVersionUID = 1L; /** - * The service number whose TSL is to be published. - * - *

    - * This uniquely identifies the service within Authlete's environment. When - * this request is processed, the TSL for this service will be published. - *

    + * The format of the to be published TSL. */ - private int serviceNumber; + private TslFormat format; /** - * Set the service number whose TSL is to be published. + * Set the to be published TSL format * - * @param serviceNumber - * The service number to publish the TSL for. + * @param format + * The TSL format. * * @return * {@code this} object. */ - public TslPublishRequest setServiceNumber(int serviceNumber) + public TslPublishRequest setTslFormat(TslFormat format) { - this.serviceNumber = serviceNumber; + this.format = format; return this; } /** - * Get the service number whose TSL is to be published. + * Get the to be published TSL format. * * @return - * The service number. + * The TSL format. */ - public int getServiceNumber() + public TslFormat getTslFormat() { - return serviceNumber; + return format; } } diff --git a/src/main/java/com/authlete/common/dto/TslPublishResponse.java b/src/main/java/com/authlete/common/dto/TslPublishResponse.java new file mode 100644 index 0000000000..4b020541db --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslPublishResponse.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response from Authlete's {@code /tsl/publish} API. + * + *

    + * This class represents the response returned when publishing a Token Status + * List (TSL) from Authlete API. + *

    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslPublishResponse extends ApiResponse +{ + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the publish TSL endpoint + * should take after getting a response from Authlete's + * {@code /tsl/publish} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A TSL publish response has been prepared successfully. + */ + OK, + + /** + * The feature of TSL publish not enabled in the service + * configuration. + */ + FORBIDDEN, + } + + private Action action; + + private String tsl; + + /** + * Get the next action that the implementation of the TSL publish endpoint should + * take after getting a response from Authlete's {@code /tsl/publish} API. + * + * @return + * The next action. + */ + public Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl/publish} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslPublishResponse setAction(Action action) + { + this.action = action; + + return this; + } + + /** + * Get the published TSL + * + * @return + * The published TSL. + */ + public String getTsl() + { + return tsl; + } + + /** + * Set the published TSL. + * + * @param tsl + * The published TSL. + * + * @return + * {@code this} object. + */ + public TslPublishResponse setTsl(String tsl) + { + this.tsl = tsl; + + return this; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslRequest.java b/src/main/java/com/authlete/common/dto/TslRequest.java new file mode 100644 index 0000000000..17f570956f --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslRequest.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +import com.authlete.common.types.TslFormat; + +import java.io.Serializable; + +/** + * Request to Authlete's {@code /tsl} API. + * + *

    + * This class represents a request to retrieve a published Token Status List (TSL) + * for a specific service. The request requires the caller to specify the + * {@code tslFormat} for the requested TSL. + *

    + * + *

    + * For more details about Token Status Lists (TSL), see: + *

    + * + * @see + * Token Status List (TSL) Specification + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslRequest implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** + * The requested TSL format. Currently only JWT format is supported. + */ + private TslFormat format; + + /** + * Set the requested TSL format + * + * @param format + * The TSL format. + * + * @return + * {@code this} object. + */ + public TslRequest setTslFormat(TslFormat format) + { + this.format = format; + + return this; + } + + /** + * Get the requested TSL format. + * + * @return + * The TSL format. + */ + public TslFormat getTslFormat() + { + return format; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslResponse.java b/src/main/java/com/authlete/common/dto/TslResponse.java new file mode 100644 index 0000000000..1883c78b22 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslResponse.java @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response from Authlete's {@code /tsl} API. + * + *

    + * This class represents the response returned when retrieving a Token Status + * List (TSL) from Authlete API. + *

    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ +public class TslResponse extends ApiResponse +{ + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the TSL endpoint + * should take after getting a response from Authlete's + * {@code /tsl} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A get TSL response has been prepared successfully. + */ + OK, + + /** + * The feature of TSL is not enabled in the service + * configuration. + */ + FORBIDDEN, + + /** + * Invalid TSL format + */ + INVALID_TSL_FORMAT, + } + + private Action action; + + private String responseContent; + + /** + * Get the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl} API. + * + * @return + * The next action. + */ + public Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslResponse setAction(Action action) + { + this.action = action; + + return this; + } + + + /** + * Get the content that the implementation of the TSL endpoint should use + * when it constructs a response. + * + * @return + * The response content in the JSON format. + */ + public String getResponseContent() + { + return responseContent; + } + + + /** + * Set the content that the implementation of the TSL endpoint should use + * when it constructs a response. + * + * @param content + * The response content in the JSON format. + * + * @return + * {@code this} object. + */ + public TslResponse setResponseContent(String content) + { + this.responseContent = content; + + return this; + } + +} diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java index d352bc759d..9d1174e600 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; import com.authlete.common.types.TslTokenStatus; diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java new file mode 100644 index 0000000000..79ec7e2682 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response to Authlete's {@code /tsl/token/status} API. + * + *

    + * This class represents a response to update the status of an issued + * Verifiable Credential (VC) or token. The updated status will later + * be included in the issued Token Status List (TSL). + * + * @since 4.33 + * @since Authlete 3.0.22 + * + */ +public class TslTokenStatusUpdateResponse extends ApiResponse { + + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the token status update endpoint + * should take after getting a response from Authlete's + * {@code /tsl/token/status} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A token status update performed successfully. + */ + OK, + + /** + * The feature of TSL publish not enabled in the service + * configuration. + */ + FORBIDDEN, + } + + private TslTokenStatusUpdateResponse.Action action; + + /** + * Get the next action that the implementation of the token status update endpoint should + * take after getting a response from Authlete's {@code /tsl/token/status} API. + * + * @return + * The next action. + */ + public TslTokenStatusUpdateResponse.Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the token status update endpoint should + * take after getting a response from Authlete's {@code /tsl/token/status} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslTokenStatusUpdateResponse setAction(TslTokenStatusUpdateResponse.Action action) + { + this.action = action; + + return this; + } +} diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index 501c71225b..8ed6d248e2 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -1,9 +1,24 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; import java.io.Serializable; /** - * Request to Authlete's {@code /service/tsl/unused/indexes} API. + * Request to Authlete's {@code /tsl/unused/indexes} API. * *

    * This class represents a request to pre-populate unused token indexes for a @@ -20,39 +35,71 @@ public class TslUnusedIndexesRequest implements Serializable private static final long serialVersionUID = 1L; /** - * The service number for which unused token indexes should be populated. + * If less than this number of unused VC/token indexes left then populate new unused indexes + * specified in {@code unusedTokenIndexesAdd}. + */ + private long unusedTokenIndexesLeft; + + /** + * Add this number of new unused VC/token indexes. + */ + private long unusedTokenIndexesAdd; + + /** + * Set the unused token indexes left value. + * + * @param unusedTokenIndexesLeft + * The unused token indexes left value. + * + * @return + * {@code this} object. + */ + public TslUnusedIndexesRequest setUnusedTokenIndexLeft(long unusedTokenIndexesLeft) + { + this.unusedTokenIndexesLeft = unusedTokenIndexesLeft; + + return this; + } + + /** + * Get the unused token indexes left value. * - *

    - * This value uniquely identifies the service under which the unused - * indexes will be created. - *

    + * @return + * The unused token indexes left value. */ - private int serviceNumber; + public long getUnusedTokenIndexLeft() + { + return unusedTokenIndexesLeft; + } /** - * Set the service number for which unused token indexes should be populated. + * Set the unused token indexes add value. * - * @param serviceNumber - * The service number to populate indexes for. + * @param unusedTokenIndexesAdd + * The unused token indexes add value. * * @return * {@code this} object. */ - public TslUnusedIndexesRequest setServiceNumber(int serviceNumber) + public TslUnusedIndexesRequest setUnusedTokenIndexAdd(long unusedTokenIndexesAdd) { - this.serviceNumber = serviceNumber; + this.unusedTokenIndexesAdd = unusedTokenIndexesAdd; return this; } /** - * Get the service number for which unused token indexes should be populated. + * Get the unused token indexes add value. * * @return - * The service number. + * The unused token indexes add value. */ - public int getServiceNumber() + public long getUnusedTokenIndexAdd() { - return serviceNumber; + return unusedTokenIndexesAdd; } + + + + } diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java new file mode 100644 index 0000000000..1347343782 --- /dev/null +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2025 Authlete, Inc. + * + * 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 com.authlete.common.dto; + +/** + * Response to Authlete's {@code /tsl/unused/indexes} API. + * + *

    + * This class represents a response to pre-populate unused token indexes for a + * particular service. These unused indexes are later consumed when issuing + * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation + * of token indices within a Token Status List (TSL) environment. + *

    + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + +public class TslUnusedIndexesResponse extends ApiResponse { + + private static final long serialVersionUID = 1L; + + /** + * The next action that the implementation of the TSL unused indexes endpoint + * should take after getting a response from Authlete's + * {@code /tsl/unused/indexes} API. + * + * @since 4.33 + * @since Authlete 3.0.22 + */ + public enum Action + { + /** + * A TSL publish response has been prepared successfully. + */ + OK, + + /** + * The feature of TSL publish not enabled in the service + * configuration. + */ + FORBIDDEN, + } + + private TslUnusedIndexesResponse.Action action; + + /** + * Get the next action that the implementation of the TSL unused indexes endpoint should + * take after getting a response from Authlete's {@code /tsl/unused/indexes} API. + * + * @return + * The next action. + */ + public TslUnusedIndexesResponse.Action getAction() + { + return action; + } + + /** + * Set the next action that the implementation of the TSL unused indexes endpoint should + * take after getting a response from Authlete's {@code /tsl/unused/indexes} API. + * + * @param action + * The next action. + * + * @return + * {@code this} object. + */ + public TslUnusedIndexesResponse setAction(TslUnusedIndexesResponse.Action action) + { + this.action = action; + + return this; + } +} diff --git a/src/main/java/com/authlete/common/types/TslPublishFormat.java b/src/main/java/com/authlete/common/types/TslFormat.java similarity index 62% rename from src/main/java/com/authlete/common/types/TslPublishFormat.java rename to src/main/java/com/authlete/common/types/TslFormat.java index e483d3d2aa..dabb11e960 100644 --- a/src/main/java/com/authlete/common/types/TslPublishFormat.java +++ b/src/main/java/com/authlete/common/types/TslFormat.java @@ -2,7 +2,7 @@ import java.util.EnumSet; -public enum TslPublishFormat +public enum TslFormat { /** @@ -11,13 +11,13 @@ public enum TslPublishFormat JWT((short)1, "jwt"); - private static final TslPublishFormat[] sValues = values(); - private static final TslPublishFormat.Helper sHelper = new TslPublishFormat.Helper(sValues); + private static final TslFormat[] sValues = values(); + private static final TslFormat.Helper sHelper = new TslFormat.Helper(sValues); private final short mValue; private final String mString; - private TslPublishFormat(short value, String string) + private TslFormat(short value, String string) { mValue = value; mString = string; @@ -42,7 +42,7 @@ public short getValue() * @return * An instance of this enum, or {@code null} if not found. */ - public static TslPublishFormat getByValue(short value) + public static TslFormat getByValue(short value) { if (value < 1 || sValues.length < value) { @@ -66,49 +66,49 @@ public String getString() } - public static int toBits(EnumSet set) + public static int toBits(EnumSet set) { return sHelper.toBits(set); } - public static TslPublishFormat[] toArray(int bits) + public static TslFormat[] toArray(int bits) { return sHelper.toArray(bits); } - public static EnumSet toSet(int bits) + public static EnumSet toSet(int bits) { return sHelper.toSet(bits); } - public static EnumSet toSet(TslPublishFormat[] array) + public static EnumSet toSet(TslFormat[] array) { return sHelper.toSet(array); } - private static class Helper extends EnumHelper + private static class Helper extends EnumHelper { - public Helper(TslPublishFormat[] values) + public Helper(TslFormat[] values) { - super(TslPublishFormat.class, values); + super(TslFormat.class, values); } @Override - protected short getValue(TslPublishFormat entry) + protected short getValue(TslFormat entry) { return entry.getValue(); } @Override - protected TslPublishFormat[] newArray(int size) + protected TslFormat[] newArray(int size) { - return new TslPublishFormat[size]; + return new TslFormat[size]; } } } From c260c32bf7bf5867ddd5d58dd9a7a27c342fe3b7 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Tue, 6 Jan 2026 17:39:53 +0500 Subject: [PATCH 46/52] updated as per comments --- .../common/dto/TslPublishConfigInfo.java | 10 +++++----- .../dto/TslPublishConfigsListResponse.java | 17 +++++++++++------ .../authlete/common/dto/TslPublishResponse.java | 8 +++++--- .../com/authlete/common/dto/TslResponse.java | 3 --- .../dto/TslTokenStatusUpdateResponse.java | 3 --- .../common/dto/TslUnusedIndexesRequest.java | 5 +---- .../common/dto/TslUnusedIndexesResponse.java | 7 ++----- 7 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java index 65cc8417f3..c52f3f753c 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigInfo.java @@ -7,7 +7,7 @@ * *

    * This class contains per-service settings related to TSL publication, including - * the service ID and the Unix timestamp (in seconds) indicating when the + * the service ID, format and the Unix timestamp (in seconds) indicating when the * next TSL will be published. *

    * @@ -40,12 +40,12 @@ public class TslPublishConfigInfo private long nextTslPublishTime; /** - * The TSL format of the published TSL for this service. + * The TSL format of the TSL for this service. */ private TslFormat format; /** - * Set the service ID associated with this TSL publish configuration. + * Set the service ID associated with this TSL publish configurations. * * @param serviceId * The service ID. @@ -61,7 +61,7 @@ public TslPublishConfigInfo setServiceId(long serviceId) } /** - * Get the service ID associated with this TSL publish configuration. + * Get the service ID associated with this TSL publish configurations. * * @return * The service ID. @@ -98,7 +98,7 @@ public long getNextTslPublishTime() } /** - * Sets the format of the published TSL + * Sets the format of the TSL * * @param format * The TSL format. diff --git a/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java index 454f46e7bb..4d60988985 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishConfigsListResponse.java @@ -32,6 +32,7 @@ *
      *
    • {@code serviceID} – The service ID.
    • *
    • {@code nextTslPublishTime} – The scheduled Unix timestamp (seconds) for the next TSL publication.
    • + *
    • {@code format} – The TSL format.
    • *
    * * @since 4.33 @@ -42,7 +43,9 @@ public class TslPublishConfigsListResponse extends ApiResponse private static final long serialVersionUID = 1L; /** - * The result of the {@code /tsl/publish/configs/list} API call. + * The next action that the implementation of the publish TSL endpoint + * should take after getting a response from Authlete's + * {@code /tsl/publish/configs/list} API. */ public enum Action { @@ -63,17 +66,18 @@ public enum Action * *

    * Each element in the array contains the publishing schedule for a service, - * including the service ID and the next scheduled publish time. + * including the service ID, format and the next TSL scheduled publish time. *

    */ private TslPublishConfigInfo[] info; /** - * Get the result of the {@code /tsl/publish/configs/list} API call. + * Get the next action that the implementation of the TSL publish endpoint should + * take after getting a response from Authlete's {@code /tsl/publish/configs/list} API. * * @return - * The result of the API call. + * The next action. */ public Action getAction() { @@ -81,10 +85,11 @@ public Action getAction() } /** - * Set the result of the {@code /tsl/publish/configs/list} API call. + * Set the next action that the implementation of the TSL endpoint should + * take after getting a response from Authlete's {@code /tsl/publish/configs/list} API. * * @param action - * The result of the API call. + * The next action. * * @return * {@code this} object. diff --git a/src/main/java/com/authlete/common/dto/TslPublishResponse.java b/src/main/java/com/authlete/common/dto/TslPublishResponse.java index 4b020541db..01cd959a0d 100644 --- a/src/main/java/com/authlete/common/dto/TslPublishResponse.java +++ b/src/main/java/com/authlete/common/dto/TslPublishResponse.java @@ -34,9 +34,6 @@ public class TslPublishResponse extends ApiResponse * The next action that the implementation of the publish TSL endpoint * should take after getting a response from Authlete's * {@code /tsl/publish} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { @@ -50,6 +47,11 @@ public enum Action * configuration. */ FORBIDDEN, + + /** + * Invalid TSL format + */ + INVALID_TSL_FORMAT, } private Action action; diff --git a/src/main/java/com/authlete/common/dto/TslResponse.java b/src/main/java/com/authlete/common/dto/TslResponse.java index 1883c78b22..7ec00285d5 100644 --- a/src/main/java/com/authlete/common/dto/TslResponse.java +++ b/src/main/java/com/authlete/common/dto/TslResponse.java @@ -34,9 +34,6 @@ public class TslResponse extends ApiResponse * The next action that the implementation of the TSL endpoint * should take after getting a response from Authlete's * {@code /tsl} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { diff --git a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java index 79ec7e2682..4eb10cbd11 100644 --- a/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java +++ b/src/main/java/com/authlete/common/dto/TslTokenStatusUpdateResponse.java @@ -35,9 +35,6 @@ public class TslTokenStatusUpdateResponse extends ApiResponse { * The next action that the implementation of the token status update endpoint * should take after getting a response from Authlete's * {@code /tsl/token/status} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index 8ed6d248e2..d1f4ebc9df 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -24,7 +24,7 @@ * This class represents a request to pre-populate unused token indexes for a * particular service. These unused indexes are later consumed when issuing * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation - * of token indices within a Token Status List (TSL) environment. + * of token indexes within a Token Status List (TSL) environment. *

    * * @since 4.33 @@ -99,7 +99,4 @@ public long getUnusedTokenIndexAdd() return unusedTokenIndexesAdd; } - - - } diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java index 1347343782..ce38b5bae6 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesResponse.java @@ -22,7 +22,7 @@ * This class represents a response to pre-populate unused token indexes for a * particular service. These unused indexes are later consumed when issuing * Verifiable Credentials (VCs) or access tokens, allowing efficient allocation - * of token indices within a Token Status List (TSL) environment. + * of token indexes within a Token Status List (TSL) environment. *

    * * @since 4.33 @@ -37,14 +37,11 @@ public class TslUnusedIndexesResponse extends ApiResponse { * The next action that the implementation of the TSL unused indexes endpoint * should take after getting a response from Authlete's * {@code /tsl/unused/indexes} API. - * - * @since 4.33 - * @since Authlete 3.0.22 */ public enum Action { /** - * A TSL publish response has been prepared successfully. + * A TSL unused indexes has been populated successfully. */ OK, From 8af7ca63aa780abccfe23468ff1c8ed7fe34c4d7 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 7 Jan 2026 13:37:24 +0500 Subject: [PATCH 47/52] minor updates in variable names --- .../com/authlete/common/dto/TslUnusedIndexesRequest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java index d1f4ebc9df..a345e9b1a7 100644 --- a/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java +++ b/src/main/java/com/authlete/common/dto/TslUnusedIndexesRequest.java @@ -54,7 +54,7 @@ public class TslUnusedIndexesRequest implements Serializable * @return * {@code this} object. */ - public TslUnusedIndexesRequest setUnusedTokenIndexLeft(long unusedTokenIndexesLeft) + public TslUnusedIndexesRequest setUnusedTokenIndexesLeft(long unusedTokenIndexesLeft) { this.unusedTokenIndexesLeft = unusedTokenIndexesLeft; @@ -67,7 +67,7 @@ public TslUnusedIndexesRequest setUnusedTokenIndexLeft(long unusedTokenIndexesLe * @return * The unused token indexes left value. */ - public long getUnusedTokenIndexLeft() + public long getUnusedTokenIndexesLeft() { return unusedTokenIndexesLeft; } @@ -81,7 +81,7 @@ public long getUnusedTokenIndexLeft() * @return * {@code this} object. */ - public TslUnusedIndexesRequest setUnusedTokenIndexAdd(long unusedTokenIndexesAdd) + public TslUnusedIndexesRequest setUnusedTokenIndexesAdd(long unusedTokenIndexesAdd) { this.unusedTokenIndexesAdd = unusedTokenIndexesAdd; @@ -94,7 +94,7 @@ public TslUnusedIndexesRequest setUnusedTokenIndexAdd(long unusedTokenIndexesAdd * @return * The unused token indexes add value. */ - public long getUnusedTokenIndexAdd() + public long getUnusedTokenIndexesAdd() { return unusedTokenIndexesAdd; } From ee047ff6ae6ab974d6e07e7b52be14d6829b99a9 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Wed, 14 Jan 2026 21:37:31 +0500 Subject: [PATCH 48/52] uncomment plugin tag in the pom.xml file --- pom.xml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index e38080d82f..b253790a59 100644 --- a/pom.xml +++ b/pom.xml @@ -308,28 +308,28 @@
    - - - - - - - - - - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + E834481D + ${env.GPG_PASSPHRASE} + + --pinentry-mode + loopback + + + + + org.codehaus.mojo From 9bc296a4119d5b7b28f2cc2607c9f93a1e0bf737 Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Thu, 22 Jan 2026 17:20:23 +0500 Subject: [PATCH 49/52] new action added --- src/main/java/com/authlete/common/dto/TslResponse.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/authlete/common/dto/TslResponse.java b/src/main/java/com/authlete/common/dto/TslResponse.java index 7ec00285d5..c715f9e06f 100644 --- a/src/main/java/com/authlete/common/dto/TslResponse.java +++ b/src/main/java/com/authlete/common/dto/TslResponse.java @@ -52,6 +52,11 @@ public enum Action * Invalid TSL format */ INVALID_TSL_FORMAT, + + /** + * TSL not found + */ + NO_TSL_FOUND } private Action action; From ca771da09c19bcdb8bda85bcf9ee967616ef85cd Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 9 Feb 2026 16:33:10 +0500 Subject: [PATCH 50/52] rebase --- .../authlete/common/dto/CredentialDeferredIssueRequest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java index e8efcdb9ef..4a482873fe 100644 --- a/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java +++ b/src/main/java/com/authlete/common/dto/CredentialDeferredIssueRequest.java @@ -145,7 +145,6 @@ public class CredentialDeferredIssueRequest implements Serializable */ private CredentialIssuanceOrder order; -<<<<<<< HEAD /** * The flag that indicates whether to deny the deferred credential request. * @@ -165,8 +164,6 @@ public class CredentialDeferredIssueRequest implements Serializable */ private int interval; -======= ->>>>>>> 5bdc3e497e47af022e68ed39e7a98ad2445f674e /** * Get the credential order that provides an instruction for issuing a * credential. From bad362bb31201ba75c4726cb21b967f9b65486dc Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 9 Feb 2026 21:57:23 +0500 Subject: [PATCH 51/52] remove commits that are not mine --- .../common/dto/AuthzDetailsElement.java | 35 ++----------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java b/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java index f69bf8ab8b..bfe2755ee1 100644 --- a/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java +++ b/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2026 Authlete, Inc. + * Copyright (C) 2019-2021 Authlete, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ */ public class AuthzDetailsElement implements Serializable { - private static final long serialVersionUID = 5L; + private static final long serialVersionUID = 4L; private String type; @@ -49,36 +49,7 @@ public AuthzDetailsElement() { } - - /** - * The copy constructor. - * - * @param element - * The source instance. - * - * @since 4.34 - */ - public AuthzDetailsElement(AuthzDetailsElement element) - { - if (element != null) - { - this.type = element.type; - this.locations = copy(element.locations); - this.actions = copy(element.actions); - this.dataTypes = copy(element.dataTypes); - this.identifier = element.identifier; - this.privileges = copy(element.privileges); - this.otherFields = element.otherFields; - } - } - - - private static String[] copy(String[] source) - { - return (source != null) ? source.clone() : null; - } - - + /** * Get the type of this element. * From 9cee9156b0080e717ba1dc1a432fdefffddf538d Mon Sep 17 00:00:00 2001 From: bilalashraf123 Date: Mon, 9 Feb 2026 22:01:36 +0500 Subject: [PATCH 52/52] remove commits that are not mine --- .../java/com/authlete/common/dto/AuthzDetailsElement.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java b/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java index bfe2755ee1..be8b29d4d9 100644 --- a/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java +++ b/src/main/java/com/authlete/common/dto/AuthzDetailsElement.java @@ -42,14 +42,6 @@ public class AuthzDetailsElement implements Serializable private String otherFields; - /** - * The default constructor. - */ - public AuthzDetailsElement() - { - } - - /** * Get the type of this element. *