dnknth / ldap-ui

Minimalistic web frontend for OpenLDAP
MIT License
370 stars 28 forks source link

Slash in DN #31

Closed martin-jelen closed 1 year ago

martin-jelen commented 2 years ago

Hi,

the tree browsing feature seems to not work correctly when the DN contains slashes.

I have an example structure with the following DN: node=dc/3dab,ou=detail,o=entitlements". The use of slashes may seem to not be a good idea, however I'm not in charge of the schema.

It seems to work for /api/entry/node=dc/3dab,ou=detail,... (when searching for the node) but it doesn't when browsing.

There might be 2 different but related problems:

That's how far I got, but I'm not able to fix the issue myself, maybe you have a clue about what's going wrong there?

Kind Regards Martin Jelen

dnknth commented 2 years ago

Hello @martin-jelen,

Oh my, this is going to be tricky. Slashes in RDNs don't agree too well with the app's URL structure. Will take a moment to address this design flaw.

dnknth commented 2 years ago

Hello @martin-jelen,

I just pushed a new version on GitHub and a new image on Docker hub with corrections. Please give it a try and let me know whether it works.

martin-jelen commented 2 years ago

Hi,

thank you for the fast response and the attempted fix! Now the 404s on the server side are gone, but the UI still doesn't show the tree correctly.

This time I managed to set breakpoints in Firefox to see what's happening. The find() method doesn't seem to be able to find the node which is there (according to the debugger watch window). I can't really debug the minified JS code of the find method, so I don't see the cause for this behavior. See screenshot:

image

Kind Regards Martin Jelen

dnknth commented 2 years ago

Hello @martin-jelen,

I cannot reproduce it over here with the demo images. The tree shows correctly, and I can also edit entries in a subtree with slashes in the RDN. Could this be a browser cache issue?

dnknth commented 2 years ago

Steps I tried to reproduce:

Does this reflect your setup or did I miss something?

martin-jelen commented 2 years ago

Hi,

it shouldn't be a cache issue, I deleted the whole history in firefox because I had the same suspicion.

Your test seems correct to me. The only difference I can see is that the children of the node in my case have slashes in their names themselves.

It's possible my initial assesment was wrong and the root cause doesn't have anything to do with the slashes - or at least it's not the whole cause.

I guess the best way going forward is for me to try to debug the Javascript (not minified) code to be able to tell you more. I'm still not a JS/vue expert but debuggers are debuggers. Thank you for your support up to now!

Kind Regards Martin Jelen

On Mon, Jul 11, 2022 at 8:34 PM dnknth @.***> wrote:

Steps I tried to reproduce:

Does this reflect your setup or did I miss something?

— Reply to this email directly, view it on GitHub https://github.com/dnknth/ldap-ui/issues/31#issuecomment-1180735300, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5A2SBIXV6T5743PWNCCJLVTRSLXANCNFSM525GDXRA . You are receiving this because you were mentioned.Message ID: @.***>

dnknth commented 2 years ago

Sorry, still no luck over here, it seems to work also with slashed in the RDN of subordinate nodes, see screenshot:

Bildschirmfoto 2022-07-13 um 11 48 40

dnknth commented 2 years ago

For easier debugging you can start the UI locally in development mode against the dockerized backend with npm install && npm run dev. It then listens on http://localhost:3000.

dnknth commented 2 years ago

Is this issue still open? Otherwise, please feel invited to close it.