flask-ldap3-login icon indicating copy to clipboard operation
flask-ldap3-login copied to clipboard

Use Fake LDAP in dev

Open ocervell opened this issue 8 years ago • 4 comments
trafficstars

First thanks for this package (the only flask ldap package that worked for me).

I was wondering if there is a way to use a Fake LDAP for testing authentication in Development mode ?

When implementing LDAP roles / groups, it gets trickier to test when authenticating against a real LDAP (need to create fake user and assign different roles / group and test manually.

I saw that this fake LDAP is present in the tests, maybe we could enable it when DEBUG is set to True in the Flask app config ?

Thanks !

ocervell avatar Sep 19 '17 17:09 ocervell

Hey @ocervell, I agree, this would definitely be an awesome feature to have. Personally, I think I need to move away from the mock implementation into a fake implementation + a wrapper interface around LDAP to improve testability.

I'm pretty busy at the moment, but this is something that would definitely improve the library as time progresses. If I get a chance in the coming few months this will be the first feature I work on in the library. Otherwise, if you feel like this is a feature you need sooner, then i'd be willing to accept a PR.

nickw444 avatar Sep 20 '17 00:09 nickw444

Sounds good. I'll try to implement a fake interface and submit a PR when I get the chance.

ocervell avatar Sep 30 '17 19:09 ocervell

I see that there has not been any recent comments on this thread, and I don't see any relevant PR submitted, so I'll try to add this functionality and submit a PR soon.

andrewjroth avatar Jan 06 '22 17:01 andrewjroth

See cannatag/ldap3#1007 for a problem with this.

andrewjroth avatar Jan 06 '22 21:01 andrewjroth