简体   繁体   English

如何为Django项目创建模拟LDAP服务器?

[英]How to create mock LDAP server for Django project?

I'm using django-auth-ldap and was wondering what is the easiest way to create a python mock ldap server. 我正在使用django-auth-ldap并且想知道创建python mock ldap服务器的最简单方法是什么。 The problem arises when I'm developing away from the network the ldap server is located on. 当我正在远离ldap服务器所在的网络时,问题就出现了。 Testing is another scenario. 测试是另一种情况。 I want to avoid creating an instance of an actual ldap server locally. 我想避免在本地创建一个实际的ldap服务器的实例。

django-auth-ldap's tests.py includes a simple mock ldap for its own tests. django-auth-ldap的tests.py包含一个简单的模拟ldap用于自己的测试。 This was spun off by someone else into the fakeldap package, although I haven't been following progress. 这是由其他人分拆到fakeldap包中,虽然我没有跟进进展。 The right answer is probably to start with fakeldap and contribute if necessary. 正确的答案可能是从fakeldap开始并在必要时做出贡献。

UPDATE: A more serious effort to spin off a mock LDAP layer is currently underway. 更新:目前正在进行更加严肃的分离模拟LDAP层的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM