Remote configuration download fails with GitLab due to hardcoded propietary PAT authentication scheme
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, gitlab, go
- Lĩnh vực
- authentication, backend
Hướng nghiên cứu
Bắt đầu trong pkg/engine/config.go tại đoạn mã dựng yêu cầu cấu hình từ xa và đặt các header Authorization và Accept từ gitAuth.envSecret. Xác nhận rằng header dành riêng cho GitHub Accept: application/vnd.github.v3+json không bắt buộc với GitLab trước khi chuyển cơ chế sang Bearer, và kiểm tra các test hiện có liên quan đến tải cấu hình từ xa trong cùng package. Hoàn thành nghĩa là URL GitLab từ báo cáo trả về 200 với PAT và đường dẫn GitHub hiện có vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 178
- Fork
- 25
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của containers/fetchit
-
Clone from public Codeberg repository fails with authentication requiredCó thể đã có người làm @cooktheryan đã nhận 16 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 65/100
containers/fetchit#425 · 3 bình luận · 1 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
containers/fetchit#242 ·
-
packaging the fetchit systemd services into RPM?Có thể làm lại được @cooktheryan đã nhận 1557 ngày trước và không có pull request nào đang mở. Đang mở
containers/fetchit#218 · 1 người được giao ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
containers/fetchit#216 · 2 bình luận ·
-
Modify Disconnected formatĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
containers/fetchit#210 ·
Tất cả issue của containers/fetchit
Issue tương tự
-
Area/Agent Lifecycle Aspect/Build & Deploy Severity/Major Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
wso2/agent-manager#2603 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outCó thể đã có người làm @anoop2811 đã nhận hôm nay. Đang mởneeds-triage type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Area/Policies Aspect/API Severity/Major Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
wso2/api-platform#4468 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
1lck/Lithe-IDEA#2432 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
dsx-ai-factory/health-validation#368 ·
Maintainer thường phản hồi trong vòng 2 ngày