-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add OAuth exchange capability #104
Open
yasunariw
wants to merge
7
commits into
master
Choose a base branch
from
yasu/slack-oauth
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yasunariw
force-pushed
the
yasu/slack-oauth
branch
from
December 31, 2020 09:14
a3d7e48
to
6f13fe6
Compare
yasunariw
force-pushed
the
yasu/slack-oauth
branch
from
December 31, 2020 10:32
6f13fe6
to
45f99ac
Compare
yasunariw
force-pushed
the
yasu/slack-webhook-to-api
branch
from
January 4, 2021 02:51
6e18496
to
7404d4a
Compare
This exposes a `/slack/oauth` route that Slack can query to trigger an OAuth exchange, culminating in the generation of an access token authorizing the bot to post messages to a workspace. When just working with one bot app per workspace, the token can be generated from the app dashboard and copy-pasted into the secrets file. But if the app is distributed, and a user who isn’t a bot server admin wants to install the bot into their workspace, the server needs to handle OAuth.
If access token is provided in secrets file at startup time, should copy into runtime state.
yasunariw
force-pushed
the
yasu/slack-oauth
branch
from
January 4, 2021 07:05
45f99ac
to
42c813b
Compare
yasunariw
force-pushed
the
yasu/slack-oauth
branch
from
November 30, 2021 06:29
ff7085a
to
9e0fb9a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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