Skip to content

Normalize Bearer tokens for session-bound logout - #33

Merged
chen21019 merged 1 commit into
mainfrom
fix/bearer-session-logout
Sep 16, 2026
Merged

chen21019 merged 1 commit into
mainfrom
fix/bearer-session-logout

Conversation

@chen21019

Copy link
Copy Markdown

根因

DELETE /v2-beta/token/current 從 Authorization header 取得的目前 token 保留為 Bearer <key>,但資料庫 ownership 查詢需要 bare key。Cookie 路徑正常、Bearer 路徑因此成為冪等 no-op,讓整合發行測試在 matching session delete 後仍取得 HTTP 200。

修正

  • 僅接受 bare key 或大小寫不敏感的 Bearer scheme,再正規化為資料庫 key。
  • 其他 scheme 與 malformed multipart 值維持 fail-closed。
  • 既有 client session ID matching、legacy token 相容及 204 冪等語意不變。
  • 發行版本提升至 0.183.307,README、相容性文件、source/artifact gates 同步。

驗證

  • TokenResourceManagerTest: 5/5 PASS(含真實 Bearer transport、Cookie bare key、非法 scheme/格式)
  • mvn -pl code/iaas/auth-logic -am test: 38/38 reactor modules PASS;auth-logic 81/81 PASS
  • scripts/check-pasturestack-source: PASS,version=0.183.307,auth_token_transport=bare-or-bearer-normalized
  • git diff --check: PASS

Server 整合 runtime gate 會在 immutable Engine artifact 發行後重新驗證 matching/missing/mismatched/repeated DELETE。

@chen21019
chen21019 requested a review from a team as a code owner September 16, 2026 09:41
@chen21019
chen21019 merged commit a058fc5 into main Sep 16, 2026
5 checks passed
@chen21019
chen21019 deleted the fix/bearer-session-logout branch September 16, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant