[Bug] Authorization and authentication failures report the wrong cause
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- authentication, authorization, cli
Hướng nghiên cứu
Start with the fs command error handling and reproduce the listed revoked-token, scoped-token, and path-format cases using the commands in the issue. Trace where authentication and authorization failures become CLI messages and exit codes. Done means the failure causes are consistent and actionable, revoked tokens report authentication failures with exit 3, and user-facing errors no longer expose the internal ':' root path.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ti version
0.2.7 (6c950c77a601d0d55394c4b2f64483ae93d522db, 2026-09-27), bundled ti-drive9 companion 60b63d6
Command family
fs
Operating system and architecture
macOS 14.6, darwin/arm64
Summary
Three problems in the same area. A caller cannot tell what actually failed, and in one case
the message points at a credential that was never used.
Covers observations 11, 10, and 2 from a review of the TiDB Cloud Filesystem documentation.
Problem 1: a deleted or disabled token reports invalid API key and exit 1
Command
ti fs delete-file-system-token --file-system-id "<fs-id>" --token-id "<token-id>"
TI_FS_TOKEN="<the revoked token>" ti fs read-file --path /reports/a.txt
Reproduction steps
- Create a file system and an owner token.
- Generate a scoped token, and confirm it can read a file.
- Revoke it with
delete-file-system-token, wait for caches to converge. - Read the same file with the revoked token.
- Repeat with
disable-file-system-tokenin place of the delete.
Expected behavior
An authentication failure, exit code 3, with a message naming the file system token.
Actual behavior
Exit code 1, and a message naming an API key that was never supplied:
ti [ERROR]: fs cat: read :/reports/a.txt: invalid API key
ti [ERROR]: fs ls: list :/reports: invalid API key
disable-file-system-token produces the same message, and
enable-file-system-token restores access, so this is not specific to deletion. An owner
token on the same file system kept working throughout, which confirms the credential path
itself was healthy.
The consequence is that a caller reads "invalid API key" and goes to rotate API keys that had
nothing to do with the failure.
Problem 2: a scoped token denial reports two different messages
Reproduction steps
- Generate a scoped token allowing
read,liston/reports. - Run each command against a path inside the scope without the required operation, and
against a path outside the scope. - Repeat with a
read,list,writescope.
Expected behavior
One message for one class of failure, carrying a reason.
Actual behavior
All 25 denied combinations exit 1, and the message depends on the command rather than on the
path.
list-files,read-file,delete-file,create-directory,move-file,describe-file,
find-files, andsearch-file-contentreportfs access denied.copy-filereports an emptyHTTP 403:when uploading to a path outside the scope,
downloading from a path outside the scope, or copying to a remote path outside the scope.
Copying from a remote path outside the scope reportsfs access deniedinstead.
The empty HTTP 403: carries no reason and reads like a network fault, so a caller cannot
separate an authorization failure from an outage. I could not find a rule that predicts which
message appears.
Problem 3: error text exposes an internal root path spelled :
Actual behavior
ti [ERROR]: fs ls: list :/: fs access denied
ti [ERROR]: fs cat: read :/reports/a.txt: invalid API key
The : prefix is not a path the caller supplied or can act on. It appears in messages a user
is asked to read, and in the same messages the documentation asks them to include in a bug
report.
Sensitive-data confirmation
No API keys, file system or Vault tokens, database credentials, connection strings, SQL, or
customer data appear above. File systems used for these measurements were deleted afterwards.
- Ngôn ngữ chính
- Go
- Star
- 3
- Fork
- 4
- Merge trung bình
- 3 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 tidbcloud/ti-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
tidbcloud/ti-cli#64 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của tidbcloud/ti-cli
Issue tương tự
-
area: metrics area: tracing contribfest enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4188 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
blinklabs-io/dingo#6074 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug remote
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
podman-container-tools/podman#30143 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component/mesheryctl kind/bug language/go
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
meshery/meshery#22993 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100