fix(plugin-id): replace hardcoded entity probes with list probes for …#22
Merged
Merged
Conversation
…demo-mode detection
The previous probes ('user/admin', 'company/Ligoj' and 'group/Engineering')
checked for specific entities that don't exist in real LDAP backends, causing
the "Mode demo" banner to appear incorrectly on /new pages whenever a real
IAM provider (plugin-iam-node + plugin-id-ldap) is configured.
Switch to list endpoints with rows=1 which return 200 with an empty data
array when nothing matches, and only set code on real API failures.
Per Fabrice's review in 18 mai 13:30 meeting.
|
|
Collaborator
Author
|
Update : ce fix a expose 2 bugs en cascade qui sont maintenant traites
Aucune n'est bloquante pour merger #22, mais elles ont du sens PUT update sur containers reste un blocker separe (chantier F dans |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes a bug where the "Mode démo" banner appeared incorrectly on the
/new pages (user, company, group) whenever a real IAM provider was
configured.
Cause
Each EditView did an API probe on a specific hardcoded entity to
detect if the API was available:
These entities exist in the iam:empty fallback (which returns fake
data for any id), but don't exist in real LDAP backends. So once
plugin-iam-node + plugin-id-ldap were activated, the probe returned
code != 0(entity not found), which set demoMode to true anddisplayed the banner — even though the API was working fine.
Fix
Replace the entity probe with a list endpoint (rows=1, page=1) that
returns 200 with an empty data array when nothing matches, and only
sets
codeon real API errors:The demoMode flag is now only triggered when the API is genuinely
unavailable, not when the previously-hardcoded fixture entity
happens to not exist.
Test
Validated visually with LDAP active (plugin-iam-node + plugin-id-ldap
no regression on edit pages
Per Fabrice's review in the 18 mai 13:30 meeting.