Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify asMap behaviour in JwtClaims #129

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions akka-javasdk/src/main/java/akka/javasdk/JwtClaims.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ public interface JwtClaims {
/**
* Returns all the claims as a map of strings to strings.
*
* <p>If the claim is a String claim, the value will be the raw String. For all other types, it
* will be the value of the claim encoded to JSON.
* <p>Note that all values will be encoded to JSON. This means that if the value is a string, it
* will include the quotes. E.g. "\"my-string-claim\"" for a string claim.
*
* @return All the claims represented as a map of string claim names to string values.
* @return All the claims represented as a map of string claim names to string values containing a
* JSON representation of its value.
*/
Map<String, String> asMap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ class JwtClaimsImpl(jwtClaims: RuntimeJwtClaims) extends JwtClaims {
/**
* Returns all the claims as a map of strings to strings.
*
* <p>If the claim is a String claim, the value will be the raw String. For all other types, it will be the value of
* the claim encoded to JSON.
* <p>Note that all values will be encoded to JSON. This means that if the value is a string, it will include the
* quotes. E.g. "\"my-string-claim\"" for a string claim.
*
* @return
* All the claims represented as a map of string claim names to string values.
* All the claims represented as a map of string claim names to string values containing a JSON representation of
* its value.
*/
override def asMap(): util.Map[String, String] =
jwtClaims.getAllClaimNames
Expand Down
Loading