Skip to content

feat: enable multiple auth methods #963

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

Merged
merged 23 commits into from
May 29, 2025

Conversation

jescalada
Copy link
Contributor

Fixes #962.

This PR builds on top of #961 and adds support for multiple auth methods. Now, it's possible to enable different methods simultaneously without erroring out (local, AD, OIDC).

I'm happy to add tests to improve coverage if needed. 🙂

Changelog

  • Add support for multiple auth methods in src/service/passport
    • Update src/service/routes/auth.js routes accordingly
  • Rename /userLoggedIn to more standard /me

Copy link

netlify bot commented Mar 28, 2025

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit ddc20bf
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6837f2abf929d1000884eb97

Copy link

codecov bot commented Apr 2, 2025

Codecov Report

Attention: Patch coverage is 65.06024% with 29 lines in your changes missing coverage. Please review.

Project coverage is 49.14%. Comparing base (4e77a0f) to head (ddc20bf).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/service/passport/activeDirectory.js 15.38% 22 Missing ⚠️
src/service/passport/oidc.js 33.33% 4 Missing ⚠️
src/service/passport/local.js 92.85% 2 Missing ⚠️
src/service/routes/auth.js 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #963      +/-   ##
==========================================
+ Coverage   48.49%   49.14%   +0.64%     
==========================================
  Files          51       52       +1     
  Lines        2099     2110      +11     
  Branches      242      241       -1     
==========================================
+ Hits         1018     1037      +19     
+ Misses       1044     1036       -8     
  Partials       37       37              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@sam-holmes2 sam-holmes2 left a comment

Choose a reason for hiding this comment

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

Main concern is the hardcoded default admin user credentials

@jescalada jescalada requested a review from sam-holmes2 May 21, 2025 06:41
@jescalada
Copy link
Contributor Author

jescalada commented May 21, 2025

@sam-holmes2 Thanks for the review! I addressed most of the problems, and made extra issues for the things we should probably set aside for now.

I think we could look into improving test coverage after the service logic is refactored into TS. That will let us write better tests since it'll fix some of the type issues and error handling.

Important: #961 should be merged first as it makes these auth changes optional and configurable through proxy.config.json.

Copy link

@sam-holmes2 sam-holmes2 left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for your contribution!
Understood, #961 should be merged first (I've also approved this PR)

@JamieSlome JamieSlome merged commit dc69622 into finos:main May 29, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable multiple strategies for UI login/passport auth Refactor Auth module to allow multiple auth strategies
3 participants