-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #487 from DrDroidLab/slack_bot_demo
Slack bot demo
- Loading branch information
Showing
5 changed files
with
85 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from accounts.authentication import AccountApiTokenAuthentication | ||
from accounts.cache import GLOBAL_ACCOUNT_API_TOKEN_CACHE | ||
from accounts.models import AccountApiTokenUser | ||
|
||
|
||
class SlackBotApiTokenAuthentication(AccountApiTokenAuthentication): | ||
def authenticate(self, request): | ||
key = request.GET.get('token') | ||
token = GLOBAL_ACCOUNT_API_TOKEN_CACHE.get(api_key=key) | ||
return AccountApiTokenUser(token.account_id, token.created_by.email), token |
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
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
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
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