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

feat: Added the ability to verify ID tokens using the value of id_token_signing_alg_values_supported retrieved from DiscoveryEndpoint #579

Merged
merged 4 commits into from Apr 16, 2024

Conversation

otakakot
Copy link
Contributor

@otakakot otakakot commented Apr 4, 2024

Definition of Ready

fixes #574

Fixed discoveryConfiguration.IDTokenSigningAlgValuesSupported to be set to WithSupportedSigningAlgorithms().

I thought about adding and setting discoveryConfiguration to the relyingParty struct field and doing for _, optFunc := range options{} after getting discoveryConfiguration, WithCustomDiscoveryUrl() had to be processed before client.Discover().

  • 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.

@otakakot
Copy link
Contributor Author

otakakot commented Apr 4, 2024

I would like to add a test to check the behavior of the function I am adding, which is the best way to implement it?

@muhlemmer
Copy link
Collaborator

I would like to add a test to check the behavior of the function I am adding, which is the best way to implement it?

You could add an integration test that starts the example OP and then initialize the RP with your the new option.

func testRelyingPartySession(t *testing.T, wrapServer bool) {
t.Log("------- start example OP ------")
targetURL := "http://local-site"
exampleStorage := storage.NewStorage(storage.NewUserStore(targetURL))
var dh deferredHandler
opServer := httptest.NewServer(&dh)
defer opServer.Close()
t.Logf("auth server at %s", opServer.URL)
dh.Handler = exampleop.SetupServer(opServer.URL, exampleStorage, Logger, wrapServer)

@muhlemmer muhlemmer self-requested a review April 9, 2024 12:59
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.17%. Comparing base (0992c5f) to head (9e700d2).
Report is 49 commits behind head on main.

❗ Current head 9e700d2 differs from pull request most recent head 0553090. Consider uploading reports for the commit 0553090 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #579      +/-   ##
==========================================
+ Coverage   60.06%   62.17%   +2.11%     
==========================================
  Files          80       81       +1     
  Lines        6998     6192     -806     
==========================================
- Hits         4203     3850     -353     
+ Misses       2498     2037     -461     
- Partials      297      305       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@muhlemmer muhlemmer added the waiting For some reason, this issue will have to wait. This can be a feedback that is being waited for, a de label Apr 11, 2024
@muhlemmer
Copy link
Collaborator

@otakakot I understood you still want to add tests, is that correct? I am waiting with the review until that's done.

@muhlemmer muhlemmer marked this pull request as draft April 15, 2024 08:35
@otakakot
Copy link
Contributor Author

@muhlemmer Excuse me, may I have a review at this stage?

@muhlemmer
Copy link
Collaborator

The implementation looks good to me 👍

@otakakot
Copy link
Contributor Author

I would like to add a test to check the behavior of the function I am adding, which is the best way to implement it?

You could add an integration test that starts the example OP and then initialize the RP with your the new option.

func testRelyingPartySession(t *testing.T, wrapServer bool) {
t.Log("------- start example OP ------")
targetURL := "http://local-site"
exampleStorage := storage.NewStorage(storage.NewUserStore(targetURL))
var dh deferredHandler
opServer := httptest.NewServer(&dh)
defer opServer.Close()
t.Logf("auth server at %s", opServer.URL)
dh.Handler = exampleop.SetupServer(opServer.URL, exampleStorage, Logger, wrapServer)

7572353 Tests have been added.

@otakakot otakakot marked this pull request as ready for review April 15, 2024 14:03
@muhlemmer muhlemmer enabled auto-merge (squash) April 16, 2024 08:40
@muhlemmer muhlemmer merged commit 68d4e08 into zitadel:main Apr 16, 2024
4 checks passed
Copy link

🎉 This PR is included in version 3.22.0 🎉

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
os-contribution released waiting For some reason, this issue will have to wait. This can be a feedback that is being waited for, a de
Projects
Status: Done
3 participants