An open API service indexing awesome lists of open source software.

https://github.com/ps78674/gorestldap

LDAP server with REST API & file backends
https://github.com/ps78674/gorestldap

go golang ldap ldap-authentication ldap-server

Last synced: 2 months ago
JSON representation

LDAP server with REST API & file backends

Awesome Lists containing this project

README

          

## **Simple LDAP server with REST API & file backends.**
Server loads JSON data from backend and holds it in memory for future processing in LDAP requests. Data will be reloaded after timeout specified in `--interval` arg.
There are two backends: rest (loads json from REST API) and file (loads json from file).

Server support bind, search, compare and modify (only replace) operations. It can handle paged results search control (1.2.840.113556.1.4.319).
Search with unsupported critical controls requested can be handled with `respect_control_criticality` set to false.

### **Usage**
```
gorestldap: LDAP server with REST API & file backends

Usage:
gorestldap [-b -c -B -L -I -l -d]

Options:
-c, --config config file path [default: config.yaml, env: CONFIG_PATH]
-b, --backend backend to use [default: rest, env: BACKEND]
-B, --basedn server base dn [default: dc=example,dc=com, env: BASE_DN]
-L, --listen listen addr for LDAP [default: 0.0.0.0:389, env: LDAP_LISTEN_ADDR]
-I, --interval data update interval [default: 300s, env: UPDATE_INTERVAL]
-l, --log log file path
-d, --debug turn on debug logging [default: false]

-h, --help show this screen
--version show version

```

### **Compile**
Just type `make`

### **Run**
`./build/gorestldap -L localhost:10389 -d -b `

### **Examples**
Admin credentials is `admin:admin`.
To start django server type `make server` and copy auth token from django migration output to config.yaml. Then start ldap server:
`./build/gorestldap -L localhost:10389 -d -b rest`
User can be managed through django admin interface at `http://localhost:8000/admin`.

To run with file plugin, set backend to file (`-b file`).

### **Callback**
Callback listener may be used for data reload (HEAD with auth token `curl -v -I localhost:8080/callback -H "Authorization: Token qwertyuiop1234567890"`).