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

handle optional request agentOptions #84

Merged
merged 2 commits into from
Jul 9, 2019
Merged

handle optional request agentOptions #84

merged 2 commits into from
Jul 9, 2019

Conversation

cconcannon
Copy link
Contributor

@cconcannon cconcannon commented Mar 7, 2019

This commit resolves issue #67 by passing an optional property requestAgentOptions to set the request library's agentOptions property. Setting agentOptions allows, for example, a trust of private certificate authorities to be established.

An example to trust a private certificate authority chain for a private network jwks_uri:

const jwksClient = require("./node-jwks-rsa");
const fs = require("fs");
const path = require("path");
const caFile = path.resolve(__dirname, "ssl/ca-bundle.pem");

const client = jwksClient({
  jwksUri: "https://my-private-ca-tls-endpoint/ext/oauth2/jwks",
  requestAgentOptions: {
    ca: fs.readFileSync(caFile)
  }
});

Tests have been added to ensure that:

  1. the agentOptions are set when JwksClient is configured with the optional requestAgentOptions property

  2. the agentOptions are not set by default

Copy link

@amir-bio amir-bio left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. It would be great if you also added a note to the README as well and link to https://github.com/request/request#using-optionsagentoptions

@cconcannon
Copy link
Contributor Author

@amirha97 I updated the README with an example config to provide a private certificate authority, and I linked to the request library agentOptions documentation as requested. Thanks for reviewing.

@raijinsetsu
Copy link

Is this going anywhere? It looks like it's been stuck for a few months.

@cconcannon cconcannon requested a review from a team July 8, 2019 23:43
@luisrudge luisrudge merged commit af5120b into auth0:master Jul 9, 2019
@luisrudge
Copy link
Contributor

released in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants