28 Commits

Author SHA1 Message Date
16a70beb4c Merge branch 'main' of https://git.tronnet.net/tronnet/ProxmoxAAS-LDAP 2025-02-11 07:07:10 +00:00
Arthur Lu
aab78cc262 update go version,
update dependencies
2025-02-11 07:06:58 +00:00
Arthur Lu
dd75e3cdb6 add missing prerequisite gnutls-bin to dev-init make target 2025-02-11 07:06:58 +00:00
891c6c85b0 update README 2025-02-11 07:06:58 +00:00
849b05a707 generate session secret key randomly each application start,
bump app version 1.0.6
2025-02-11 07:06:58 +00:00
d424e6dde0 update go.mod 2025-02-11 07:06:58 +00:00
9bce28767f rename make testsd target to test 2025-02-11 07:06:58 +00:00
16af2bfc84 cleanup gitignore 2025-02-11 07:06:58 +00:00
8d5e2b4b86 fix make PHONY targets 2025-02-11 07:06:58 +00:00
5fdd48a946 update go.mod 2025-02-11 07:06:58 +00:00
49ae5b912c add unit tests for various utility functions,
add integration test for LDAPClient,
add aiutomatic openldap configuration for testing through make,
add make targets for tests
improve make targets for build/clean,
update README with build and test instructions
2025-02-11 07:06:58 +00:00
9d6b35c9a2 add starttls support,
add starttls option to config
2025-02-11 07:06:58 +00:00
6fea43f1b3 Update README.md 2025-02-11 07:06:58 +00:00
6739d9b014 improve ModGroup to perform NOP 2025-02-11 07:06:58 +00:00
ae181116d1 update go mod 2025-02-11 07:06:58 +00:00
7a9516e276 add better ldap response error handling 2025-02-11 07:06:58 +00:00
eb4d9548c2 add mail attribute to user,
bump API version to 1.0.3
2025-02-11 07:06:58 +00:00
82a326c11e go mod tidy 2025-02-11 07:06:58 +00:00
487c83f163 update go version and dependencies 2025-02-11 07:06:58 +00:00
c2749a573e fix critical userPassword bug,
improve ldap user/group data handling
2025-02-11 07:06:58 +00:00
eec5343c07 add memberOf attribute to users,
bump version to 1.0.1
2025-02-11 07:06:58 +00:00
b3a6ed5c4c fix default session cookie max age,
disable cgo in build
2025-02-11 07:06:58 +00:00
72e6d38c84 add installation instructions to README 2025-02-11 07:06:58 +00:00
877d018b60 add version route 2025-02-11 07:06:58 +00:00
1864200690 rename config.template,json to template.config.json 2025-02-11 07:06:58 +00:00
Arthur Lu
929c381cc8 update go version,
update dependencies
2025-02-11 06:54:15 +00:00
Arthur Lu
105b11cae5 add missing prerequisite gnutls-bin to dev-init make target 2025-01-15 05:58:12 +00:00
222864868d update README 2024-11-15 00:47:29 +00:00
4 changed files with 28 additions and 21 deletions

View File

