Empty auth-scheme support
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- go
調査の方向性
config/http_config.go の issue でリンクされているバリデーションコードから始め、明示的に空の認証タイプと認証情報を指定して scrape 設定を再現します。生成された Authorization ヘッダーを期待される curl の形式と照合し、空のスキームによってデフォルトの Bearer プレフィックスが追加されないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
What did you do?
I want to scrape target secured via Authorization header, curl example:
curl -H "Authorization: $token" ...
Per docs i should be able to not use Bearer
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config
authorization:
# Sets the authentication type of the request.
[ type: <string> | default: Bearer ]
So i've set:
authorization:
type: ''
But in tcpdump i still see that Bearer prefix is added before token.
Validation code:
https://github.com/prometheus/common/blob/f57586dab602b7ae2607c552438a23a551f38773/config/http_config.go#L232
What did you expect to see?
I expect to being able to choose any auth-scheme, including nil one.
What did you see instead? Under which circumstances?
I see that Bearer auth-scheme is forced, i.e.:
curl -H "Authorization: Bearer $token" ...
instead of:
curl -H "Authorization: $token" ...
Environment
- Prometheus version:
prometheus, version 2.31.1 (branch: HEAD, revision: 411021ada9ab41095923b8d2df9365b632fd40c3)
build user: root@9419c9c2d4e0
build date: 20211105-20:35:02
go version: go1.17.3
platform: linux/amd64
- Prometheus configuration file:
scrape_configs:
- job_name: "auth"
authorization:
type: ''
credentials: SECRET_TOKEN
static_configs:
- targets:
- a.b.c:443
This could be fixed by verifying that type is explicitly set to empty string before callingTrimSpace. I can send PR if such a solution is fine.
- 主要言語
- Go
- スター
- 297
- フォーク
- 380
- 平均マージ
- 3日 18時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prometheus/common のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
prometheus/common#1051 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
prometheus/common#1023 ·
メンテナーはふだん 2 日以内に返信
-
expfmt: OpenMetrics 1.0 output with a unit that is not a name suffix fails the whole scrape in Prometheus対応中かも @itsmeasadali が 43 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
prometheus/common#1005 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
prometheus/common#876 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Feature request: Add client_assertion field for oauth2 jwt-bearer grant type対応中かも @alliasgher が 220 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
prometheus/common#869 ·
メンテナーはふだん 2 日以内に返信
prometheus/common の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slash対応中かも @patelshivani2283-lab が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
keyxmakerx/Chronicle#2616 ·
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信