Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Fake LDAP in dev #28

Open
ocervell opened this issue Sep 19, 2017 · 4 comments
Open

Use Fake LDAP in dev #28

ocervell opened this issue Sep 19, 2017 · 4 comments

Comments

@ocervell
Copy link

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 !

@nickw444
Copy link
Owner

nickw444 commented Sep 20, 2017

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.

@ocervell
Copy link
Author

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

@andrewjroth
Copy link
Contributor

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
Copy link
Contributor

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

gmacon pushed a commit that referenced this issue Jan 25, 2022
* Added Mock LDAP Functionality as described in #28

* correcting docs (path is not relative)

* Made test function cleaner using list comprehension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants