Remote configuration download fails with GitLab due to hardcoded propietary PAT authentication scheme
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github, gitlab, go
調査の方向性
pkg/engine/config.go の、リモート設定リクエストを構築し、Authorization と Accept ヘッダーを gitAuth.envSecret から設定するコードから始めてください。スキームを Bearer に切り替える前に、GitHub 固有の Accept: application/vnd.github.v3+json ヘッダーが GitLab で必須ではないことを確認し、同じパッケージ内のリモート設定ダウンロードに関する既存のテストを確認してください。完了とは、レポートの GitLab URL が PAT で 200 を返し、既存の GitHub パスが引き続き動作することを意味します。
索引モデルが issue の本文から書いたものです。
説明
FetchIt fails to download remote configuration files hosted in private GitLab repositories when using PAT authentication through gitAuth.envSecret.
The current implementation in pkg/engine/config.go uses a GitHub-specific authorization scheme:
req.Header.Add("Authorization", "token "+pat)
req.Header.Add("Accept", "application/vnd.github.v3+json")
GitLab supports Authorization: Bearer and PRIVATE-TOKEN headers for access token authentication through its REST API.
Steps to reproduce
- Create a private GitLab repository containing a FetchIt configuration file.
- Generate an access token with
read_repositorypermissions. - Expose the token to FetchIt using a Podman secret:
Secret=gitlab_token,type=env,target=GITLAB_TOKEN
- Configure FetchIt to reload its configuration using the GitLab repository files API:
gitAuth:
envSecret: GITLAB_TOKEN
configReload:
schedule: "*/1 * * * *"
configUrl: "https://gitlab.example.com/api/v4/projects/123/repository/files/config%2Ffetchit.yaml/raw?ref=main"
Actual behavior
The remote configuration download fails.
The issue can be reproduced independently of FetchIt using curl against the same URL with the same access token.
| Authentication header | HTTP response |
|---|---|
Authorization: token <PAT> |
404 |
Authorization: Bearer <PAT> |
200 |
PRIVATE-TOKEN: <PAT> |
200 |
Both successful requests return the expected YAML configuration.
The HTTP 404 response appears to be caused by GitLab concealing the existence of an inaccessible private resource rather than by an incorrect URL.
Expected behavior
FetchIt should support authenticated remote configuration downloads from Git providers other than GitHub, including GitLab.
Suggested solution
Replace the GitHub-specific token authentication scheme
with the standardized Bearer authentication scheme:
- req.Header.Add("Authorization", "token "+pat)
+ req.Header.Add("Authorization", "Bearer "+pat)
Bearer authentication is defined in RFC 6750 and is
supported by both GitHub and GitLab.
GitHub's official REST API documentation explicitly supports
both Bearer and token authentication schemes.
This change would improve interoperability without introducing
additional configuration options or provider-specific logic..
References
- Related Podman secret support: PR #286
- GitLab REST API authentication
- GitLab repository files API
Scope
This issue concerns HTTP authentication for remote configuration downloads, not Git repository clone or fetch operations.
- 主要言語
- Go
- スター
- 178
- フォーク
- 25
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
containers/fetchit のほかの issue
-
Clone from public Codeberg repository fails with authentication required対応中かも @cooktheryan が 16 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 65/100
containers/fetchit#425 · コメント 3 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
containers/fetchit#242 ·
-
packaging the fetchit systemd services into RPM?再び着手できるかも @cooktheryan が 1557 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
containers/fetchit#218 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
containers/fetchit#216 · コメント 2 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
containers/fetchit#210 ·
containers/fetchit の issue をすべて見る
似ている issue
-
Area/Agent Lifecycle Aspect/Build & Deploy Severity/Major Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
wso2/agent-manager#2603 ·
メンテナーはふだん 1 日以内に返信
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it out対応中かも @anoop2811 が今日担当しました。 オープンneeds-triage type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Area/Policies Aspect/API Severity/Major Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
wso2/api-platform#4468 ·
メンテナーはふだん 1 日以内に返信
-
review: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
1lck/Lithe-IDEA#2432 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
dsx-ai-factory/health-validation#368 ·
メンテナーはふだん 2 日以内に返信