ldap-ui icon indicating copy to clipboard operation
ldap-ui copied to clipboard

Slash in DN

Open martin-jelen opened this issue 2 years ago • 9 comments

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:

  • when I click on the "unfold" icon, a request to the backend gets sent and ends with a 404: [07/Jul/2022:11:50:09 +0000] "GET /api/tree/node=dc/3dab,ou=detail,o=entitlements 1.1" 404 207 ...
  • when I click on the name of the node with a slash in in, no request ist sent to the backend. That seems to be related to TreeView.vue ("item" is undefined): const item = this.tree.find(dn); if (item.hasSubordinates && !item.open) await this.toggle(item);

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

martin-jelen avatar Jul 07 '22 12:07 martin-jelen

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 avatar Jul 08 '22 19:07 dnknth

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.

dnknth avatar Jul 08 '22 20:07 dnknth

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

martin-jelen avatar Jul 11 '22 15:07 martin-jelen

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 avatar Jul 11 '22 16:07 dnknth

Steps I tried to reproduce:

  • Loaded the Flintstones data into OpenLdap (see the demo)
  • Connected as admin (see LDIF for credentials)
  • Renamed ou=Pets to postalcode=12/345
  • Reloaded the tree and opened the renamed node
  • Edited one of the child entries

Does this reflect your setup or did I miss something?

dnknth avatar Jul 11 '22 18:07 dnknth

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: @.***>

martin-jelen avatar Jul 13 '22 09:07 martin-jelen

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 avatar Jul 13 '22 09:07 dnknth

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 avatar Jul 13 '22 09:07 dnknth

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

dnknth avatar Sep 02 '22 21:09 dnknth