Repository navigation
Runs and email-test find the Resend key in the Credentials - #194
Merged
Merged
Conversation
The email sender and Setup's key hint both ask resend_key, which reports the key and where it came from, instead of each reading RESEND_API_KEY. No behaviour changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With RESEND_API_KEY unset or empty, email-test and Runs that ask for a notification read resend.key from ~/.thirdshift/credentials.toml, parsed as strictly as the User config, warning when others can read it. With no key anywhere, the error lists every way to give one. A refusal says where the key came from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Define the Credentials in CONTEXT.md, name the key's value secret so the sender doesn't read key.key, build the Credentials' name in one place, and cover broken Credentials in a Spec run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A Run, a Spec run and
email-testnow find the Resend key in the Credentials whenRESEND_API_KEYis unset or empty. This is how the key reaches a Run started from cron,nohupor an agent's shell.resend_key, and the existing tests pass unchanged. The second commit adds the file fallback.email-test, Setup, and a Run that asks for a notification read the file. A Run with no notification,update,versionandhelpnever read it.helptext andCONTEXT.md(the Credentials entry) describe the file and the lookup order.Evidence
The new tests run through the binary.
ResendStandIn's recordedAuthorizationheader shows which key was sent:main, the new testswithout_resend_api_key_it_sends_with_the_key_in_the_credentials,with_no_key_anywhere_it_lists_every_way_to_give_one,broken_credentials_stop_it_naming_the_file_and_the_keyandcredentials_others_can_read_are_used_with_a_warningfail.After: full
cargo testpasses, andcargo clippy --all-targets -- -D warningsis clean.Merge Danger
Door: two-way
Nothing writes the Credentials yet (that's #192), and nothing else is persisted.
Blast Radius: email
Only a user who already has a hand-written
~/.thirdshift/credentials.tomlsees a difference. If that file is broken, a Run that asks for a notification now stops before any work instead of complaining aboutRESEND_API_KEY. A Resend refusal now ends with; the key came from <source>.Unaddressed findings
Standards
ResendKey::findprints the permissions warning as a side effect. Skipped: the spec wants thewarning:line wherever the file is read. Returning it as data would widen the interface just so every caller prints the same thing.ResendKeyexposespubfields. Skipped: there are two plain values and two callers, so accessors would add interface without depth. Thekey.keychain it caused is fixed by the rename tosecret.thirdshift setup", but Setup doesn't write the key yet. Skipped: the spec mandates this text word for word, and Setup asks for the Resend key and writes the Credentials #192 makes it true.src/questions.rs) still says "RESEND_API_KEY is unset or empty" and offers onlyexport. Skipped: Setup asks for the Resend key and writes the Credentials #192 replaces that hint with the hidden key prompt.parserepeats the shape ofconfig.rs's strict parser. Skipped: the repeat is deliberate so both files are strict in the same way, and the reviewer also rated it acceptable.Spec
RESEND_API_KEYsilently overrides the saved key, an "API key is invalid" reply needs this to be actionable. It is also the one use of the key's source that the prefactor asks the lookup to report. Resend's text is still quoted word for word.nothing sentinstead of; nothing sent. Kept: the missing-key message has several lines, so a;suffix would hang off its last line.helpgained a Credentials paragraph (not asked for). Kept: the old help said the key comes only fromRESEND_API_KEY, which is now false.thirdshift setupafteremail.fromis answered, not before any questions. Skipped: moving that check to the start is Setup asks for the Resend key and writes the Credentials #192's acceptance criterion. Until then, the abort writes nothing and names the file and the key.Closes #191
🤖 Generated with Claude Code