Skip to content

Conversation

@julien-lang
Copy link
Contributor

This pull request simplifies the authentication module by consolidating the SsoSaml2Toolkit and SsoSaml2Rv classes into the SsoSaml2 class, removing redundant code, and updating references across the codebase. Additionally, it introduces a new method in SsoSaml2 for retrieving session data.

Authentication Module Simplification:

Code Cleanup:

  • python/tank/authentication/sso_saml2/sso_saml2_toolkit.py and python/tank/authentication/sso_saml2/sso_saml2_rv.py: Deleted these files and their respective classes (SsoSaml2Toolkit and SsoSaml2Rv) as their functionality has been merged into SsoSaml2. [1] [2]

Test Updates:

  • tests/authentication_tests/test_interactive_authentication.py and tests/authentication_tests/test_web_login.py: Updated tests to replace references to SsoSaml2Toolkit with SsoSaml2. This ensures compatibility with the refactored code. [1] [2] [3]

@julien-lang julien-lang requested a review from Copilot June 20, 2025 17:35
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 simplifies the authentication module by consolidating the SSO classes into a single SsoSaml2 class, removing redundant modules, and adding a new method to access session data.

  • Merged functionality from SsoSaml2Toolkit and SsoSaml2Rv into SsoSaml2 and deleted the old classes.
  • Updated login_dialog and related tests to reference SsoSaml2 instead of the removed classes.
  • Introduced get_session_data in SsoSaml2 to expose session details.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/authentication_tests/test_web_login.py Updated import and instantiation from SsoSaml2Toolkit to SsoSaml2.
tests/authentication_tests/test_interactive_authentication.py Adjusted mock patch and comment to target SsoSaml2.
python/tank/authentication/sso_saml2/sso_saml2_toolkit.py Deleted redundant SsoSaml2Toolkit file after merging functionality.
python/tank/authentication/sso_saml2/sso_saml2_rv.py Deleted redundant SsoSaml2Rv file after merging functionality.
python/tank/authentication/sso_saml2/sso_saml2.py Added new get_session_data method to retrieve host, user, session, and cookies.
python/tank/authentication/sso_saml2/commit_id Cleared commit ID file content; may no longer be necessary.
python/tank/authentication/sso_saml2/init.py Removed import of now-deleted SsoSaml2Toolkit.
python/tank/authentication/login_dialog.py Swapped SsoSaml2Toolkit references for SsoSaml2 initialization.
Comments suppressed due to low confidence (2)

python/tank/authentication/sso_saml2/sso_saml2.py:139

  • [nitpick] Add or update unit tests for get_session_data to verify that host, user_id, session_id, and cookies are correctly returned.
    def get_session_data(self):

@codecov
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.86%. Comparing base (0158a91) to head (be2e81f).

Files with missing lines Patch % Lines
python/tank/authentication/sso_saml2/sso_saml2.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1034      +/-   ##
==========================================
+ Coverage   79.78%   79.86%   +0.07%     
==========================================
  Files         198      196       -2     
  Lines       20773    20748      -25     
==========================================
- Hits        16574    16570       -4     
+ Misses       4199     4178      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants