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
Accept list of strings in audience claim in token auth #3742
Accept list of strings in audience claim in token auth #3742
Conversation
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks great. I'm a bit on the fence about introducing a new type just to serialize a simple struct field though. I understand you're trying to be a good citizen and make the encode/decode faster but it feels like premature optimisation to me. 🤔
It's not about serializing a simple field, but supporting both lists and single values in the token at the same time. If I replace What do you suggest? |
Ah, yes you are right. I've misread that 😬 Let me think this through -- I was thinking, since it's localised to |
BTW here is the JWT implementation that I used as an example: https://github.com/golang-jwt/jwt/blob/main/types.go#L100 So it's not like I invented anything new here. :) |
I believe you :) but it's also kinda interesting seeing the |
I can rename it if that's the only thing keeping you from accepting the PR. :) But in general, I like to name types based on what they do, not how they are used. An instance of that type is going to be the audience. I don't know if Anyway, let me know how to proceed and I'll update the PR. |
PR looks 👌 It's just me being silly here over naming...everytime I see |
The alternative is getting rid of the entire implementation and replacing it with the JWT package. ;) |
Alright, lets call this type |
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
done |
Codecov ReportBase: 57.18% // Head: 57.10% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #3742 +/- ##
==========================================
- Coverage 57.18% 57.10% -0.08%
==========================================
Files 105 106 +1
Lines 10842 10844 +2
==========================================
- Hits 6200 6193 -7
- Misses 3954 3961 +7
- Partials 688 690 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #3735