Commit Graph
63 Commits
Author SHA1 Message Date
timmy 1d55fcd1f6 Modernize testing
Arranges to start the server before running ldap queries removing flakiness
Uses contexts to limit individual command execution time to 100ms
Ensure temporary files use the managed t.TempDir() directory
Set log output to the test output so that go test has a clean output
2026-08-24 18:04:45 -07:00
timmy a03b89f9be Rename package to ldaps 2026-08-24 16:30:01 -07:00
timmy a4b5f16b98 Minimal set of changes to remove client and use upstream ldap package
Switches to github.com/go-ldap/ldap/v3 for ldap management as it generally
 has better practices and security
2026-08-24 16:29:16 -07:00
Chris F Ravenscroft 34c5f9b3cb Harden LDAP control decoding against malformed BER input (#6)
* Harden LDAP control decoding against malformed BER input

Change DecodeControl to return (Control, error) and validate control structure and value types instead of relying on unchecked access.
Handle decode failures on both server and client paths, returning protocol errors for bad request controls and surfacing response decode errors.

* fix: top-level recover() and fix missing TLSConfig check

* chore: verify fix
2026-07-18 13:29:43 -07:00
Marcel Heers 19bd16af77 can find entries based on DN (#2)
* fixes most staticcheck errors

* can find entries based on DN
2026-01-18 16:03:49 -08:00
Chris F Ravenscroft 297568ea5d feat: extensible match filters proxying (#5)
* feat: extensible match filters proxying
2026-01-18 15:55:48 -08:00
Alessandro Cabbia 1f14f5c1b4 Address panic when client starts a StartTLS connection but server is not configured to accept (#4)
* fix: don't start TLS connection if TLSConfig is nil

addresses and closes https://github.com/glauth/glauth/issues/389

* deps: update asn1-ber
2024-04-19 10:15:21 -07:00
Chris F Ravenscroft 53c26f3f5e feat: support paging (#3) 2024-03-23 17:03:53 -07:00
b9bf4d1baf Start tls by @shipperizer (#1)
* switch nmcclain/asn1-ber to go-asn1-ber/and1-ber.
This newer package has ben updated with tests, and looks to actually be supported.
It is also is a forked version of nmcclain/asn1-ber, so supports the same API.

* no need to print errors if client disconnects early and unexpectedly

* added in Close method on server to avoid a race condition

* test ssl certs are untrusted, ldapsearch needs to be told to allow untrusted certs

* Extra time.Wait causes the test to fail

* removed singaling with a custom quit chanel

* feat: support StartTLS in server

* lint: fmt and imports

* feat: rename library to be used by glauth

* chore: renamed packages

---------

Co-authored-by: Daniel Barney <daniel@thoughtplot.io>
Co-authored-by: Mark Rushakoff <mark@influxdata.com>
Co-authored-by: shipperizer <alexcabb@gmail.com>
2023-12-10 14:58:23 -08:00
wxiaoguang 7f8d1e44ee strings in LDAP are case-insensitive (#8)
Thank you @wxiaoguang !

* strings in LDAP are case-insensitive

* optmize routeFunc (faster, case-insensitive)

* small optimiztion to routeFunc

* request the directory server to return operational attributes by adding + (the plus sign) in your ldapsearch command.

* request the directory server to return operational attributes by adding + (the plus sign) in your ldapsearch command.

* request the directory server to return operational attributes by adding + (the plus sign) in your ldapsearch command.

* remove operational attributes
2021-07-20 10:27:43 -06:00
Apehaenger 6ebc2104fc Fixed handling of UTF8 chars in filter value (#9)
Thank you @Apehaenger
2021-07-20 10:27:06 -06:00
Hiroki Uchiumi 3b3b69a7e9 Fix examples (#6)
* Fix modify.go of examples

* Fix proxy.go of examples

* Fix server.go of examples
2019-10-21 14:07:07 -06:00
Viktor Kojouharov 09931d85c0 Add support for retrieving all user attributes (#5) 2019-07-03 12:24:33 -06:00
dirkm ee4388c038 make serve function public (#4)
* make serve function public

* make Dn public

* make attrs public
2019-07-03 12:23:29 -06:00
Jeroen Simonetti 6e14e82719 Implement FilterSubstrings (#2)
* Implement FilterSubstrings
* Remove unneeded if
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>


Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
2016-06-01 08:55:37 -06:00
Elan Yusuf Hakim f9d5abcccb Fix issue where ManageDSAit control sent (#3)
* Fix whitespace control value
* Add strings package
2016-06-01 08:53:38 -06:00
Ned 061cdfc6fa Merge pull request #1 from BradburyLab/master
DialTLSDialer added && gofmt
2016-01-04 12:55:27 -07:00
Ivan Egorov 1f08215cab DialTLSDialer added && gofmt 2015-12-29 10:41:49 +00:00
ned 2a93a58a34 Fixed bug with SizeLimit=1 2015-06-02 16:15:06 -06:00
ned 4237472cb1 Added search SizeLimit support 2015-06-02 12:56:59 -06:00
ned 469fe5a802 Tolerate DerefAliases requests w/o falling over 2014-12-10 18:04:18 -07:00
ned c43d537d5b Implemented other LDAP server operations (add/delete/modify/extended/etc.) and tests. 2014-11-23 12:03:05 -07:00
ned f4e67fa4cd LDAP server support 2014-11-12 14:52:16 -07:00
unai.avila 492fd8f904 Ping / Abandon request should not expect response 2014-09-04 11:32:10 +02:00
unai.avila 9fa237bffa Add ping method 2014-09-02 17:29:20 +02:00
unai.avila 3517f8985f import time 2014-08-20 10:59:07 +02:00
unai.avila 6f4418750e Make Dial accept a timeout 2014-08-20 10:55:54 +02:00
unai.avila d108cf9db3 Added unbind method 2014-08-19 15:00:43 +02:00
Vincent Vanackere 0e043b3393 cleanup : unexport FilterMap & remove FilterSubstringsMap (unneeded) 2014-08-01 22:14:03 +02:00
Vincent Vanackere acf536b08d filter_test : rewrite encode/decode tests to be table-driven
Only 1 test for now but other tests should be written, especially to check the various possible encoding issues...
2014-08-01 22:04:17 +02:00
Vincent Vanackere 03389e6f26 filter : small code cleanup
Also use ber.DecodeString in DecompileFilter like with all other filters
2014-08-01 22:01:21 +02:00
Vincent Vanackere da9e157102 Merge fixes for ldap present filter encoding/decoding from Gregory Haik 2014-08-01 21:02:51 +02:00
Gregory Haik 81cd5e4d4d filter: bugfix for FilterPresent 2014-08-01 18:16:52 +02:00
Vincent Vanackere 192ce467a8 Switch asn1-ber dependency to "github.com/vanackere/asn1-ber" 2014-07-24 13:07:31 +02:00
Vincent Vanackere 2b58f3ef14 examples : fix import path, add +build ignore directive
These examples are independant (and not part of a single package).
2014-07-24 10:33:06 +02:00
Vincent Vanackere 3f715a8421 Remove data race between *Conn.Close() and *Conn.reader()
A single channel is now used to signal that the connection was closed.
There is also no need to set the net.Conn field to nil as this was causing a nil pointer dereference in the reader loop.
2014-07-23 15:11:43 +02:00
juju2013 f4a7f67426 cosmetic changes 2014-04-18 16:08:45 +02:00
juju2013 2555449073 make examples search works 2014-04-18 15:55:25 +02:00
John Weldon 6b7bf8da55 SpruceHealth disappeared :-( 2014-04-15 18:02:01 -07:00
John Weldon 090a5e2ca7 update references 2014-03-21 10:51:35 -07:00
Samuel Stauffer 5023af85ba Fixed spelling of Primitive 2014-03-19 15:13:31 -07:00
Samuel Stauffer 65bf7be995 Don't capitalize function arguments 2014-03-19 14:27:01 -07:00
Samuel Stauffer 2eea0c0a70 Use error instead of *Error 2014-03-19 14:22:55 -07:00
Samuel Stauffer 706c1cdc68 Short writes don't happen without an error so don't loop 2014-03-19 14:18:21 -07:00
Samuel Stauffer 67312503d2 Remove newlines from log messages 2014-03-19 14:13:11 -07:00
Samuel Stauffer aa6eb3f10b Rename DialSSL to DialTLS and remove DialTLS infavor of exporting StartTLS 2014-03-19 14:10:38 -07:00
Samuel Stauffer 4e3f3713c8 Some more cleanup 2014-03-19 14:05:10 -07:00
Samuel Stauffer 222854694e Stylistic fixes, update imports, and some format string fixes 2014-03-19 13:57:59 -07:00
Marc Sauter 3bda2b4e55 connection handling 2014-03-19 13:57:59 -07:00
Marc Sauter e2ff8b4459 rename 2014-03-19 13:57:59 -07:00