Skip to content

Send user-bot DMs through Slack using the token in SSM - #214

Merged
ale210 merged 1 commit into
mainfrom
212-user-bot-slack-lambda
Oct 4, 2026
Merged

ale210 merged 1 commit into
mainfrom
212-user-bot-slack-lambda

Conversation

@ale210

@ale210 ale210 commented Oct 4, 2026

Copy link
Copy Markdown
Member

Part of #212 (PR 2 of 2: the Lambda change; the SSM parameter went in with #213)

What changes did you make?

  • New src/slack-token.ts: reads the bot token from /user-bot/slack-bot-token (named by SLACK_TOKEN_PARAMETER) with decryption, caches it per execution environment, and does not cache a failure. Anything not starting xoxb-, including Terraform's placeholder, is an error
  • handler.ts: the sender is now resolved with getSender() after the tag checks and before UpdateLoginProfile, so a missing or bad token leaves the user's password unchanged
  • index.ts: deployed handler now uses SlackMessageSender; StubMessageSender stays for local runs and tests only
  • Tests: token loader, the get-sender → reset → send ordering, no token read for skipped users, and a test of the deployed wiring in index.ts with SSM, IAM and Slack mocked. 51 tests
  • README: where the token lives, how to set or rotate it, and the refuse-before-reset behaviour

Why did you make the changes (we will use this info to test)?

@ale210
ale210 merged commit ab54179 into main Oct 4, 2026
2 checks passed
@ale210
ale210 deleted the 212-user-bot-slack-lambda branch October 4, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant