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

fix: don't error on invalid i18n tags in discovery #407

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

muhlemmer
Copy link
Collaborator

This changes the use of []language.Tag to oidc.Locales in DiscoveryConfig. This should be compatible with callers that use the []language.Tag .

Locales now implements the json.Unmarshaler interface. With support for json arrays or space seperated strings. The latter because UnmarshalText might have been implicitly called by the json library before we added UnmarshalJSON.

Fixes: #406

Definition of Ready

  • I am happy with the code
  • Short description of the feature/issue is added in the pr description
  • PR is linked to the corresponding user story
  • Acceptance criteria are met
  • All open todos and follow ups are defined in a new ticket and justified
  • Deviations from the acceptance criteria and design are agreed with the PO and documented.
  • No debug or dead code
  • My code has no repetitions
  • Critical parts are tested automatically
  • Where possible E2E tests are implemented
  • Documentation/examples are up-to-date
  • All non-functional requirements are met
  • Functionality of the acceptance criteria is checked manually on the dev system.

This changes the use of `[]language.Tag` to
`oidc.Locales` in `DiscoveryConfig`.
This should be compatible with callers that use
the `[]language.Tag` .

Locales now implements the `json.Unmarshaler` interface.
With support for json arrays or space seperated strings.
The latter because `UnmarshalText` might have been implicetely called
by the json library before we added UnmarshalJSON.

Fixes: #406
@muhlemmer muhlemmer requested a review from stebenz June 9, 2023 11:43
@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #407 (7570c9d) into main (77436a2) will increase coverage by 0.20%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   52.08%   52.28%   +0.20%     
==========================================
  Files          74       74              
  Lines        5687     5711      +24     
==========================================
+ Hits         2962     2986      +24     
  Misses       2461     2461              
  Partials      264      264              
Impacted Files Coverage Δ
pkg/oidc/types.go 92.81% <100.00%> (+1.33%) ⬆️

@muhlemmer muhlemmer enabled auto-merge (squash) June 9, 2023 12:01
@muhlemmer muhlemmer merged commit d01a5c8 into main Jun 9, 2023
8 checks passed
@muhlemmer muhlemmer deleted the fix-discovery-i18n branch June 9, 2023 14:31
@github-actions
Copy link

github-actions bot commented Jun 9, 2023

🎉 This PR is included in version 2.6.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Spotify OIDC error - locale unmarshal issue
2 participants