Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the task
Add OAuth exchange functionality to the bot server, to allow distribution of the app.
For a single-workspace use case, the Slack access token used in #94 can be obtained manually through the app dashboard. But if there is a need to distribute monorobot to multiple users who don't have access to the app or its credentials, the server must be able to engage in an OAuth exchange.
This PR exposes an endpoint
/slack/oauth
, which Slack will query when a user initiates the OAuth workflow by authorizing the app to access their workspace.For more information, refer to the comments for
process_slack_oauth
in filelib/action.ml
.How to test
In addition to the slack payload tests, new tests have been defined in slack_oauth_test.ml for the oauth exchange.
References