Add .netrc support when using --auth-type bearer
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- authentication, cli
調査の方向性
まず、--auth-type bearer が認証情報をどのように処理し、既存の basic 認証が .netrc をどのように読み取るかを追跡します。要求された machine/password の例を、リンク先の xh の動作と比較し、その後、bearer ヘッダーがハードコードされたトークンなしで生成されることを確認し、必要であれば必要な .netrc エントリを文書化します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 38.6k
- フォーク
- 4k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
httpie/cli のほかの issue
-
new
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug new
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·