gsmonni / ldapsvc

0 stars 1 forks source link

ldaspvc

LDAPSvc is a golang REST API server that exposes an endpoint to browse a LDAP directory

image

To build the service

To run the service (without building)

  1. make run (this will start the service listening on all interfaces on port 8080)
  2. use swagger: curl http://localhost:8080/swaggerui/

LDAP Data

curently LDAP connection is mocked. Mock data is located within data/ldapsvc/ldap-data.json Valid client-id are

CLI parameters

ldapsvc parameters can be set either via environment variables, command-line parameters, or via JSON configuration file located in data/conf/conf.json

go run cmd/main.go -h
Usage: main [options] [arguments]

OPTIONS
  --certificate-use-tls/$LDAPSVC_CERTIFICATE_USE_TLS      <bool>    
  --certificate-use-mtls/$LDAPSVC_CERTIFICATE_USE_MTLS    <bool>    
  --certificate-ca-file/$LDAPSVC_CERTIFICATE_CA_FILE      <string>  
  --certificate-cert-file/$LDAPSVC_CERTIFICATE_CERT_FILE  <string>  
  --certificate-key-file/$LDAPSVC_CERTIFICATE_KEY_FILE    <string>  
  --certificate-ca-path/$LDAPSVC_CERTIFICATE_CA_PATH      <string>  
  --local-address/$LDAPSVC_LOCAL_ADDRESS                  <string>  
  --port/$LDAPSVC_PORT                                    <int>     
  --save-last-config/$LDAPSVC_SAVE_LAST_CONFIG            <bool>    
  --ldap-bind-string/$LDAPSVC_LDAP_BIND_STRING            <string>  
  --ldap-bind-password/$LDAPSVC_LDAP_BIND_PASSWORD        <string>  
  --ldap-base-dn/$LDAPSVC_LDAP_BASE_DN                    <string>  
  --ldap-server/$LDAPSVC_LDAP_SERVER                      <string>  
  --ldap-port/$LDAPSVC_LDAP_PORT                          <uint>    
  --ldap-use-ldaps/$LDAPSVC_LDAP_USE_LDAPS                <bool>    
  --ldap-mock/$LDAPSVC_LDAP_MOCK                          <bool>    
  --ldap-mock-data-file/$LDAPSVC_LDAP_MOCK_DATA_FILE      <string>  
  --ldap-mock-items-num/$LDAPSVC_LDAP_MOCK_ITEMS_NUM      <uint>    
  --help/-h                                               
  display this help message