Skip to content
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

Add connection test button to LDAP SSO page #4787

Merged
merged 6 commits into from
Nov 19, 2024
Merged

Conversation

hardillb
Copy link
Contributor

@hardillb hardillb commented Nov 15, 2024

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.

  • POST /ee/sso/providers/test takes the same payload as the update provider, and needs same permissions

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

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

fixes #4782

Adds ability to test SSO LDAP credentials
Copy link

codecov bot commented Nov 15, 2024

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 ⚠️
Additional details and impacted files
@@            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 Coverage Δ
backend 78.61% <5.71%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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


🚨 Try these New Features:

@hardillb
Copy link
Contributor Author

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
Copy link
Member

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

@knolleary knolleary self-requested a review November 15, 2024 14:34
Copy link
Member

@knolleary knolleary left a comment

Choose a reason for hiding this comment

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

Having approved initially, spotted the error reporting was mismatched in one scenario in terms of the property used to store the message. Have proposed changes to align them all. Also made the test button smaller.

forge/ee/routes/sso/index.js Outdated Show resolved Hide resolved
hardillb and others added 3 commits November 15, 2024 15:05
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
@knolleary knolleary merged commit c98eaeb into main Nov 19, 2024
12 of 13 checks passed
@knolleary knolleary deleted the test-ldap-connection branch November 19, 2024 10:20
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.

Add Test LDAP credentials button to SSO page
2 participants