Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Mar 24, 2025

What do these changes do?

Refactored the old login domain to align with CSR layer requirements and in preparation for extending confirmation logic for sharing operations (ITISFoundation/private-issues#40).

Confirmation Logic Overview

The confirmation logic is a mechanism for securely executing deferred actions via confirmation tokens. Each token, stored in the database, includes a secret code (code), an associated function (action), and relevant parameters (data).

When a user accesses a link containing the secret code, a designated GET entrypoint validates the token and triggers the corresponding action, using both the stored parameters and any additional context provided at runtime. Once executed, the confirmation entry is deleted.

This mechanism will be used to confirm sharing operations between users. For example, User A shares a project with User B and sends a confirmation link. When User B clicks the link, the system validates and executes the action, completing the sharing confirmation process.

Changes

  • Restructured domain skeleton; identified and isolated defective couplings to be redesigned in follow-up PRs
  • Added more tests to improve test coverage ahead of further refactoring

Related issue/s

How to test

cd services/web/server
pytest -vv   tests/unit/**/test_*login*.py

Dev-ops

None

@pcrespov pcrespov self-assigned this Mar 24, 2025
@pcrespov pcrespov force-pushed the is40/prepare-confirmation-servie branch from dda5c04 to 03c8cfc Compare March 25, 2025 12:52
@codecov
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

Attention: Patch coverage is 95.67308% with 9 lines in your changes missing coverage. Please review.

Project coverage is 87.45%. Comparing base (d8b3828) to head (76acf1c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7417      +/-   ##
==========================================
+ Coverage   87.37%   87.45%   +0.07%     
==========================================
  Files        1715     1717       +2     
  Lines       66613    66606       -7     
  Branches     1132     1132              
==========================================
+ Hits        58205    58251      +46     
+ Misses       8087     8034      -53     
  Partials      321      321              
Flag Coverage Δ
integrationtests 65.12% <62.98%> (-0.09%) ⬇️
unittests 86.63% <95.67%> (+0.08%) ⬆️
Components Coverage Δ
api 76.84% <ø> (ø)
pkg_aws_library 94.24% <ø> (ø)
pkg_dask_task_models_library 97.09% <ø> (ø)
pkg_models_library 92.05% <ø> (ø)
pkg_notifications_library 84.57% <ø> (ø)
pkg_postgres_database 88.11% <ø> (ø)
pkg_service_integration 70.03% <ø> (ø)
pkg_service_library 72.97% <ø> (ø)
pkg_settings_library 90.78% <ø> (ø)
pkg_simcore_sdk 85.46% <ø> (ø)
agent 96.46% <ø> (ø)
api_server 90.68% <ø> (ø)
autoscaling 96.08% <ø> (ø)
catalog 92.14% <ø> (ø)
clusters_keeper 99.24% <ø> (ø)
dask_sidecar 91.25% <ø> (ø)
datcore_adapter 98.11% <ø> (ø)
director 76.61% <ø> (ø)
director_v2 91.27% <ø> (ø)
dynamic_scheduler 97.33% <ø> (ø)
dynamic_sidecar 90.11% <ø> (ø)
efs_guardian 89.79% <ø> (ø)
invitations 93.28% <ø> (ø)
payments 92.66% <ø> (ø)
resource_usage_tracker 89.02% <ø> (-0.11%) ⬇️
storage 86.33% <ø> (+0.15%) ⬆️
webclient ∅ <ø> (∅)
webserver 85.92% <95.67%> (+0.25%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8b3828...76acf1c. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pcrespov pcrespov force-pushed the is40/prepare-confirmation-servie branch 2 times, most recently from d82ee28 to c1acfa7 Compare March 26, 2025 09:08
@pcrespov pcrespov added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Mar 26, 2025
@pcrespov pcrespov changed the title WIP: ♻️ is40/prepare confirmation service ♻️ webserver: Refactor login domain for CSR compliance and future confirmation logic Mar 26, 2025
@pcrespov pcrespov added this to the The Awakening milestone Mar 26, 2025
@pcrespov pcrespov marked this pull request as ready for review March 26, 2025 09:32
@pcrespov pcrespov enabled auto-merge (squash) March 26, 2025 09:32
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@pcrespov pcrespov force-pushed the is40/prepare-confirmation-servie branch from dbe17d7 to 54904a5 Compare March 26, 2025 15:40
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@sonarqubecloud
Copy link

@pcrespov pcrespov merged commit 653b60a into ITISFoundation:master Mar 26, 2025
93 of 94 checks passed
@pcrespov pcrespov deleted the is40/prepare-confirmation-servie branch March 26, 2025 19:11
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Apr 15, 2025
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:webserver webserver's codebase. Assigning the area is particularly useful for bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants