Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

bug(sdk/go): edge (Cloudflare Access) token is cached for the client lifetime and never reloaded

Đang mở Phù hợp với người mới
#4,515 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/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ệ
go
Lĩnh vực
authentication

Hướng nghiên cứu

Cơ chế cache nằm trong lazyEdgeAuth tại sdk/go/openshell/v1/gateway/token.go, được truy cập thông qua resolveAuthProvider và GetRequestMetadata. Hãy so sánh với đường OIDC, vốn đọc lại oidc_token.json ở mỗi lần gọi, và tái hiện bằng các bước trong issue. Hoàn thành khi một bài test ghi lại edge_token trên đĩa thấy giá trị Bearer mới ở lần gọi tiếp theo từ cùng một client.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

state:triage-needed
User Story

I use OpenShell and build automation against its SDKs. While reviewing sdk/ I hit this behavior and reproduced it with the minimal test below against main.

Problem Statement

For auth_mode: cloudflare_jwt, lazyEdgeAuth reads edge_token once and caches it forever, unlike OIDC auth, which re-reads oidc_token.json on every call.

Impact / Why This Matters

Long-running Go processes keep sending an expired Cloudflare Access token after the user re-authenticates with the CLI and edge_token is rewritten; the process must be restarted.

Acceptance Criteria
  • After edge_token is rewritten on disk, subsequent RPCs from an existing client use the new token.
Reproduction Steps

Write edge_token = old-token; create auth via resolveAuthProvider(&Config{AuthMode: AuthModeCloudflareJWT, Dir: dir}); call GetRequestMetadata; rewrite the file to new-token; call again: still Bearer old-token.

Suggested UX (if applicable)

No response

Environment
  • OpenShell: main @ 82977e2 (2026-10-13)
  • SDK: Go (sdk/go/openshell/v1/gateway/token.go)
  • Toolchain: Go 1.25.4 linux/amd64, Node 22
Logs
BUG: still sending "Bearer old-token" after edge_token was refreshed on disk
Ngôn ngữ chính
Rust
Star
15.4k
Fork
1.7k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
374

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/OpenShell

Tất cả issue của NVIDIA/OpenShell

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.