Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉 適合新手
#4,515 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
72/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go

研究方向

快取位於 sdk/go/openshell/v1/gateway/token.go 中的 lazyEdgeAuth,透過 resolveAuthProvider 和 GetRequestMetadata 存取。請將其與 OIDC 路徑比較,後者每次呼叫都會重新讀取 oidc_token.json,並依照 issue 中的步驟重現。當一個重寫磁碟上 edge_token 的測試,在同一用戶端的下一次呼叫中看到新的 Bearer 值時,即視為完成。

由索引模型根據 Issue 內容生成。

描述

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
主要語言
Rust
星號
16.3k
分支
1.8k
平均合併
2 天 6 小時
30 天內合併 PR
399

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。