Allow a larger value for the REST source custom header (--header, currently limited to 1024 characters)

Đang mở
#6,633 0 bình luận 2 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, openapi
Lĩnh vực
api, authentication, cli

Hướng nghiên cứu

Start with WindowsPackageManagerHeaderMaxLength in RestClient.cpp and the REST API spec in winget-cli-restsource, both named in the issue. Compare how each enforces the 1024-character limit and check the project’s API versioning guidance before choosing between raising the limit and adding native authentication. Done means the selected approach removes the credential-size constraint while keeping the client and REST API spec consistent.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Issue-Feature Needs-Triage
Relevant area(s)

WinGet CLI

Description of the new feature / enhancement

The --header option sends its value as the Windows-Package-Manager header on every request to a REST source. The client rejects any value longer than 1024 characters with 0x8A150047 (APPINSTALLER_CLI_ERROR_CUSTOMHEADER_EXCEEDS_MAXLENGTH, "Header size exceeds the allowable limit of 1024 characters"). The limit is WindowsPackageManagerHeaderMaxLength in RestClient.cpp. The REST API spec in winget-cli-restsource also declares maxLength: 1024 for the header.

My scenario: a managed REST source that authenticates each device with a signed token. The header is the only supported way to give a REST source per-device credentials (#893, #3428). A token that carries an X.509 certificate and a signature easily exceeds 1024 characters. I can keep tokens under the limit, but only by dropping security properties, such as a self-contained certificate chain, or by moving trust to extra server-side lookups.

I could not find a documented reason for the 1024-character limit. Is there a technical constraint behind it?

Proposed technical implementation details

Any of these would solve it:

  1. Raise the limit, for example to 4096 or 8192 characters. Update the REST API spec (new API version or spec amendment) and the client constant.
  2. Support client-certificate or token-based authentication for REST sources natively (see #1919), so that credentials do not have to be passed through a custom header.
Ngôn ngữ chính
C++
Star
26.6k
Fork
1.8k
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
41

Chuẩn bị môi trường

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.

Issue khác của microsoft/winget-cli

Tất cả issue của microsoft/winget-cli

Issue tương tự

Thêm issue về C++

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.