@@ -30,9 +30,16 @@ ProxmoxAAS LDAP provides a simple API for managing users and groups in a simplif
1. Download `proxmoxaas-ldap` binary and `template.config.json` file from [releases](https://git.tronnet.net/tronnet/ProxmoxAAS-LDAP/releases) 1. Download `proxmoxaas-ldap` binary and `template.config.json` file from [releases](https://git.tronnet.net/tronnet/ProxmoxAAS-LDAP/releases)
2. Rename `template.config.json` to `config.json` and modify: 2. Rename `template.config.json` to `config.json` and modify:
- listenPort: port for PAAS-LDAP to bind and listen on
- ldapURL: url to the ldap server ie. `ldap://ldap.domain.net` - ldapURL: url to the ldap server ie. `ldap://ldap.domain.net`
- baseDN: base DN ie. `dc=domain,dc=net` - startTLS: true if backend LDAP supports StartTLS
- sessionSecretKey: random value used to randomize cookie values, replace with any sufficiently large random string - basedn: base DN ie. `dc=domain,dc=net`
- sessionCookieName: name of the session cookie
- sessionCookie: specific cookie properties
- path: cookie path
- httpOnly: cookie http-only
- secure: cookie secure
- maxAge: cookie max-age
3. Run the binary 3. Run the binary
## Building and Testing from Source ## Building and Testing from Source
@@ -50,4 +57,4 @@ Building requires the go toolchain. Testing requires the go toolchain, make, and
1. Clone the repository 1. Clone the repository
2. Run `go get` to get requirements 2. Run `go get` to get requirements
3. Run `make dev-init` to install test requirements including openldap (slapd), ldap-utils, debconf-utils 3. Run `make dev-init` to install test requirements including openldap (slapd), ldap-utils, debconf-utils
4. Run `make tests` to run all tests 4. Run `make test` to run all tests

View File

@@ -21,6 +21,7 @@ var APIVersion = "1.0.4"
func Run() { func Run() {
gob.Register(LDAPClient{}) gob.Register(LDAPClient{})
gin.SetMode(gin.ReleaseMode)
log.Printf("Starting ProxmoxAAS-LDAP version %s\n", APIVersion) log.Printf("Starting ProxmoxAAS-LDAP version %s\n", APIVersion)
@@ -40,7 +41,6 @@ func Run() {
} }
log.Printf("Generated session secret key of length %d\n", n) log.Printf("Generated session secret key of length %d\n", n)
gin.SetMode(gin.ReleaseMode)
router := gin.Default() router := gin.Default()
store := cookie.NewStore(secretKey) store := cookie.NewStore(secretKey)
store.Options(sessions.Options{ store.Options(sessions.Options{

32
go.mod
View File

@@ -1,27 +1,27 @@
module proxmoxaas-ldap module proxmoxaas-ldap
go 1.23.2 go 1.23.6
require ( require (
github.com/gin-contrib/sessions v1.0.1 github.com/gin-contrib/sessions v1.0.2
github.com/gin-gonic/gin v1.10.0 github.com/gin-gonic/gin v1.10.0
github.com/go-ldap/ldap/v3 v3.4.8 github.com/go-ldap/ldap/v3 v3.4.10
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d
) )
require ( require (
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/bytedance/sonic v1.12.4 // indirect github.com/bytedance/sonic v1.12.8 // indirect
github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/bytedance/sonic/loader v0.2.3 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/base64x v0.1.5 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect github.com/cloudwego/iasm v0.2.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect github.com/gin-contrib/sse v1.0.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.22.1 // indirect github.com/go-playground/validator/v10 v10.24.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect github.com/goccy/go-json v0.10.5 // indirect
github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/context v1.1.2 // indirect github.com/gorilla/context v1.1.2 // indirect
@@ -37,11 +37,11 @@ require (
github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.12.0 // indirect golang.org/x/arch v0.14.0 // indirect
golang.org/x/crypto v0.29.0 // indirect golang.org/x/crypto v0.33.0 // indirect
golang.org/x/net v0.31.0 // indirect golang.org/x/net v0.35.0 // indirect
golang.org/x/sys v0.27.0 // indirect golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.20.0 // indirect golang.org/x/text v0.22.0 // indirect
google.golang.org/protobuf v1.35.1 // indirect google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )

View File

@@ -2,7 +2,7 @@
prerequisites: prerequisites:
@echo "=================== Installing Prerequisites ===================" @echo "=================== Installing Prerequisites ==================="
apt install debconf-utils slapd ldap-utils sudo gettext apt install debconf-utils slapd ldap-utils sudo gettext gnutls-bin
git clone https://git.tronnet.net/tronnet/open-ldap-setup git clone https://git.tronnet.net/tronnet/open-ldap-setup
cd open-ldap-setup/; bash gencert.sh < ../gencert.conf; cd open-ldap-setup/; bash gencert.sh < ../gencert.conf;
rm -rf open-ldap-setup/ rm -rf open-ldap-setup/