Closed andrewrigas closed 1 year ago
Thanks for the info @andrewrigas!
You are correct; when the claim value is a string, it's only added to a singleton list if the value is not empty (source).
The code has been there for over seven years, so I'd like to try and understand any specific use cases that it was added for before making any changes.
I'm curious, what is the use case with an empty audience string that caused you to encounter this?
Hey @jimmyjames,
No use case other than just the behaviour is unexpected when an empty string is inserted. I have property-base testing enabled in my tests and when I allow empty strings to be generated I get this error.
I would like to see the reason but also this to get resolved. ~I tried instead reading it manually with java-jwt API and still got into the same problem. So, it's not just audience its a general bug with Lists and single empty string.~
Thanks @andrewrigas, do you have another example of the same behavior with Lists and single empty strings behaving the same way?
Thanks @andrewrigas, do you have another example of the same behavior with Lists and single empty strings behaving the same way?
I am not able to reproduce it again. Maybe I was doing something wrong. So probably it's just aud
claim.
No worries, I'll take a look again, but I'm pretty sure the code in question is only used for the aud
claim.
@jimmyjames let me know if this is something that can be fixed, I can also help if needed.
Hey @andrewrigas, I've made #663 to fix the issue, feel free to take a look (pretty simple change). Thanks!
Checklist
Description
When an audience with empty string pass to the payload when we try to decode it returns empty list instead of list with empty string.
Header
Payload
Reproduction
Additional context
No response
java-jwt version
4.4.0
Java version
Oracle Corporation Java 11.0.16.1