quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.78k stars 2.68k forks source link

Probable bug in CognitoPrincipal lines 62 70 #41734

Open dk2k opened 4 months ago

dk2k commented 4 months ago

Describe the bug

Lines: String val = jwt.getClaims().get(Claims.exp); String val = jwt.getClaims().get(Claims.iat); attmept to search in Map<String, String> with enum members Claims.exp and Claims.iat They need explicit conversion to String.

Why can we still build the class? because Map.get() accepts Object param.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

dk2k commented 4 months ago

There is a good option - to use EnumMap. It will add type safety

quarkus-bot[bot] commented 4 months ago

/cc @matejvasek (amazon-lambda), @patriot1burke (amazon-lambda)