You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invalidate Discord authorization tokens on public pastes (#36)
* first run at handling discord tokens
* only invlidate on public pastes
* add note in docs
* now handle locking the resource and consuming from a bucket/cache instead of on-demand
* compartmentalize correctly and allow configurable sleep between retries for token bucket timing
* needless coroutine
* update example config
* Update views/api.py
Co-authored-by: Lilly Rose Berner <[email protected]>
* log gist creation/error and handle appropriately
* Handle network connection issues as best we can
* Update views/api.py
Co-authored-by: Lilly Rose Berner <[email protected]>
* fix logging message
* migrate handling over to database code
* remove previous needless assignment
* add annotation amendment
---------
Co-authored-by: Lilly Rose Berner <[email protected]>
"Discord bot token located and added to token bucket. Current bucket size is: %s", len(self.__tokens_bucket)
96
+
)
97
+
98
+
tokens="\n".join([m[0] formintokens])
99
+
self.__tokens_bucket[paste_id] =tokens
100
+
101
+
asyncdef_post_gist_of_tokens(self) ->None:
102
+
assertself.session# guarded in caller
103
+
json_payload: PostGist= {
104
+
"description": "MystBin found these Discord tokens in a public paste, and posted them here to invalidate them. If you intended to share these, please apply a password to the paste.",
0 commit comments