Skip to content

Add built-in tokens_revoked/app_uninstalled event handlers #254

Closed

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.

Activity

  1. self-assigned this
    on Mar 6, 2021
  2. added this to the 1.5.0 milestone on Mar 6, 2021
  3. seratch commented on Apr 9, 2021

    @seratch
    ContributorAuthor

    This issue requires slack-sdk 3.5 release including slackapi/python-slack-sdk#995 - I will release skack-sdk 3.5 RC versions before working on this task.

  4. added a commit that references this issue on Apr 16, 2021
    8786783
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions