Skip to content

Add built-in tokens_revoked/app_uninstalled event handlers #254

@seratch

Description

@seratch

As of today, developers have to implement their own logic to clean up database like this: https://github.com/seratch/send-it-later-for-slack/blob/e5f3555f347826576099f2f8551b03089ba7479d/app/listeners.py#L209-L226

I came to think that Bolt should provide better abstraction of installation store operations for it. If other maintainers are fine with this approach, I'm happy to add the same functionalities to other Bolt frameworks.

This pull request adds built-in event handlers for token revocations and app uninstallation. The handy way to turn the additional features on is to use enableTokenRevocationHandlers() method as below:

app = App(
    token_revocation_handlers_enabled=True
)  # installation_store required

This is equivalent to the following code:

app = App()  # installation_store required
app.event("tokens_revoked")(app.default_tokens_revoked_event_listener)
app.event("app_uninstalled")(app.default_app_uninstalled_event_listener)

See also:

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Others

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions