-
Notifications
You must be signed in to change notification settings - Fork 305
Fix format of ClientCertificate[Key]Data from auth plugins #480
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
Conversation
I missed this distinction of how these strings we're formatted in my last PR (#479). /assign @brendandburns |
This looks good, can you add a unit test to validate the behavior and protect against future breakage? Thanks! |
I did have a look at this quickly and wasn't sure the best way to unit test. We're calling into System.Diagnostics.Process and I couldn't think of any easy way to mock that out for a test. I could make a config that has command set to cmd.exe or /bin/sh with arguments that just cause it to echo back an expected json blob, but that seemed a big ugly. |
In other contexts, I have just used Thanks! |
I've added another test to the auth tests copying bits of the external token test and the certificate tests. N.B The external auth test looks like it would never run because it was ifdefed for NETSTANDARD_2_0 but the tests either run as netcoreapp2.0 or netcoreapp2.1 so I've removed that ifdef |
Thanks, looks like the test is failing though with some JSON parse error... |
Looking in to it, I only checked it on my windows machine (removing the exclude clause to get it to run, seemed fine but I'm going to trust the comment that cert use is intermittent) |
Seems the problem is these external tests weren't ever running so the echo handling is wrong. I've raised #484 as a smaller PR to just enable the one existing external test and get it working. After that's merged I'll merge master into here and it should fix up this PR as well. |
Cool, thanks for digging in here. I merged #484 so this should be ready once you rebase. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, Frassle The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ClientCertificateData and ClientCertificateKeyData are expected to be base64 encoded strings by CertUtils.GeneratePfx. However auth plugins return the actual "--BEGIN X---...---END X---" strings, this commit base64 encodes that to match as if it was read from the config file.