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

未關閉
#6,633 0 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
cpp, openapi

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.
主要語言
C++
星號
26.6k
分支
1.8k
平均合併
3 天 10 小時
30 天內合併 PR
41

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoft/winget-cli 的其他 Issue

查看 microsoft/winget-cli 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。