Skip to content

make sure pre saml login is enabled after saml is disabled - #13953

Open
DaanHoogland wants to merge 1 commit into
mainfrom
ghi12595-saml-disable-ldap-fallback
Open

make sure pre saml login is enabled after saml is disabled#13953
DaanHoogland wants to merge 1 commit into
mainfrom
ghi12595-saml-disable-ldap-fallback

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR...

Fixes: #12595

  • On enabling SAML, the user's current Source is now saved (via the generic user_details key/value store, UserDetailsDao — the same mechanism UserPasswordResetManagerImpl and the OAuth2 login command already use) before it gets overwritten to SAML2. Skipped if already SAML2/SAML2DISABLED (nothing meaningful to remember), and guarded against a null source (an edge case I found via the pre-existing test).
  • On disabling SAML with enable.login.with.disabled.saml=true, it now restores that saved source (e.g. LDAP) via a new getPreSamlSource helper, instead of hardcoding UNKNOWN. Falls back to UNKNOWN if nothing was ever recorded (pre-existing users from before this fix) or the stored value is unrecognized.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.73%. Comparing base (5e5ae0c) to head (bc42cd1).

Files with missing lines Patch % Lines
...g/apache/cloudstack/saml/SAML2AuthManagerImpl.java 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13953   +/-   ##
=========================================
  Coverage     19.72%   19.73%           
- Complexity    19941    19950    +9     
=========================================
  Files          6371     6371           
  Lines        575738   575749   +11     
  Branches      70471    70473    +2     
=========================================
+ Hits         113582   113619   +37     
+ Misses       449810   449782   -28     
- Partials      12346    12348    +2     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests 21.01% <83.33%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 24.61%
Branch coverage 18.81%

Grade Scale

Grade Line Coverage Meaning
🟢 A ≥ 80% Excellent - this code sleeps well at night 😴
🟡 B 60-79% Good - almost there, don't stop now 😉
🟠 C 40-59% Acceptable - your code is wearing a seatbelt, but no airbags 😬
🔴 D 20-39% Marginal - boldly shipping where no test has gone before 🖖
⛔ F < 20% Failing - tests? what tests? 🔥

Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ldap imported accounts which are saml enabled doesn't fallback to ldap if saml is disabled

1 participant