OpenAPITools / OpenAPITools/openapi-generator-cli

[BUG] Not usable with private repository with authentication

Đang mở
#660 3 bình luận 1 reaction 1 người được giao Xem trên GitHub

@kay-schecker đang làm issue này rồi.

Từ ngày 17/8/2022.

bug
Ngôn ngữ chính
TypeScript
Star
2k
Fork
208
Merge trung bình
7 giờ 12 phút
Pull request đã merge (30 ngày)
6

Mô tả

⚠️ Important Notice

Please differentiate the bug

This repository is not responsible for the actual code generation. If you have problems with the code generation, please open the bug at OpenAPITools/openapi-generator.

Please also check if the bug is already known before you open a new bug.


🐛 Bug Report:

Describe the bug

I am trying to use the cli using private nexus registry, which requires authentication for connection.
I referenced #130 and tried the connection.

After setting up downloadUrl in the openapitools.json file, the connection returns 401 Unauthorized error.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Edit openapitools.json
{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "6.0.1",
    "repository": {
      "downloadUrl": "http://[url-to-private-repo]/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
    }
  }
}
  1. Enter command openapi-generator-cli
  2. See error
Expected behavior
Error Message
Download 6.0.1 ... 
Download failed, because of: "Request failed with status code 401" 

Response:
date Wed, 17 Aug 2022 03:52:40 GMT
server Nexus/3.30.1-01 (OSS)
x-content-type-options nosniff
content-security-policy sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
x-xss-protection 1; mode=block
www-authenticate BASIC realm="Sonatype Nexus Repository Manager"
content-length 0
connection close
content-type application/java-archive
x-content-type-options nosniff
C:\Users\[username]\AppData\Roaming\npm\node_modules\@openapitools\openapi-generator-cli\main.js:679
                error ? reject(new Error(stderr)) : resolve(stdout);
content-security-policy sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
x-xss-protection 1; mode=block
www-authenticate BASIC realm="Sonatype Nexus Repository Manager"
content-length 0
connection close
                               ^

Error: Error: Unable to access jarfile C:\Users\[username]\AppData\Roaming\npm\node_modules\@openapitools\openapi-generator-cli\versions\6.0.1.jar

    at C:\Users\feliwpy2\AppData\Roaming\npm\node_modules\@openapitools\openapi-generator-cli\main.js:679:32
    at ChildProcess.exithandler (node:child_process:404:5)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
Operation System (please complete the following information):
  • OS: Windows 10
Package System (please complete the following information):
  • npm version 8.1.2
  • "@openapitools/openapi-generator-cli": "^2.5.1",

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.