Skip to content

Feat/027 slack edit user messages - #73

Merged
hendrikebbers merged 5 commits into
mainfrom
feat/027-slack-edit-user-messages
Nov 27, 2026
Merged

hendrikebbers merged 5 commits into
mainfrom
feat/027-slack-edit-user-messages

Conversation

@hendrikebbers

Copy link
Copy Markdown
Contributor

This pull request introduces a new optional feature to the spring-services-slack module: the ability to edit users' Slack messages, in their name, after obtaining user authorization. The feature is off by default and requires explicit configuration, including a new database table for encrypted user tokens. The documentation has been updated to describe the setup, security, and behavior of this feature, including migration steps and configuration requirements. Additional improvements include clarifications on secrets management and updates to project structure documentation.

New Feature: Editing Users' Slack Messages

  • Added support for editing users' Slack messages by storing user tokens (with chat:write scope) encrypted in the database. Includes a new OAuth authorization flow, endpoints, and database table (oe_spring_services.slack_user_tokens). [1] [2] [3]
  • Documented the new feature in README.md, including sample listener code, configuration properties, and security considerations.
  • Added a release upgrade prompt and migration guide in docs/releases/upgrade-to-2.1.md, detailing migration steps, Slack app setup, and configuration.
  • Described the behaviors, activation scenarios, error handling, and security aspects in a new specification file docs/specs/027-slack-edit-user-messages/behaviors.md.

Documentation and Project Structure Updates

  • Updated the project structure section in README.md to reflect that spring-services-slack now supports both receiving and editing user messages.
  • Extended docs/TODO.md with deferred or open questions related to this feature, including token encryption key rotation, custom success pages, and editing the bot's own messages.

hendrikebbers and others added 5 commits November 24, 2026 22:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SlackService.updateUserMessage(event, text) replaces the text of a message
a user wrote, in that user's name, so Slack shows it as edited. Slack lets
only the author edit a message, so each user authorizes once through a
module-owned OAuth v2 flow:

- GET /slack/oauth/authorize redirects to Slack's dialog with the user
  scope chat:write only; a state cookie protects the callback.
- GET /slack/oauth/callback exchanges the code and stores the token for
  the user Slack names in its answer, never for one named in the request.
- Tokens are stored AES-256-GCM encrypted, bound to workspace and user,
  through the SlackUserTokenStore SPI (default: JDBC, table
  oe_spring_services.slack_user_tokens, no entity in core).
- Without a token, SlackUserAuthorizationRequiredException carries the
  link. A token Slack rejects is removed; tokens_revoked removes it at
  once.
- The edit is sent with blocks = [], so Slack displays the new text
  instead of the previous rich-text blocks.

Opt-in via open-elements.slack.user-authorization.enabled; without the
required properties the application starts with a warning and the
feature refuses to work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pec 027)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Combine the 2.1 upgrade guide: asynchronous webhook delivery and
editing users' Slack messages as separate sections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…redException

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hendrikebbers
hendrikebbers merged commit 51dadf4 into main Nov 27, 2026
1 check passed
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