[PR #102] fix(token): handle missing access_token and simplify refresh headers #52

Open
opened 2026-03-07 21:46:52 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/hank9999/kiro.rs/pull/102

State: open
Merged: No


改动说明

fix: 处理 为空的情况

之前当 为 时,会直接进入过期时间判断逻辑,可能导致意外行为。现在提前判断,若 不存在则直接视为已过期,触发刷新流程。

fix: 修正 Social Token 刷新的 User-Agent 格式

将 User-Agent 格式从 KiroIDE-{version}-{machineId} 修正为与官方客户端一致的格式:
aws-sdk-js/1.0.18 ua/2.1 os/windows lang/js md/nodejs#20.16.0 api/codewhispererstreaming#1.0.18 m/E KiroIDE-{version}-{machineId}

同时移除了多余的请求头(Accept-EncodinghostConnection 等)。

fix: 简化 IdC Token 刷新的请求头

移除了 IdC 刷新请求中冗余的请求头(HostConnectionx-amz-user-agentAccept 等),保留必要的 Content-Type

chore: 增加 IdC Token 刷新的 tracing 日志

在 IdC 刷新流程的关键节点添加了日志输出,便于排查认证问题。

**Original Pull Request:** https://github.com/hank9999/kiro.rs/pull/102 **State:** open **Merged:** No --- ## 改动说明 ### fix: 处理 为空的情况 之前当 为 时,会直接进入过期时间判断逻辑,可能导致意外行为。现在提前判断,若 不存在则直接视为已过期,触发刷新流程。 ### fix: 修正 Social Token 刷新的 User-Agent 格式 将 User-Agent 格式从 `KiroIDE-{version}-{machineId}` 修正为与官方客户端一致的格式: `aws-sdk-js/1.0.18 ua/2.1 os/windows lang/js md/nodejs#20.16.0 api/codewhispererstreaming#1.0.18 m/E KiroIDE-{version}-{machineId}` 同时移除了多余的请求头(`Accept-Encoding`、`host`、`Connection` 等)。 ### fix: 简化 IdC Token 刷新的请求头 移除了 IdC 刷新请求中冗余的请求头(`Host`、`Connection`、`x-amz-user-agent`、`Accept` 等),保留必要的 `Content-Type`。 ### chore: 增加 IdC Token 刷新的 tracing 日志 在 IdC 刷新流程的关键节点添加了日志输出,便于排查认证问题。
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/kiro.rs#52
No description provided.