Add .netrc support when using --auth-type bearer
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
- Ambito
- authentication, cli
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
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di httpie/cli
-
new
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug new
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·