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

Allow CAs to be passed into callService, or default #462

Merged
merged 5 commits into from Apr 10, 2023

Conversation

1000TurquoisePogs
Copy link
Member

@1000TurquoisePogs 1000TurquoisePogs commented Feb 6, 2023

This PR allows a dataservice that issues a call() to provide CAs to associate with that call, overriding the default.

The default CAs will be sufficient for calls that occur within servers known to zowe's core via keystore configuration. This is generally the servers under the apiml gateway sphere. If your service needs to contact a server elsewhere, and needs its CA for verification, then you can override the CA list on the call() when you provide the call() options object.
The CAs will only be used if certificate verification is enabled, which is determined at the server config level.

Allow cas to be passed through by a caller of callService via callService options.ca = [ array of ca as in https://nodejs.org/api/https.html#httpsrequesturl-options-callback ]

Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Copy link
Member

@DivergentEuropeans DivergentEuropeans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We later reset the request's CA with your default case (this.environment.agentRequestOptions.ca)
if !(this.isAgentService || (this.service && (this.service.type === 'external' || this.service.type === 'service'))) anyway down at:
https://github.com/zowe/zlux-server-framework/pull/462/files#diff-eaecb33c0e784a4fb1b89c027e9b17fcdcd349e386abcbb4584f187927794598R971

so just making sure this order of operations/conditionals is how you wanted it to be

@1000TurquoisePogs
Copy link
Member Author

that is done because if the destination is agent, we know that the ca which should be used is the agent ca. attempts by the user to choose a different ca would invite user error.

@1000TurquoisePogs 1000TurquoisePogs merged commit 2e8738f into v2.x/staging Apr 10, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants