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

♻️ 👌 Remove Algorithm.Other #57

Conversation

jwojnowski
Copy link
Owner

This PR addresses this comment.

While I like the idea of representing only supported algorithms, the error handling becomes... suboptimal, as the implementation-agnostic JsonDecoder has a very simple interface (Either[String, A]). This means some weird string matching is necessary.

Of course, the error handling could be simplified to CouldNotDecodeHeader, perhaps with a hint in a message it might be caused by unsupported algorithm. This would avoid most of the changes from this PR. However, I quite like an explicit UnsupportedAlgorithm error, especially one that clearly states which algorithm has been provided.

@majk-p WDYT?

@jwojnowski jwojnowski force-pushed the remove-jwt-scala-dependency-no-other-algorithm branch from 646d780 to 5fb7b4f Compare November 3, 2023 13:57
Copy link

@majk-p majk-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the point of having UnsupportedAlgorithm. I think this change simplifies the code nicely. I've just had one comment.

@jwojnowski jwojnowski force-pushed the remove-jwt-scala-dependency-no-other-algorithm branch 2 times, most recently from c079c2f to 89e20d7 Compare November 4, 2023 09:38
@jwojnowski jwojnowski force-pushed the remove-jwt-scala-dependency-no-other-algorithm branch from 89e20d7 to 6e31bcd Compare November 4, 2023 09:51
@jwojnowski jwojnowski marked this pull request as ready for review November 4, 2023 09:52
@jwojnowski jwojnowski merged commit 22568c6 into remove-jwt-scala-dependency Nov 4, 2023
1 check passed
@jwojnowski jwojnowski deleted the remove-jwt-scala-dependency-no-other-algorithm branch November 4, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants