FlowFuse / flowfuse

Connect, collect, transform, visualise, and interact with your Industrial Data in a single platform. Use FlowFuse to manage, scale and secure your Node-RED solutions.
https://flowfuse.com
Other
286 stars 64 forks source link

Add connection test button to LDAP SSO page #4787

Closed hardillb closed 6 days ago

hardillb commented 1 week ago

fixes #4782

Description

Adds ability to test SSO LDAP credentials

This adds 1 new API endpoint and a minor change to the LDAP SSO config page to add test button.

Returns 200 and empty json for success or 400 and standard error json for failure, with messages to suite the type of failure.

feedback is via Alerts, success

image

or for failure

image

Note, button is secondary, only showing blue here because mouse is over it in the screenshot

Related Issue(s)

Checklist

Labels

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 5.71429% with 33 lines in your changes missing coverage. Please review.

Project coverage is 78.61%. Comparing base (9c1babb) to head (d8df913). Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
forge/ee/routes/sso/index.js 5.71% 33 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4787 +/- ## ========================================== - Coverage 78.79% 78.61% -0.18% ========================================== Files 311 311 Lines 14787 14822 +35 Branches 3387 3396 +9 ========================================== + Hits 11651 11653 +2 - Misses 3136 3169 +33 ``` | [Flag](https://app.codecov.io/gh/FlowFuse/flowfuse/pull/4787/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse) | Coverage Δ | | |---|---|---| | [backend](https://app.codecov.io/gh/FlowFuse/flowfuse/pull/4787/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse) | `78.61% <5.71%> (-0.18%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

hardillb commented 1 week ago

Not sure how to test this without mocking a LDAP server.

The old ldap nodejs module that we deliberately didn't use has LDAP server support, so we could add it as a dev dependency to test this (and other bits of LDAP SSO)

knolleary commented 1 week ago

Agreed we aren't well setup for testing ldap in CI; lets not spend time on that right now.