Skip to content

gws-check.py がトークンの無い状態(auth_method: none)を認証済みと判定して exit 0 を返す #2067

Open

Description

@takemi-ohama

何が起きるか

plugins/ndf/skills/google-workspace/scripts/gws-check.py の _report_gws は credential_source != "none" だけで authenticated と判定する。
client_secret.json があってトークンが無い状態では gws auth status が "credential_source": "client_secret.json"・"auth_method": "none" を返すため、
未ログインでも ok(exit 0)になり、後続の gws の操作が失敗するまで未認証に気づけない。

再現(2026-10-18 実測)

$ gws auth status   # 抜粋
"auth_method": "none",
"client_config_exists": true,
"credential_source": "client_secret.json",

この状態で gws-check.py は「gws は認証済み」と返す。

直し方の案

auth_method == "none" だけでは判定できない。確定仕様 docs/specifications/ndf-google-workspace-gws.md の決定 2 は、GOOGLE_WORKSPACE_CLI_TOKEN で認証した状態も auth_method: none を返すとして認証済みに扱い、tests/test_gws_check.py がこれを固定している。次のどちらかで、クライアントの設定だけがありトークンが無い状態を未認証(unauthenticated・exit 11)にする。

  • credential_source が none か client_secret.json(クライアントの設定だけ)なら未認証にする
  • token_cache_exists を読む。仕様の I4(読むキーは 3 つだけ)の変更を伴う

2026-10-31 に gws 0.22.5 で再現した(auth_method: none・credential_source: client_secret.json・token_cache_exists: false で gws-check.py が ok・exit 0)。

由来

issue #2065

#2065 の実装(スプリント s2065)で、台本の書き出しと Google Slides への変換の前に気づいた。

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: medium保守性・設計一貫性など、計画的に対応する

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions