mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-11-25 09:37:20 +08:00
EnvCredential gates activeness on the trimmed env value and buildClientFromEnv trims before authenticating, but `auth token` emitted os.Getenv(kind) raw. A WEKNORA_TOKEN / WEKNORA_API_KEY carrying stray padding or a trailing newline (common when CI secret stores materialize env vars) was therefore emitted verbatim: the CLI's own requests succeeded while every captured $(weknora auth token) substitution sent whitespace-bearing credentials. Emit strings.TrimSpace(os.Getenv(kind)) so the scripting helper exposes the same credential value the CLI itself sends. Co-authored-by: ydflow <314143294+ydflow@users.noreply.github.com>