-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Feature/corporate maven repository #836
base: master
Are you sure you want to change the base?
Feature/corporate maven repository #836
Conversation
The current implementation does not handle NO_PROXY env var. I removed explicit proxy handling, since axios already handle proxy related environment variables. See https://github.com/axios/axios#request-config: `proxy` defines the hostname, port, and protocol of the proxy server. You can also define your proxy using the conventional `http_proxy` and `https_proxy` environment variables. If you are using environment variables for your proxy configuration, you can also define a `no_proxy` environment variable as a comma-separated list of domains that should not be proxied.
This helps to avoid the error `unable to get local issuer certificate` when using a corporate maven repository. Another solution would be to declare the env var NODE_TLS_REJECT_UNAUTHORIZED=0.
- Implemented replaceEnvPlaceholders function to replace ${VAR} placeholders in config values with corresponding environment variable values. - If the environment variable does not exist, the placeholder remains unchanged.
- Implemented functionality to query Maven repository using authToken and strict-ssl settings from npmrc. - Updated httpModuleConfigFactory to configure HTTPS agent based on npmrc settings. - Enhanced NpmrcService to retrieve authToken and strict-ssl settings.
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors. Let me know if you need help fixing it. |
thanks for the PR I wonder if you can break down this PR into 2 smaller PRs to address the following issues separately for easier review: |
Sure Thanks ! |
Default proxy handling in axios has an issue (returns 400 Bad Request with some proxies), see axios/axios#5256. Sorry, I didn't see that issue before. Now, I understand why you didn't us the default proxy handling from axios. This PR should fix the issue #781. I did some basic tests with some similar code, and it works. I'll do more tests with the code from this PR and will keep you informed. |
Hello, this PR should make it easier to use the library with a corporate maven repository.
The PR addresses:
@wing328 or @kay-schecker is it possible for you to review this PR please ?
Contents of this PR:
This is done by removing explicit handling of HTTP_PROXY and HTTPS_PROXY: Axios already handles that (see https://github.com/axios/axios#request-config).
generator-cli.http.rejectUnauthorized
configuration to avoid the errorunable to get local issuer certificate
.this will allow to use env vars to set credentials in the queryUrl or downloadUrl:
Usage:
(the credentials used is the one matching the url of the maven server).
Usage: