Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,569 コメント 0 件 リアクション 9 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

まず、--auth-type bearer が認証情報をどのように処理し、既存の basic 認証が .netrc をどのように読み取るかを追跡します。要求された machine/password の例を、リンク先の xh の動作と比較し、その後、bearer ヘッダーがハードコードされたトークンなしで生成されることを確認し、必要であれば必要な .netrc エントリを文書化します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
38.6k
フォーク
4k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

httpie/cli のほかの issue

httpie/cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。