Add automatic access token rotation for workspace apps#347
Conversation
Added token refresh method, automatic refresh on invalid_auth Added expires_at to requester object to store token TTL updated rtm_connect to check for token type split HTTP request helper into builder and submitter methods fixed token expiration ts, moved rtm_connect token type check into client Added tests
aoberoi
left a comment
There was a problem hiding this comment.
I didn't get a chance to look through the tests just yet. But I think there are enough comments here that the implementation might change significantly, so I didn't think it would be worth reviewing them just yet.
Removed unused token attribute Added enterprise_id to token updater (commented out)
Codecov Report
@@ Coverage Diff @@
## master #347 +/- ##
==========================================
+ Coverage 74.4% 76.38% +1.97%
==========================================
Files 10 10
Lines 379 415 +36
Branches 67 74 +7
==========================================
+ Hits 282 317 +35
+ Misses 88 87 -1
- Partials 9 11 +2
Continue to review full report at Codecov.
|
|
my review from the last 2 days is complete and up to date with all the latest code changes. the only unresolved issue from the previous reviews is this one: #347 (comment) |
| self.reconnect_count = 0 | ||
|
|
||
| reply = self.api_requester.do(self.token, connect_method, timeout=timeout, post_data=kwargs) | ||
| reply = self.api_requester.do(self.token, connect_method, kwargs) |
There was a problem hiding this comment.
please put the timeout argument back in and name the post_data argument.
Summary
With workspace apps comes the ability to use short-lived, expiring, tokens. This patch adds the ability for the client to automatically refresh access tokens after expiration and call your app's refresh callback to update said tokens in your app's datastore.
More info: https://api.slack.com/changelog/2018-08-workspace-token-rotation
Docs are still in progress.
Requirements (place an
xin each[ ])