Read a project's credentials from the env file its config names, and keep every value out of messages and logs
CI / tests (pull_request) Successful in 2m21s

This commit is contained in:
2026-11-13 20:22:52 +01:00
parent 9d0e2ad853
commit db88211599
14 changed files with 186 additions and 61 deletions
+7 -4
View File
@@ -2,8 +2,10 @@
usage: mattermost-dm [<message>]
Sends <message>, or else stdin, from the bot to the recipient that ~/.claude/.env names. That file
holds three KEY=value lines, and only its owner may read it, since it holds the bot's token:
Sends <message>, or else stdin, from the bot to the recipient that the project's env file names. The
project's config, ~/.claude-projects/<key>/config.toml, names that file in `env-file`, a path outside
the checkout and the config's folder, such as "~/.claude-projects/<key>.env". It holds three KEY=value
lines, and only its owner may read it, since it holds the bot's token:
MATTERMOST_URL=https://chat.example
MATTERMOST_TOKEN=<the bot's access token>
@@ -11,8 +13,9 @@ holds three KEY=value lines, and only its owner may read it, since it holds the
Exit 0 once the message is sent.
Exit 1, saying why, when Mattermost cannot be reached or refuses the message.
Exit 2, saying why, on misuse: bad arguments, an empty message, or a ~/.claude/.env that is
missing or unreadable, lacks a key, names a server off https, or that others may read.
Exit 2, saying why, on misuse: bad arguments, an empty message, a config that names no env file, or
an env file that is missing or unreadable, lacks a key, names a server off https, or that others may read.
No message, failure or log line holds the token.
"""
import typing