-
Notifications
You must be signed in to change notification settings - Fork 296
Updates to slack-adapter #1559
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
Merged
Merged
Updates to slack-adapter #1559
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5cbacae
Updates to slack-adapter
tracyboehrer 673cbe0
black
tracyboehrer 4a0d4c5
SlackAdapter: Updates per feedback
tracyboehrer 51f94b1
slack_client: pylint fix
tracyboehrer 8a9298e
Merge branch 'main' into trboehre/slackadapter-update
tracyboehrer bb1f2c0
slack_client: black
tracyboehrer 443cbc3
Merge branch 'trboehre/slackadapter-update' of https://github.com/mic…
tracyboehrer dc9d797
Merge branch 'main' into trboehre/slackadapter-update
axelsrz 49b3dad
Merge branch 'main' into trboehre/slackadapter-update
axelsrz 330bf54
Merge branch 'main' into trboehre/slackadapter-update
axelsrz b3f553d
Merge branch 'main' into trboehre/slackadapter-update
tracyboehrer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
11 changes: 11 additions & 0 deletions
11
libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_adatper_options.py
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
|
||
class SlackAdapterOptions: | ||
""" | ||
Class for defining implementation of the SlackAdapter Options. | ||
""" | ||
|
||
def __init__(self): | ||
self.verify_incoming_requests = True |
This file contains hidden or 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
85 changes: 32 additions & 53 deletions
85
...otbuilder/adapters/slack/slack_options.py → ...er/adapters/slack/slack_client_options.py
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,32 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
|
||
class SlackAdapterOptions: | ||
""" | ||
Defines the implementation of the SlackAdapter options. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
slack_verification_token: str, | ||
slack_bot_token: str, | ||
slack_client_signing_secret: str, | ||
): | ||
""" | ||
Initializes a new instance of SlackAdapterOptions. | ||
|
||
:param slack_verification_token: A token for validating the origin of incoming webhooks. | ||
:type slack_verification_token: str | ||
:param slack_bot_token: A token for a bot to work on a single workspace. | ||
:type slack_bot_token: str | ||
:param slack_client_signing_secret: The token used to validate that incoming webhooks originated from Slack. | ||
:type slack_client_signing_secret: str | ||
""" | ||
self.slack_verification_token = slack_verification_token | ||
self.slack_bot_token = slack_bot_token | ||
self.slack_client_signing_secret = slack_client_signing_secret | ||
self.slack_client_id = None | ||
self.slack_client_secret = None | ||
self.slack_redirect_uri = None | ||
self.slack_scopes = [str] | ||
|
||
async def get_token_for_team(self, team_id: str) -> str: | ||
""" | ||
Receives a Slack team ID and returns the bot token associated with that team. Required for multi-team apps. | ||
|
||
:param team_id: The team ID. | ||
:type team_id: str | ||
:raises: :func:`NotImplementedError` | ||
""" | ||
raise NotImplementedError() | ||
|
||
async def get_bot_user_by_team(self, team_id: str) -> str: | ||
""" | ||
A method that receives a Slack team ID and returns the bot user ID associated with that team. Required for | ||
multi-team apps. | ||
|
||
:param team_id: The team ID. | ||
:type team_id: str | ||
:raises: :func:`NotImplementedError` | ||
""" | ||
raise NotImplementedError() | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
|
||
class SlackClientOptions: | ||
""" | ||
Defines the implementation of the SlackClient options. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
slack_verification_token: str, | ||
slack_bot_token: str, | ||
slack_client_signing_secret: str, | ||
): | ||
""" | ||
Initializes a new instance of SlackClientOptions. | ||
|
||
:param slack_verification_token: A token for validating the origin of incoming webhooks. | ||
:type slack_verification_token: str | ||
:param slack_bot_token: A token for a bot to work on a single workspace. | ||
:type slack_bot_token: str | ||
:param slack_client_signing_secret: The token used to validate that incoming webhooks originated from Slack. | ||
:type slack_client_signing_secret: str | ||
""" | ||
self.slack_verification_token = slack_verification_token | ||
self.slack_bot_token = slack_bot_token | ||
self.slack_client_signing_secret = slack_client_signing_secret | ||
self.slack_client_id = None | ||
self.slack_client_secret = None | ||
self.slack_redirect_uri = None | ||
self.slack_scopes = [str] |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nitpicking but this could be changed to:
self.options = options or SlackAdapterOptions