Skip to content

Interface change - #10

Open
lordwelch wants to merge 18 commits into
glauth:masterfrom
lordwelch:interface-change
Open

Interface change#10
lordwelch wants to merge 18 commits into
glauth:masterfrom
lordwelch:interface-change

Conversation

@lordwelch

Copy link
Copy Markdown

This provides 3 primary interface changes.

  1. Replaces the quit channel in the Server struct with a cancelable context
  2. Changes the return value of the ldap interfaces to return an error, to use a specific return code the ldap.Error struct from github.com/go-ldap/ldap/v3 is used
  3. Adds a connection level context on all of the interfaces
    A PR to https://github.com/glauth/glauth to support this change will be available shortly

Note this is dependent on #8 and will not apply cleanly without it. This is also based on #7 and will need further modification if commits from #7 are not wanted

Switches to github.com/go-ldap/ldap/v3 for ldap management as it generally
 has better practices and security
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
Cleanup interfaces and allow the errorMessage ldap field to be used

Use the correct ldap server-side error code
LDAPResultNotSupported(92) is for a client side error
LDAPResultUnavailable(52) is for when a subsystem is not available
LDAPResultOther(80) is for generic server errors

Provide better errors

Fix binding dn to connection

Fix tests

Make handleSearchRequest conform to rfc4511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant