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

Ouverte
#6,633 0 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
cpp, openapi
Domaine
api, authentication, cli

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
C++
Étoiles
26.6k
Forks
1.8k
Merge moyen
3 j 10 h
PR mergées (30 j)
41

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de microsoft/winget-cli

Toutes les issues de microsoft/winget-cli

Issues similaires

Plus d'issues C++

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.