Passwords and refresh tokens go only to the system keychain; a refused keychain keeps them in memory until exit and says why. Gmail and Microsoft sign in by authorization code with S256 PKCE on a loopback redirect; refresh tokens are kept, and revoked grants ask to sign in again. Client IDs come from the build (env or oauth.env). ureq trace records never reach the log. Co-Authored-By: Claude <noreply@anthropic.com>
2.3 KiB
FAIL
-
crates/ely-mail-engine/src/oauth.rs:99 — [P1] Google 授权 URL 没有
access_type=offline。Google 文档规定,请求离线访问才会在换码时取得刷新令牌。首次添加 Gmail 时,即使用户授权成功,也可能只得到短期 access token;到期或重启后无法完成 C12.4 要求的刷新。隔离探针调用实际google()和SignIn::start,断言该参数时得到None(.work/C12.4-r1/linux-probes.log);现有测试的自定义 provider 掩盖了这个缺口。修复方向:Google 授权请求加入离线访问参数,并测试内置 provider 的授权参数与刷新令牌签发条件。 -
crates/ely-mail-engine/src/oauth.rs:60 — [P2] Microsoft scope 缺少
profile,但邮箱读取依赖preferred_username作为email缺失时的回退。Microsoft 文档明确该 claim 需要profilescope。因此,未提供emailclaim 的账号完成授权后,也拿不到承诺的回退值,Tokens.email仍为空。实际microsoft()的参数探针确认没有申请此 scope(.work/C12.4-r1/linux-probes.log)。修复方向:申请该 claim 所需的 scope,补测 Microsoft 无 email、使用 preferred_username 的路径。 -
crates/ely-mail-engine/build.rs:16 — [P2]
read_to_string的所有错误都直接返回,文件不存在与文件损坏、无法读取被混为一谈。复现:隔离编译原始 build.rs,让其读取含无效 UTF-8 的oauth.env,退出码仍为 0,且没有配置错误提示(.work/C12.4-r1/config-invalid-utf8.log)。正常没有环境变量的本机构建会悄悄忽略已有配置,把登录变为Unavailable,违反错误必须暴露与坏配置构建失败的要求。修复方向:只允许 NotFound 表示未配置,其余读取错误使构建失败并说明原因,补测损坏与不可读文件。 -
crates/ely-mail-engine/src/oauth/loopback.rs:14 — [P3] 新增注释
Serves the redirect until it carries a code or an error.共 11 词,超过 agents.md 的十词限制;运行项目tests/scripts/comments.py可复现该行失败。修复方向:缩短到十词以内。