Comments (15)
Hi @dominic-p, hi @cope, hi @royetadmor,
This feature has been implemented on the develop
branch and will be available in version 6.0.0
soon.
Thank you for your support.
from ldap-server-mock.
I'm interested in using this for testing as well. I think it would really benefit from a Node.js API instead of having to deal with child_process.
I could submit a PR if that would be helpful. I'm thinking just add a main
entry to package.json pointing to a new file that exports a "createSearver" function that you can call and pass in your config and db objects.
Thanks for the fantastic software, by the way.
from ldap-server-mock.
Hi @cope,
Yes you can use NodeJs Child process to start the LDAP server mock from your tests.
The LDAP server mock will emit {status: 'started'}
on parent process when it is ready.
Hope it helps.
from ldap-server-mock.
Awesome, will try it now!
from ldap-server-mock.
Hi @maxime-beguin, can we also set groups in database, in addition to users?
from ldap-server-mock.
I keep getting ENOENT with spawn 😞
Both npx ldap-server-mock --conf=...
and ldap-server-mock --conf=...
work from command line, but throw ENOENT with spawn 😞
from ldap-server-mock.
Hmmm, even npx -h
throws ENOENT with spawn 😞
from ldap-server-mock.
The best I can get is mocha timeout and left over node processes I then have to kill 😞
Is there a working example with spawn, to look at?
from ldap-server-mock.
Hi @cope!
Have you tried forking using directly node
instead of npx
?
from ldap-server-mock.
No, but to be fair, exporting a module like LdapMockServer to be used in testing suites with start() and stop() would be way better...
from ldap-server-mock.
I agree. It would probably be more easy to use in some cases.
Maybe in a future version.
from ldap-server-mock.
@cope I had the same issue (starting and closing the server for testing purposes) and I can suggest this workaround:
Start the server: npx ldap-server-mock --conf=./ldap_server_config.json --database=./ldap_user_data.json &
(the &
is for running the server in the background)
Close the server: pgrep -f ldap-server-mock | xargs kill -9
Hope this helps! 😄
from ldap-server-mock.
HI @dominic-p,
Thank you for your support, sadly I currently don't have much time to work on this project.
I should be able to work on this during november.
You can of course submit a pull request but I won't be able to address it until november.
As you probably aslo have things to do on your side, I suggest you to wait until november.
Thanks again.
from ldap-server-mock.
Thanks for the feedback, and I totally understand. If I have some time to work on a PR I will, otherwise I'll wait on this for the time being.
from ldap-server-mock.
So cool! Thanks for that. :)
from ldap-server-mock.
Related Issues (14)
- file json HOT 1
- Need help with some examples of searching a user HOT 3
- I want to authenticate user/pass for client
- throw new Error(`Invalid arguments: ${error.message}`); HOT 2
- Can we search by multiple criteria HOT 1
- Please add basic authentication support to LDAP mock server HOT 3
- Mock returns data that it should not when searching by dn
- Throws an error moments after listening on port 3004 HOT 4
- installation instructions HOT 1
- File path is relative to the executable directory instead of the directory node executes from... HOT 2
- Error: Invalid arguments: /data/ldap-server-mock-conf.json: Unexpected token / in JSON at position 18 HOT 3
- Add example command using common ldap client HOT 2
- Manipulate LDAP search filter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ldap-server-mock.