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

Make it easy to use with a private maven repository #835

Open
gonzalad opened this issue Oct 16, 2024 · 0 comments
Open

Make it easy to use with a private maven repository #835

gonzalad opened this issue Oct 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gonzalad
Copy link

gonzalad commented Oct 16, 2024

Hello,

I am using the openapi-generator-cli 2.14.0 with a private maven repository (requiring authentication).

Atm using this cli with this setup involves a few steps and makes it feel a bit quirky.

I was wondering if it's possible make the whole process smoother:

  • fix NO_PROXY handling
  • easier authentication to private maven repositories (no credentials hardcoded in the openapitools.json)

Steps to follow to use the openapi-generator-cli with a private maven repository

Here are the steps I needed to follow to make the openapi-generator-cli work in my corporate environment.

Please note: I am used to have HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment vars setup.
The NO_PROXY is set in order to avoid internal http calls to be sent via the proxy.

  1. First run: I get a 503 (returned by my http proxy)
    Ok, this is the issue [BUG] The version manager does not respect the NO_PROXY environment variable. #652
    Fix: I remove all HTTP_PROXY, HTTPS_PROXY

  2. Second run: I get a unable to get local issuer certificate.
    Ok, this is related to [BUG] not usable with private repository #130 (comment)
    Fix: I add NODE_TLS_REJECT_UNAUTHORIZED=0 as environment variable

  3. Third run: Request failed with status code 401 (returned by my private maven repository)
    Fix: I hardcode my user/pwd credentials in my openapitools.json.
    I am not too happy with this solution since I'll need to do some pre-processing to be able to others dev in my team to use their credentials (or for the ci to run):

    {
      "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
       "spaces": 2,
       "generator-cli": {
         "version": "7.9.0",
         "repository": {
            "downloadUrl": "https://myuser:[email protected]/repository/mvn-proxy-group/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
       }
     }
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants