Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow removing default middleware in Bolt #689

Closed
1 of 6 tasks
luispollo opened this issue Feb 12, 2021 · 1 comment · Fixed by #690
Closed
1 of 6 tasks

Allow removing default middleware in Bolt #689

luispollo opened this issue Feb 12, 2021 · 1 comment · Fixed by #690
Assignees
Labels
enhancement M-T: A feature request for new functionality project:bolt
Milestone

Comments

@luispollo
Copy link

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)
@seratch seratch added enhancement M-T: A feature request for new functionality project:bolt and removed untriaged labels Feb 12, 2021
@seratch seratch added this to the 1.6.1 milestone Feb 12, 2021
@seratch
Copy link
Member

seratch commented Feb 12, 2021

👋 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.

@seratch seratch self-assigned this Feb 12, 2021
seratch added a commit to seratch/java-slack-sdk that referenced this issue Feb 12, 2021
seratch added a commit to seratch/java-slack-sdk that referenced this issue Feb 12, 2021
seratch added a commit to seratch/java-slack-sdk that referenced this issue Feb 13, 2021
seratch added a commit that referenced this issue Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality project:bolt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants