Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add .netrc support when using --auth-type bearer

Aperta
#1,569 0 commenti 9 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia tracciando il modo in cui --auth-type bearer gestisce le credenziali e il modo in cui l’autenticazione basic esistente legge .netrc. Confronta l’esempio machine/password richiesto con il comportamento di xh collegato, quindi verifica che l’header bearer venga prodotto senza token hard-coded e documenta la voce .netrc richiesta, se necessario.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement new

Checklist

  • I've searched for similar feature requests. The closest I found is where this was implemented in xh

Enhancement request

When using https, I don't want to have to hard-code my token in all scripts, rather I would like to have a central location where the token can be read from. This already works for the basic authentication type, but not, as far as I can tell, for the bearer auth type.

If this is implemented, then this enhancement request is to document it clearly, what needs to be in the file as https://httpie.io/docs/cli/netrc does not seem to cover it.


Problem it solves

I'm always frustrated when writing a script that I need to hard code the token in it, as it makes the script harder to share.


Additional information, screenshots, or code examples

This is implemented in xh and with the following in the .netrc:

machine host.local.lan password SecretToken

then

xh --json --auth-type bearer "https://host.local.lan/rest/api/latest/…"

Correctly sends the header:

Authorization: Bearer SecretToken

It would be great if httpie would support this same functionality.

Lingua principale
Python
Stelle
38.6k
Fork
4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di httpie/cli

Tutte le issue di httpie/cli

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.