Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: go-ldap/ldap
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.4.9
Choose a base ref
...
head repository: go-ldap/ldap
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.4.10
Choose a head ref
  • 3 commits
  • 45 files changed
  • 2 contributors

Commits on Dec 16, 2024

  1. chore: go mod tidy (#540)

    ilyam8 authored Dec 16, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f71ace8 View commit details

Commits on Dec 26, 2024

  1. Copy the full SHA
    dc5f57d View commit details
  2. Remove old pre-module code (#542)

    * Remove old pre-module code
    
    older versions still accessible via tags
    
    * Update workflows to only use v3 directory
    
    Also, disable fuzzing until configured correctly in upstream repo
    johnweldon authored Dec 26, 2024
    Copy the full SHA
    aebc65e View commit details
Showing with 92 additions and 9,988 deletions.
  1. +32 −31 .github/workflows/cifuzz.yml
  2. +3 −2 .github/workflows/lint.yml
  3. +32 −42 .github/workflows/pr.yml
  4. +1 −1 LICENSE
  5. +21 −34 README.md
  6. +0 −89 add.go
  7. +0 −735 bind.go
  8. +0 −42 client.go
  9. +0 −62 compare.go
  10. +0 −636 conn.go
  11. +0 −404 conn_test.go
  12. +0 −1,294 control.go
  13. +0 −274 control_test.go
  14. +0 −28 debug.go
  15. +0 −59 del.go
  16. +0 −468 dn.go
  17. +0 −418 dn_test.go
  18. +0 −4 doc.go
  19. +0 −262 error.go
  20. +0 −260 error_test.go
  21. +0 −73 examples_moddn_test.go
  22. +0 −581 examples_test.go
  23. +0 −35 examples_windows_test.go
  24. +0 −100 extended.go
  25. +0 −41 extended_test.go
  26. +0 −486 filter.go
  27. +0 −291 filter_test.go
  28. +0 −95 fuzz_test.go
  29. +0 −14 go.mod
  30. +0 −125 go.sum
  31. +0 −214 gssapi/client.go
  32. +0 −191 gssapi/sspi.go
  33. +0 −389 ldap.go
  34. +0 −412 ldap_test.go
  35. +0 −102 moddn.go
  36. +0 −181 modify.go
  37. +0 −119 passwdmodify.go
  38. +0 −110 request.go
  39. +0 −206 response.go
  40. +0 −715 search.go
  41. +0 −221 search_test.go
  42. +0 −38 unbind.go
  43. +1 −2 v3/go.mod
  44. +2 −11 v3/go.sum
  45. +0 −91 whoami.go
63 changes: 32 additions & 31 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
@@ -2,34 +2,35 @@ name: CIFuzz
on: [pull_request]
permissions: {}
jobs:
Fuzzing:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'go-ldap'
language: go
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'go-ldap'
language: go
fuzz-seconds: 300
output-sarif: true
- name: Upload Crash
uses: actions/upload-artifact@v3
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
- name: Upload Sarif
if: always() && steps.build.outcome == 'success'
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: cifuzz-sarif/results.sarif
checkout_path: cifuzz-sarif
Fuzzing:
if: false # Until go-fuzz project is updated to use v3 directory
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: "go-ldap"
language: go
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: "go-ldap"
language: go
fuzz-seconds: 300
output-sarif: true
- name: Upload Crash
uses: actions/upload-artifact@v3
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
- name: Upload Sarif
if: always() && steps.build.outcome == 'success'
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: cifuzz-sarif/results.sarif
checkout_path: cifuzz-sarif
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: golangci-lint
on:
pull_request:
branches: [ master ]
branches: [master]

permissions:
contents: read
@@ -13,11 +13,12 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: "1.23"
cache: false
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
working-directory: v3
74 changes: 32 additions & 42 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -2,54 +2,44 @@ name: PR

on:
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [
'1.23',
'1.22',
'1.21',
'1.20',
'1.19',
'1.18',
'1.17',
'1.16',
'1.15',
'1.14',
]
branch: [ '.', './v3' ]
name: Go ${{ matrix.go }}.x PR Validate ${{ matrix.branch }} (Modules)
go:
[
"1.23",
"1.22",
"1.21",
"1.20",
"1.19",
"1.18",
"1.17",
"1.16",
"1.15",
"1.14",
]
directory: ["./v3"]
name: Go ${{ matrix.go }}.x PR Validate ${{ matrix.directory }} (Modules)
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Version
run: go version
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Build and Validate
run: |
cd ${{ matrix.branch }}
go vet .
go test .
go test -cover -race -cpu 1,2,4 .
go build .
- name: Version
run: go version

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
- name: Build, Validate, and Test
run: |
cd ${{ matrix.directory }}
go vet .
go test .
go test -cover -race -cpu 1,2,4 .
go build .
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright (c) 2011-2015 Michael Mitton (mmitton@gmail.com)
Portions copyright (c) 2015-2016 go-ldap Authors
Portions copyright (c) 2015-2024 go-ldap Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
55 changes: 21 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,63 +3,50 @@
# Basic LDAP v3 functionality for the GO programming language.

The library implements the following specifications:
- https://datatracker.ietf.org/doc/html/rfc4511 for basic operations
- https://datatracker.ietf.org/doc/html/rfc3062 for password modify operation
- https://datatracker.ietf.org/doc/html/rfc4514 for distinguished names parsing
- https://datatracker.ietf.org/doc/html/rfc4533 for Content Synchronization Operation
- https://datatracker.ietf.org/doc/html/draft-armijo-ldap-treedelete-02 for Tree Delete Control
- https://datatracker.ietf.org/doc/html/rfc2891 for Server Side Sorting of Search Results
- https://datatracker.ietf.org/doc/html/rfc4532 for WhoAmI requests

- https://datatracker.ietf.org/doc/html/rfc4511 for basic operations
- https://datatracker.ietf.org/doc/html/rfc3062 for password modify operation
- https://datatracker.ietf.org/doc/html/rfc4514 for distinguished names parsing
- https://datatracker.ietf.org/doc/html/rfc4533 for Content Synchronization Operation
- https://datatracker.ietf.org/doc/html/draft-armijo-ldap-treedelete-02 for Tree Delete Control
- https://datatracker.ietf.org/doc/html/rfc2891 for Server Side Sorting of Search Results
- https://datatracker.ietf.org/doc/html/rfc4532 for WhoAmI requests

## Features:

- Connecting to LDAP server (non-TLS, TLS, STARTTLS, through a custom dialer)
- Binding to LDAP server (Simple Bind, GSSAPI, SASL)
- "Who Am I" Requests / Responses
- Searching for entries (normal and asynchronous)
- Filter Compile / Decompile
- Paging Search Results
- Modify Requests / Responses
- Add Requests / Responses
- Delete Requests / Responses
- Modify DN Requests / Responses
- Connecting to LDAP server (non-TLS, TLS, STARTTLS, through a custom dialer)
- Binding to LDAP server (Simple Bind, GSSAPI, SASL)
- "Who Am I" Requests / Responses
- Searching for entries (normal and asynchronous)
- Filter Compile / Decompile
- Paging Search Results
- Modify Requests / Responses
- Add Requests / Responses
- Delete Requests / Responses
- Modify DN Requests / Responses

## Go Modules:

`go get github.com/go-ldap/ldap/v3`

As go-ldap was v2+ when Go Modules came out, updating to Go Modules would be considered a breaking change.

To maintain backwards compatability, we ultimately decided to use subfolders (as v3 was already a branch).
Whilst this duplicates the code, we can move toward implementing a backwards-compatible versioning system that allows for code reuse.
The alternative would be to increment the version number, however we believe that this would confuse users as v3 is in line with LDAPv3 (RFC-4511)
https://tools.ietf.org/html/rfc4511


For more info, please visit the pull request that updated to modules.
https://github.com/go-ldap/ldap/pull/247

To install with `GOMODULE111=off`, use `go get github.com/go-ldap/ldap`
https://golang.org/cmd/go/#hdr-Legacy_GOPATH_go_get

As always, we are looking for contributors with great ideas on how to best move forward.


## Contributing:

Bug reports and pull requests are welcome!

Before submitting a pull request, please make sure tests and verification scripts pass:

```
make all
```

To set up a pre-push hook to run the tests and verify scripts before pushing:

```
ln -s ../../.githooks/pre-push .git/hooks/pre-push
```

---

The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/)
The design is licensed under the Creative Commons 3.0 Attributions license.
Read this article for more details: http://blog.golang.org/gopher
89 changes: 0 additions & 89 deletions add.go

This file was deleted.

735 changes: 0 additions & 735 deletions bind.go

This file was deleted.

42 changes: 0 additions & 42 deletions client.go

This file was deleted.

62 changes: 0 additions & 62 deletions compare.go

This file was deleted.

636 changes: 0 additions & 636 deletions conn.go

This file was deleted.

404 changes: 0 additions & 404 deletions conn_test.go

This file was deleted.

1,294 changes: 0 additions & 1,294 deletions control.go

This file was deleted.

274 changes: 0 additions & 274 deletions control_test.go

This file was deleted.

28 changes: 0 additions & 28 deletions debug.go

This file was deleted.

59 changes: 0 additions & 59 deletions del.go

This file was deleted.

468 changes: 0 additions & 468 deletions dn.go

This file was deleted.

418 changes: 0 additions & 418 deletions dn_test.go

This file was deleted.

4 changes: 0 additions & 4 deletions doc.go

This file was deleted.

262 changes: 0 additions & 262 deletions error.go

This file was deleted.

260 changes: 0 additions & 260 deletions error_test.go

This file was deleted.

73 changes: 0 additions & 73 deletions examples_moddn_test.go

This file was deleted.

581 changes: 0 additions & 581 deletions examples_test.go

This file was deleted.

35 changes: 0 additions & 35 deletions examples_windows_test.go

This file was deleted.

100 changes: 0 additions & 100 deletions extended.go

This file was deleted.

41 changes: 0 additions & 41 deletions extended_test.go

This file was deleted.

486 changes: 0 additions & 486 deletions filter.go

This file was deleted.

291 changes: 0 additions & 291 deletions filter_test.go

This file was deleted.

95 changes: 0 additions & 95 deletions fuzz_test.go

This file was deleted.

14 changes: 0 additions & 14 deletions go.mod

This file was deleted.

125 changes: 0 additions & 125 deletions go.sum

This file was deleted.

214 changes: 0 additions & 214 deletions gssapi/client.go

This file was deleted.

191 changes: 0 additions & 191 deletions gssapi/sspi.go

This file was deleted.

389 changes: 0 additions & 389 deletions ldap.go

This file was deleted.

412 changes: 0 additions & 412 deletions ldap_test.go

This file was deleted.

102 changes: 0 additions & 102 deletions moddn.go

This file was deleted.

181 changes: 0 additions & 181 deletions modify.go

This file was deleted.

119 changes: 0 additions & 119 deletions passwdmodify.go

This file was deleted.

110 changes: 0 additions & 110 deletions request.go

This file was deleted.

206 changes: 0 additions & 206 deletions response.go

This file was deleted.

715 changes: 0 additions & 715 deletions search.go

This file was deleted.

221 changes: 0 additions & 221 deletions search_test.go

This file was deleted.

38 changes: 0 additions & 38 deletions unbind.go

This file was deleted.

3 changes: 1 addition & 2 deletions v3/go.mod
Original file line number Diff line number Diff line change
@@ -9,6 +9,5 @@ require (
github.com/google/uuid v1.6.0
github.com/jcmturner/gokrb5/v8 v8.4.4
github.com/stretchr/testify v1.8.1
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/net v0.33.0 // indirect
)
13 changes: 2 additions & 11 deletions v3/go.sum
Original file line number Diff line number Diff line change
@@ -5,8 +5,6 @@ github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1L
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-asn1-ber/asn1-ber v1.5.6 h1:CYsqysemXfEaQbyrLJmdsCRuufHoLa3P/gGWGl5TDrM=
github.com/go-asn1-ber/asn1-ber v1.5.6/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-asn1-ber/asn1-ber v1.5.7 h1:DTX+lbVTWaTw1hQ+PbZPlnDZPEIs0SS/GCZAl535dDk=
github.com/go-asn1-ber/asn1-ber v1.5.7/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -47,10 +45,7 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -67,11 +62,9 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -88,7 +81,6 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
@@ -98,7 +90,6 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
91 changes: 0 additions & 91 deletions whoami.go

This file was deleted.