[Feature Request] Add authentication options for the repository configuration of the openapitools.json

Open
#552 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript

Research direction

Start with apps/generator-cli/src/README.md and apps/generator-cli/src/config.schema.json to understand the documented and validated repository options. Trace the repository configuration handling from the package entry points, then define how credentials are supplied safely, support authenticated query and download requests, and document the configuration and usage when both operations work with a private repository.

Written by the indexing model from the issue text.

Description

Currently it is possible to specify downloadUrl and queryUrl in the repository configuration block if a private repository should be used:

{
    "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
    "spaces": 2,
    "generator-cli": {
        "version": "5.1.1",
        "storageDir": "./openapitools-download",
        "repository": {
            "queryUrl": "https://artifactory.mycorp.com/maven-central/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200",
            "downloadUrl": "https://artifactory.mycorp.com/maven-central/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
        }
    }
}

Unfortunately the artifact-storage of my organization requires login credentials and I can thus not use this option. It would be great if something like this could be added:

{
    "generator-cli": {
        "repository": {
            "queryUrl": "https://artifactory.mycorp.com/maven-central/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200",
            "downloadUrl": "https://artifactory.mycorp.com/maven-central/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar",
            "username":"",
            "password":"",
        }
    }
}

On a general note:
I think the documentation of these configuration options could be more extensive. I learned about the repository block via a comment on an issue as it is not in the README...

Dominant language
TypeScript
Stars
2k
Forks
208
Avg merge
7h 12m
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenAPITools/openapi-generator-cli

All issues in OpenAPITools/openapi-generator-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.