feat(discordsh): add GitHub token resolver with ENV and vault fallback#7970
Merged
feat(discordsh): add GitHub token resolver with ENV and vault fallback#7970
Conversation
Resolve GitHub PAT via env vars (GITHUB_TOKEN, GITHUB_TOKEN_API, GITHUB_TOKEN_PAT) with first non-empty value winning. Falls back to Supabase vault lookup by guild ID tag when no env var is set. Also adds get_secret_by_tag() to VaultClient for tag-based secret retrieval from the vault-reader Edge Function.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
The rage_draught_used_then_attack_deals_bonus test panicked ~5% of the time because the level-1 enemy had a 20% chance to roll Flee as its next intent after each turn, removing itself from session.enemies. The test then accessed enemies[0] unconditionally. Fix: pin initial enemy intent to Defend (avoids side effects from the UseItem turn) and guard the post-attack assert against the enemy having fled.
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
discord::github::resolve_github_token(guild_id)— resolves a GitHub PAT from env vars (GITHUB_TOKEN,GITHUB_TOKEN_API,GITHUB_TOKEN_PAT) with first non-empty winning, then falls back to Supabase vault lookup by guild ID tag (github_pat:<guild_id>)VaultClient::get_secret_by_tag()to thekbvecrate for tag-based secret retrieval via thevault-readerEdge FunctionTest plan
cargo test -p axum-discordsh -- discord::github(5/5 pass)cargo test -p kbve(16/16 pass)github_pat:<guild_id>secret in vault)