Support agentOptions configuration for requests to CAS server #50
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.
Motivation
Since CAS is such an important auth protocol, we want to make sure we trust the other end when making validations/working with proxy ticketing. In order to do that, we'd like to be able to specify
agentOptions
on requests being made to the CAS server. Two use cases...NODE_TLS_REJECT_UNAUTHORIZED
).Implementation
To implement, I added support for
agentOptions
to theconfigure()
method, which defaults simply to{}
and is passed along to all calls torequest
.I also updated the test suite with new certs/keys that 1) don't include the port number in the CN and 2) are signed by a rootCA and updated the CAS servers to use them (it was speaking plain HTTP before). I included the csr and root CA key in case you want to reuse it or whatever. Totally up to you if you want to nuke those.
If you remove the setting of the
agentOptions
in allcas.configure
calls in the test suite, you'll see that they fail. I'm more than happy to add/consider other tests that should fit into this, if you can think of any others.