Skip to content

Allow removing default middleware in Bolt #689

Description

@luispollo

Firstly, thank you for building this SDK -- it's awesome!

Currently, you can call the use method to register middleware on the App class, but you cannot modify the list. For example, in my case I wanted to remove the RequestVerification middleware because we have a proxy in front of our server that already checks the Slack signatures, but I was forced to sub-class App in order to override buildDefaultMiddlewareList to filter out that middleware.

It'd be nice if there was a way to modify the middleware list outside of App's constructor, or perhaps just expose buildDefaultMiddlewareList as a public static method, so you could do something like this:

val middleware = App.buildDefaultMiddlewareList().filter { it !is RequestVerification }
val app = App(appConfig, middleware)

Alternatively, for my particular use case, a configuration flag in AppConfig controlling whether that specific middleware gets included in the list would have done the trick as well.

Cc: @gal-yardeni

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

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Activity

  1. added this to the 1.6.1 milestone on Feb 12, 2021
  2. seratch commented on Feb 12, 2021

    @seratch
    Contributor

    👋 Hi @luispollo, thanks for using Bolt for Java! We are happy to enhance this SDK to meet your needs.

    Alternatively, for my particular use case, a configuration flag in AppConfig controlling whether that specific middleware gets included in the list would have done the trick as well.

    I'm down to go with this idea. I'll work on the change and release a new version including it shortly.

  3. self-assigned this
    on Feb 12, 2021
  4. added 3 commits that reference this issue on Feb 12, 2021
    d169aa7
    9688eb9
    c6d8f9c
  5. added a commit that references this issue on Feb 16, 2021
    a864eb8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions