-
Notifications
You must be signed in to change notification settings - Fork 0
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
FI-3155 Fix JWT encoding method #5
Conversation
I ran |
The test isn't required anywhere in the actual test kit, so it isn't loaded into the test repository. So the spec is currently testing dead code, which is a bit odd. If this test and spec are worth keeping, you can change the definition of runnable to just be |
I see now, the |
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec| | |||
spec.description = 'UDAP Security IG Test Kit' | |||
spec.homepage = 'https://github.com/inferno-framework/udap-security-test-kit' | |||
spec.license = 'Apache-2.0' | |||
spec.add_runtime_dependency 'inferno_core', '>= 0.4.2' |
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.
Whoops!
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.
Wait, why is this changing? I see spec.add_runtime_dependency
everywhere else.
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.
I think this was a Rubocop auto-correction. When I revert it back to the original my editor gives me a blue squiggly line and says:
Gemspec/AddRuntimeDependency: Use
add_dependency
instead ofadd_runtime_dependency
.RuboCopGemspec/AddRuntimeDependency
I saw you approved the PR but from this comment can't tell if you changed your mind, so @Jammjammjamm just confirm if I'm good to go or if you want me to revert to spec.add_runtime_dependency
!
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.
Gotcha, it's good to go.
Summary
This PR updates the test kit to use the
Base64.encode64/decode64
methods for the X.509 certs in the JWTs, instead of the originalBase64.urlsafe_encode64/decode64
methods that resulted in JWTs whose signature could not be verified, causing tests to always fail.Testing Guidance
I originally discovered and fixed the bug using the presets in the following branch: https://github.com/inferno-framework/udap-security-test-kit/tree/udaped-partial-demo
However, any valid registration inputs (including Inferno's test certs) can be used to run the Dynamic Client Registration test group and demonstrate the issue.
The software statement JWT can be grabbed from the HTTP request or the test output for test 1.2.03 registration success and pasted into jwt.io. Before changing the encode method, it will say "Signature verification failed", but after the signature verification will succeed. Also, if using the partial demo presets, the test itself should "fail" with a 200 response code instead of a 400 saying "Missing validation result."