Skip to content

Conversation

@MattyTheHacker
Copy link
Member

@MattyTheHacker MattyTheHacker commented May 3, 2025

No description provided.

@MattyTheHacker MattyTheHacker added the enhancement New feature or request label May 3, 2025
@MattyTheHacker MattyTheHacker self-assigned this May 3, 2025
@MattyTheHacker MattyTheHacker linked an issue May 3, 2025 that may be closed by this pull request
@MattyTheHacker MattyTheHacker enabled auto-merge (squash) May 3, 2025 19:19
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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 TokenStatus enum 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_checking is ambiguous and inconsistent with the method name. Consider renaming it to raw_auto_su_platform_access_cookie_checking for clarity.
        raw_auto_auth_session_cookie_checking: str = str(

@MattyTheHacker
Copy link
Member Author

quite annoyingly I can't actually test if these changes have broken anything cos we don't know if anyone has a working token

@CarrotManMatt
Copy link
Member

Indeed🙁

Co-authored-by: Matt Norton <[email protected]>
Signed-off-by: Matty Widdop <[email protected]>
@MattyTheHacker MattyTheHacker merged commit da721e6 into main Jul 5, 2025
10 checks passed
@MattyTheHacker MattyTheHacker deleted the 481-auto-auth-check branch July 5, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request sync Request bots to automatically keep this PR up to date with it's base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement automatic checking that the auth token is still valid

5 participants