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

Adds HTTPS proxy support for Okta client #307

Closed
wants to merge 5 commits into from

Conversation

denysoblohin-okta
Copy link
Contributor

Adds HTTPS proxy support for Okta client.

You can configure proxy with httpsProxy property of client config.
If not provided, https_proxy / HTTPS_PROXY env var can be used.

Example:

const okta = require('@okta/okta-sdk-nodejs');

const client = new okta.Client({
  orgUrl: 'https://dev-1234.oktapreview.com/',
  token: 'xYzabc', // Obtained from Developer Dashboard
  httpsProxy: 'http://proxy.example.net:8080/'
});

Resolves: #50
Internal ref: OKTA-419414

@denysoblohin-okta
Copy link
Contributor Author

Added --allowSyntheticDefaultImports to solve issue with tsc

node_modules/https-proxy-agent/dist/agent.d.ts:2:8 - error TS1192: Module '"net"' has no default export.

2 import net from 'net';
         ~~~

See
TooTallNate/proxy-agents#120
TooTallNate/node-proxy-agent#62

});
defaultHeaders: Record<string, unknown>;
requestExecutor: RequestExecutor;
cacheStore: CacheStorage;
cacheMiddleware: typeof defaultCacheMiddleware | unknown;
agent: typeof HttpsProxyAgent | unknown;
Copy link
Contributor

Choose a reason for hiding this comment

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

Use any here, so allowSyntheticDefaultImports won't be needed for types test. The concern for allowSyntheticDefaultImports is it may break downstream types by introducing this loose flag.

eng-prod-CI-bot-okta pushed a commit that referenced this pull request Feb 28, 2022
OKTA-419414
<<<Jenkins Check-In of Tested SHA: 170db51 for eng_productivity_ci_bot_okta@okta.com>>>
Artifact: okta-sdk-nodejs
Files changed count: 9
PR Link: "#307"
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.

Add option to define a proxy in the configuration or via environment variables
4 participants