aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2019-02-13 05:42:29 +0200
committerMarin Ivanov <[email protected]>2019-02-13 05:42:29 +0200
commit2433beed9d9365af0a54e376c6b5ce97963d7bc3 (patch)
tree5237d1f68c2fd2ffa8b2eb5c5b34c91eecfdb9cf /README.md
parent518f72942c1cf751010a532c6189cd0eb0a5323b (diff)
parent36ac64bc2b67871d0de16f65a45c7458730e49be (diff)
Merge branch 'enforce-tls'
Diffstat (limited to 'README.md')
-rw-r--r--README.md59
1 files changed, 35 insertions, 24 deletions
diff --git a/README.md b/README.md
index 2418eab..9b38336 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,12 @@ This library provides basic LDAP v3 functionality for the GO programming languag
The **client** portion is limited, but sufficient to perform LDAP authentication and directory lookups (binds and searches) against any modern LDAP server (tested with OpenLDAP and AD).
-The **server** portion implements Bind and Search from [RFC4510](http://tools.ietf.org/html/rfc4510), has good testing coverage, and is compatible with any LDAPv3 client. It provides the building blocks for a custom LDAP server, but you must implement the backend datastore of your choice.
-
+The **server** portion implements Bind and Search from [RFC4510](http://tools.ietf.org/html/rfc4510), has good testing coverage, and is compatible with any LDAPv3 client. It provides the building blocks for a custom LDAP server, but you must implement the backend datastore of your choice.
## LDAP client notes:
### A simple LDAP bind operation:
+
```go
l, err := ldap.Dial("tcp", fmt.Sprintf("%s:%d", ldapServer, ldapPort))
// be sure to add error checking!
@@ -23,6 +23,7 @@ if err==nil {
```
### A simple LDAP search operation:
+
```go
search := &SearchRequest{
BaseDN: "dc=example,dc=com",
@@ -33,25 +34,28 @@ searchResults, err := l.Search(search)
```
### Implemented:
-* Connecting, binding to LDAP server
-* Searching for entries with filtering and paging controls
-* Compiling string filters to LDAP filters
-* Modify Requests / Responses
+
+- Connecting, binding to LDAP server
+- Searching for entries with filtering and paging controls
+- Compiling string filters to LDAP filters
+- Modify Requests / Responses
### Not implemented:
-* Add, Delete, Modify DN, Compare operations
-* Most tests / benchmarks
+
+- Add, Delete, Modify DN, Compare operations
+- Most tests / benchmarks
### LDAP client examples:
-* examples/search.go: **Basic client bind and search**
-* examples/searchSSL.go: **Client bind and search over SSL**
-* examples/searchTLS.go: **Client bind and search over TLS**
-* examples/modify.go: **Client modify operation**
-*Client library by: [mmitton](https://github.com/mmitton), with contributions from: [uavila](https://github.com/uavila), [vanackere](https://github.com/vanackere), [juju2013](https://github.com/juju2013), [johnweldon](https://github.com/johnweldon), [marcsauter](https://github.com/marcsauter), and [nmcclain](https://github.com/nmcclain)*
+- examples/search.go: **Basic client bind and search**
+- examples/searchSSL.go: **Client bind and search over SSL**
+- examples/searchTLS.go: **Client bind and search over TLS**
+- examples/modify.go: **Client modify operation**
## LDAP server notes:
-The server library is modeled after net/http - you designate handlers for the LDAP operations you want to support (Bind/Search/etc.), then start the server with ListenAndServe(). You can specify different handlers for different baseDNs - they must implement the interfaces of the operations you want to support:
+
+The server library is modeled after net/http - you designate handlers for the LDAP operations you want to support (Bind/Search/etc.), then start the server with ListenAndServe(). You can specify different handlers for different baseDNs - they must implement the interfaces of the operations you want to support:
+
```go
type Binder interface {
Bind(bindDN, bindSimplePw string, conn net.Conn) (LDAPResultCode, error)
@@ -65,6 +69,7 @@ type Closer interface {
```
### A basic bind-only LDAP server
+
```go
func main() {
s := ldap.NewServer()
@@ -84,22 +89,28 @@ func (h ldapHandler) Bind(bindDN, bindSimplePw string, conn net.Conn) (ldap.LDAP
}
```
-* Server.EnforceLDAP: Normally, the LDAP server will return whatever results your handler provides. Set the **Server.EnforceLDAP** flag to **true** and the server will apply the LDAP **search filter**, **attributes limits**, **size/time limits**, **search scope**, and **base DN matching** to your handler's dataset. This makes it a lot simpler to write a custom LDAP server without worrying about LDAP internals.
+- Server.EnforceLDAP: Normally, the LDAP server will return whatever results your handler provides. Set the **Server.EnforceLDAP** flag to **true** and the server will apply the LDAP **search filter**, **attributes limits**, **size/time limits**, **search scope**, and **base DN matching** to your handler's dataset. This makes it a lot simpler to write a custom LDAP server without worrying about LDAP internals.
+- Server.TLSConfig: If you set this variable, you will enable TLS connection upgrades.
+- Server.EnforceTLS: This setting enforces and requires a TLS upgrade before any LDAP operation.
### LDAP server examples:
-* examples/server.go: **Basic LDAP authentication (bind and search only)**
-* examples/proxy.go: **Simple LDAP proxy server.**
-* server_test.go: **The _test.go files have examples of all server functions.**
+
+- examples/server.go: **Basic LDAP authentication (bind and search only)**
+- examples/proxy.go: **Simple LDAP proxy server.**
+- server_test.go: **The \_test.go files have examples of all server functions.**
### Known limitations:
-* Golang's TLS implementation does not support SSLv2. Some old OSs require SSLv2, and are not able to connect to an LDAP server created with this library's ListenAndServeTLS() function. If you *must* support legacy (read: *insecure*) SSLv2 clients, run your LDAP server behind HAProxy.
+- Golang's TLS implementation does not support SSLv2. Some old OSs require SSLv2, and are not able to connect to an LDAP server created with this library's ListenAndServeTLS() function. If you _must_ support legacy (read: _insecure_) SSLv2 clients, run your LDAP server behind HAProxy.
### Not implemented:
+
From the server perspective, all of [RFC4510](http://tools.ietf.org/html/rfc4510) is implemented **except**:
-* 4.5.1.3. SearchRequest.derefAliases
-* 4.5.1.5. SearchRequest.timeLimit
-* 4.5.1.6. SearchRequest.typesOnly
-* 4.14. StartTLS Operation
-*Server library by: [nmcclain](https://github.com/nmcclain)*
+- 4.5.1.3. SearchRequest.derefAliases
+- 4.5.1.5. SearchRequest.timeLimit
+- 4.5.1.6. SearchRequest.typesOnly
+
+## Contributors
+
+See: [CONTRIBUTORS.md](CONTRIBUTORS.md)