Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datasektionen/ldap-proxy
https://github.com/datasektionen/ldap-proxy
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/datasektionen/ldap-proxy
- Owner: datasektionen
- License: mit
- Created: 2024-06-02T19:50:16.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-11T17:31:27.000Z (7 months ago)
- Last Synced: 2024-07-12T05:03:25.504Z (6 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LDAP Proxy
Proxies lookups to KTH's ldap server allowing us to access it from servers not
physically located at KTH and translates it to a nice(?) REST api returning
JSON. Not exposed to the internet.Also does a few sanity checks and logs warnings when data is not as expected.
## API:
Send a GET request to `/user` including either `kthid` or `ug_kthid` in the query string.
Unless there are any errors, the response will have `Content-Type` set to
`application/json`. Example response body:```json
{"kthid":"turetek","ug_kthid":"u1jwkms6","first_name":"Ture","family_name":"Teknokrat"}
```If there is an error `Content-Type` will not be set. An error message will be
sent in the body as text. If no user is found the status code will be `404`. If
the request is invalid the status code will be `400`. If something else goes
wrong the sttus code will be `500`.## Testing locally:
```sh
ssh -L3389:ldap.kth.se:389 mjukglass -N
``````sh
LISTEN_ADDRESS=:3000 LDAP_URL="ldap://localhost:3389" go run .
```