Update ldap client implementation to github.com/go-ldap/ldap/v3
Add contexts to all relevant functions eg NewHandler
Provide backwards compatibility for sql handlers
* feat: introduce new prometheus monitor object
* feat: add LDAPMonitorWatcher as a potential replacement for v0 Collector
* feat: pass monitor object as dependency and instrument core operations
* feat: instantiate monitor in main
* ci: exclude mock files
* ci: generate mocks before running tests and go vet
* ci: make vet command keep going in case of errors
reason is due to the following happening in the GetStats method of the ldap.Stats struct
```
internal/monitoring/mock_interfaces.go:92:13: assignment copies lock value to ret0: (github.com/nmcclain/ldap.Stats, bool) contains github.com/nmcclain/ldap.Stats contains sync.Mutex
internal/monitoring/mock_interfaces.go:93:9: return copies lock value: github.com/nmcclain/ldap.Stats contains sync.Mutex
internal/monitoring/ldap_test.go:23:56: call of mockLDAPServer.EXPECT().GetStats().MinTimes(1).Return copies lock value: github.com/nmcclain/ldap.Stats contains sync.Mutex
```
* deps: move to use go.uber.org/mock/gomock
Before:
dn: ou=vpn,ou=users,dc=glauth,dc=com
cn: vpn
After:
dn: ou=vpn,ou=users,dc=glauth,dc=com
ou: vpn <<< THIS HAS CHANGED
NOTE: whereas previously a search filter (cn=vpn) would have found the
group, now you need (ou=vpn)
* Better plugin build for darwin
* add link to documentation, only discovered it while perusing issues list (#276)
* Plugin: Unix PAM Authentication (https://github.com/glauth/glauth/pull/263) (#277)
* Plugin: Unix PAM Authentication (#263)
* Add plugin using pam authentication
Adds an additional plugin which us authenticating against
the PAM unix backend and exposing users and groups local
to the machine glauth is running on.
This can be used to expose local users for authentication
in other services which support ldap only.
* plugins: pam: Rewrite Bind() to use ldapopshelper
Modernizes the implementation of Bind() to make use of the helper
functions provided by LDAPOpsHelper.
In order to support custom authentication the existing config.User
has received an additional PassAppCustom property which allows to
specify a custom authentication callback for a user.
In case of the PAM backend this will be used to authenticate against
the local PAM database.
* plugins: pam: Rewrite Search() to use ldapopshelper
Modernizes the implementation of Search() to make use of the helper
functions provided by LDAPOpsHelper.
* plugins: pam: Capability through group membership
Adds a configuration option which decides if a user gets the search
capability or not based on the group memberships of a user.
* plugins: pam: Apply formatting
Runs gofmt and go get on all changes done earlier
* plugins: pam: Address feedback from CodeClimate
- reduce code similarity
- document new exports
- address casing of variables and functions
- reduce complexity of FindPosixGroups()
- reduce complexity of FindPosixAccounts()
- fix else branch in ldapopshelper
Co-authored-by: Marius Zwicker <marius.zwicker@mlba-team.de>
* Updated README for pam plugin
* Updated README for pam plugin
Co-authored-by: Marius Zwicker <marius@mlba-team.de>
Co-authored-by: Marius Zwicker <marius.zwicker@mlba-team.de>
* Removing db plugins
* Changing plugind package
* Remove main frmo plugin
* Move plugins to their own repos (#283)
* Plugins release build delegated to plugin Makefile
* Build and push docker containers
* README points to documentation
* Shortened README
* Prometheus exported (#284)
* Prometheus exporter
* Feature/zerolog (#285)
* Zerolog
* Adjusted logging levels
* Structured logging including ldap library
* Feature/check config (#286)
Add config check `--check-config`
Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: Zhou Wenzong <wenzong@users.noreply.github.com>
Co-authored-by: Jairo Llopis <Yajo@users.noreply.github.com>
Co-authored-by: Benedikt Kulmann <benedikt@kulmann.biz>
Co-authored-by: Nicolai Willems <172633+nwillems@users.noreply.github.com>
Co-authored-by: Thibault Soubiran <soubi.thibault@gmail.com>
Co-authored-by: Clement JACOB <clems71@gmail.com>
Co-authored-by: Lutz Horn <code@lhorn.de>
Co-authored-by: Márk Sági-Kazár <sagikazarmark@users.noreply.github.com>
Co-authored-by: Peter Heise <pheise@koprolalie.com>
Co-authored-by: Ben Yanke <ben@benyanke.com>
Co-authored-by: fanlix <fanlix@gmail.com>
Co-authored-by: Hank Donnay <hdonnay@gmail.com>
Co-authored-by: dlitster <davidlitster@gmail.com>
Co-authored-by: Marius Zwicker <marius@mlba-team.de>
Co-authored-by: Marius Zwicker <marius.zwicker@mlba-team.de>