Conversation
jennyhougen
reviewed
Jun 2, 2026
jennyhougen
left a comment
Collaborator
There was a problem hiding this comment.
Kan du lage en test som sjekker gyldig default algoritmer
jennyhougen
reviewed
Jun 15, 2026
jennyhougen
left a comment
Collaborator
There was a problem hiding this comment.
Lag tester. Jeg sender noen eksempler.
Contributor
Author
Hva slags tester føler du mangler? |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the default set of accepted DPoP alg values (notably adding RSA-PSS variants) and updates the test infrastructure + integration tests to exercise the newly-allowed algorithms.
Changes:
- Extend
DPoPProofTokenValidationParameters.ValidAlgorithmsto includeRSASSA-PSSwith SHA-384 and SHA-512. - Refactor the test token/proof builder to support switching between RSA and EC key material.
- Add integration tests that verify successful authentication for the default RSA/RSA-PSS and EC algorithms.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/Fhi.Authentication.JwtDPoP.Tests/Setup/FakeDPoPTokenBuilder.cs | Refactors the fake key/token builder to support RSA + EC keys and additional proof creation helpers. |
| tests/Fhi.Authentication.JwtDPoP.Tests/DPoPAuthenticationTests.cs | Adds algorithm-matrix tests for RSA/RSA-PSS and EC algorithms. |
| src/Fhi.Authentication.JwtDPoP/Configurations/DPoPProofTokenValidationParameters.cs | Expands the default allowed algorithm list to include additional RSA-PSS algorithms. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| string alg = SecurityAlgorithms.RsaSha256) | ||
| { | ||
| var signingCredentials = new SigningCredentials(_rsaKey, alg); | ||
| var signingCredentials = new SigningCredentials(_keyPair.PrivateKey, alg); |
| string alg = SecurityAlgorithms.RsaSha256) | ||
| { | ||
| signingCredentials ??= new SigningCredentials(_rsaKey, alg); | ||
| signingCredentials ??= new SigningCredentials(_keyPair.PrivateKey, alg); |
Comment on lines
+229
to
+238
| var p = ecKey.ECDsa.ExportParameters(true); | ||
|
|
||
| var jwkWithPrivate = new Dictionary<string, string> | ||
| { | ||
| ["kty"] = "EC", | ||
| ["crv"] = ecKey.ECDsa.ExportParameters(false).Curve.Oid.FriendlyName!, | ||
| ["x"] = Base64UrlEncoder.Encode(p.Q.X!), | ||
| ["y"] = Base64UrlEncoder.Encode(p.Q.Y!), | ||
| ["d"] = Base64UrlEncoder.Encode(p.D!) | ||
| }; |
Comment on lines
+286
to
+296
| // Ensure this matches actual list | ||
| private static readonly string[] RsaAndPssAlgorithms = | ||
| { | ||
| SecurityAlgorithms.RsaSha256, | ||
| SecurityAlgorithms.RsaSha384, | ||
| SecurityAlgorithms.RsaSha512, | ||
| SecurityAlgorithms.RsaSsaPssSha256, | ||
| SecurityAlgorithms.RsaSsaPssSha384, | ||
| SecurityAlgorithms.RsaSsaPssSha512 | ||
| }; | ||
|
|
Comment on lines
+297
to
+299
| /// <summary> | ||
| /// Tests that default RSA algorithms works as aspected | ||
| /// </summary> |
Comment on lines
+334
to
+336
| /// <summary> | ||
| /// Tests that default EC algorithms works as aspected | ||
| /// </summary> |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Legger til flre valide algoritmer (PSA er feks brukt av helseid)