Skip to content

Commit

Permalink
Remove old pre-module code (#542)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
johnweldon authored Dec 26, 2024
1 parent dc5f57d commit aebc65e
Show file tree
Hide file tree
Showing 43 changed files with 89 additions and 9,965 deletions.
63 changes: 32 additions & 31 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Up @@ -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 ([email protected])
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
Expand Down
55 changes: 21 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Loading

0 comments on commit aebc65e

Please sign in to comment.