flask-ldap3-login
flask-ldap3-login copied to clipboard
Use Fake LDAP in dev
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 !
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.
Sounds good. I'll try to implement a fake interface and submit a PR when I get the chance.
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.
See cannatag/ldap3#1007 for a problem with this.