-
Notifications
You must be signed in to change notification settings - Fork 12
Implement automatic auth token checking #482
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
Conversation
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.
Pull Request Overview
This pull request implements automatic auth token checking by introducing a new configuration function and integrating a background task to validate token sessions.
- Adds a new method in the configuration for auto-checking of auth session cookies.
- Refactors the token authorisation command cog and introduces a background task cog to regularly check token validity.
- Updates the module imports accordingly.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| config.py | Adds _setup_auto_auth_session_cookie_checking to validate and convert env var values into a timedelta. |
| cogs/get_token_authorisation.py | Refactors token authorisation logic, standardizes command implementation, and adds a background task cog. |
| cogs/init.py | Adjusts imports to include the new TokenAuthorisationCheckTaskCog. |
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.
Pull Request Overview
This PR adds automatic checking of the SU platform access cookie’s validity and permissions, both on demand and as a background task.
- Introduces two new config setups for enabling auto-checking and parsing its interval.
- Extracts authorisation logic into a shared
TokenStatusenum and helper methods, and adds separate command and background task cogs. - Registers the new Task Cog in
cogs/__init__.py.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| config.py | Added _setup_auto_su_platform_access_cookie_checking and interval parsing. |
| cogs/check_su_platform_authorisation.py | Created TokenStatus, get_token_status, get_token_groups, command & task cogs. |
| cogs/init.py | Imported and registered CheckSUPlatformAuthorisationTaskCog. |
Comments suppressed due to low confidence (1)
config.py:485
- [nitpick] The variable name
raw_auto_auth_session_cookie_checkingis ambiguous and inconsistent with the method name. Consider renaming it toraw_auto_su_platform_access_cookie_checkingfor clarity.
raw_auto_auth_session_cookie_checking: str = str(
Co-authored-by: Matt Norton <[email protected]> Signed-off-by: Matty Widdop <[email protected]>
|
quite annoyingly I can't actually test if these changes have broken anything cos we don't know if anyone has a working token |
|
Indeed🙁 |
Co-authored-by: Matt Norton <[email protected]> Signed-off-by: Matty Widdop <[email protected]>
No description provided.