Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Jun 4, 2025

What do these changes do?

This PR introduces a stand-alone entrypoint in the web-server that builds a lightweight app dedicated to authentication. This new app mainly includes the login_auth domain, which exposes a minimal REST API with the /auth:check endpoint.

In upcoming PRs, we’ll introduce a new service (tentatively wb-auth-server) based on the itisfoundation/webserver image to run this auth app. At that point, the Traefik reverse proxy's auth middleware will be configured to point to this service:

Unlike other services based on itisfoundation/webserver (e.g. webserver, wb-api-server, wb-db-event-listener, wb-garbage-collector), this one builds the domain explicitly via a dedicated entrypoint function (create_application_auth) rather than only relying on env-vars.

Changes

  • web-server
    • Extracted login_auth from the login domain
      • login depends on login_auth, but not vice versa
        image
    • Added a separate entrypoint for the auth app
      • application.py now provides create_application_auth

Related issue/s

How to test

  • Main driving test
cd services/web/server
make install-dev
pytest -vv tests/unit/with_dbs/03/test_login_auth_app.py

# general
pytest -vv tests/unit/with_dbs/**/test*login*.py

Dev-ops

@pcrespov pcrespov self-assigned this Jun 4, 2025
@pcrespov pcrespov added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Jun 4, 2025
@pcrespov pcrespov added this to the Bazinga! milestone Jun 4, 2025
@pcrespov pcrespov added the release Preparation for pre-release/release label Jun 4, 2025
@codecov
Copy link

codecov bot commented Jun 4, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 8 lines in your changes missing coverage. Please review.

Project coverage is 82.35%. Comparing base (5aa1302) to head (62aefc3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7818      +/-   ##
==========================================
- Coverage   85.40%   82.35%   -3.06%     
==========================================
  Files        1718      676    -1042     
  Lines       66138    31277   -34861     
  Branches     1137        0    -1137     
==========================================
- Hits        56488    25757   -30731     
+ Misses       9331     5520    -3811     
+ Partials      319        0     -319     
Flag Coverage Δ
integrationtests 63.54% <76.13%> (+4.02%) ⬆️
unittests 81.50% <90.90%> (-3.49%) ⬇️
Components Coverage Δ
api 76.84% <ø> (ø)
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk ∅ <ø> (∅)
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 77.65% <ø> (-7.80%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 88.33% <ø> (-1.77%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 83.07% <90.90%> (+0.63%) ⬆️

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 5aa1302...62aefc3. 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 removed the release Preparation for pre-release/release label Jun 6, 2025
@pcrespov pcrespov force-pushed the is7781/new-auth-app branch 2 times, most recently from d01fb21 to 9d33e95 Compare June 25, 2025 15:38
@pcrespov pcrespov changed the title WIP:✨ Is7781/new auth app ✨ web-server: Add Stand-alone Auth-App Entrypoint to Web-Server Jun 26, 2025
@pcrespov pcrespov modified the milestones: Bazinga!, Engage Jun 26, 2025
@pcrespov pcrespov marked this pull request as ready for review June 26, 2025 17:54
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.

very nice Thanks!
Thought, in the end we could completely offload the auth to that service. and move it to go or rust if needed.

Copy link
Contributor

@giancarloromeo giancarloromeo left a comment

Choose a reason for hiding this comment

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

Nice move

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

I very much like the idea. I wonder though if it would not be more valuable to go for a standardized, well-supported solution specializing in this. I am thinking something similar to Traefik, but for authentication. I investigated a bit potential solutions with perplexity and he suggested https://github.com/keycloak/keycloak. Might be interesting to look into.

@pcrespov
Copy link
Member Author

I very much like the idea. I wonder though if it would not be more valuable to go for a standardized, well-supported solution specializing in this. I am thinking something similar to Traefik, but for authentication. I investigated a bit potential solutions with perplexity and he suggested https://github.com/keycloak/keycloak. Might be interesting to look into.

@bisgaard-itis yes. I am aware of keycloak, actually we reveiwed it at the beginning of osparc :-) but at the time it was too big for us. Nonetheless, my point is that the new wb-auth-server is not incompatible with the idea of integrating keycloak. It can still be deployed behind it or at some point even replace it.

@sonarqubecloud
Copy link

@pcrespov pcrespov added the 🤖-automerge marks PR as ready to be merged for Mergify label Jun 27, 2025
@pcrespov
Copy link
Member Author

@mergify queue

@pcrespov pcrespov enabled auto-merge (squash) June 27, 2025 11:42
@mergify
Copy link
Contributor

mergify bot commented Jun 27, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images

@pcrespov pcrespov merged commit 1598ada into ITISFoundation:master Jun 27, 2025
94 of 97 checks passed
@pcrespov pcrespov deleted the is7781/new-auth-app branch July 17, 2025 12:01
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify 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.

5 participants