Skip to content

Commit

Permalink
Merge pull request #32 from netresearch/renovate/github.com-netresear…
Browse files Browse the repository at this point in the history
…ch-simple-ldap-go-digest
  • Loading branch information
TheDevMinerTV authored Oct 13, 2023
2 parents a1f6760 + 6118285 commit 1c8de01
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/gofiber/fiber/v2 v2.49.2
github.com/gofiber/template/html/v2 v2.0.5
github.com/joho/godotenv v1.5.1
github.com/netresearch/simple-ldap-go v0.0.0-20231002103847-cb56d7d4e6c7
github.com/netresearch/simple-ldap-go v0.0.0-20231006124956-e3f59e3a24f0
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ github.com/netresearch/simple-ldap-go v0.0.0-20230915232254-3b11228f3129 h1:t0EB
github.com/netresearch/simple-ldap-go v0.0.0-20230915232254-3b11228f3129/go.mod h1:T/Nbe0raXbCgzMWzsOfMX2sZC1FMGk2g3XpPG4OT6NY=
github.com/netresearch/simple-ldap-go v0.0.0-20231002103847-cb56d7d4e6c7 h1:hN2eW111sh8hpPT4GwIXafbSqHtJfAnLGc+hZAQehnk=
github.com/netresearch/simple-ldap-go v0.0.0-20231002103847-cb56d7d4e6c7/go.mod h1:v00qbwupQnx2Mk3oJoJylMWD54yJk6vHsbFj5RIOK5o=
github.com/netresearch/simple-ldap-go v0.0.0-20231006124956-e3f59e3a24f0 h1:yEglKp2covgW6SOFYV4ii7SS+Z7Ud8tSr6dHy5k/8/c=
github.com/netresearch/simple-ldap-go v0.0.0-20231006124956-e3f59e3a24f0/go.mod h1:v00qbwupQnx2Mk3oJoJylMWD54yJk6vHsbFj5RIOK5o=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
Expand Down
21 changes: 11 additions & 10 deletions internal/options/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import (
"strconv"

"github.com/joho/godotenv"
ldap "github.com/netresearch/simple-ldap-go"
)

type Opts struct {
LdapServer string
IsActiveDirectory bool
BaseDN string
ReadonlyUser string
ReadonlyPassword string
LDAP ldap.Config
ReadonlyUser string
ReadonlyPassword string

MinLength uint
MinNumbers uint
Expand Down Expand Up @@ -91,11 +90,13 @@ func Parse() *Opts {
panicWhenEmpty("readonly-password", fReadonlyPassword)

return &Opts{
LdapServer: *fLdapServer,
IsActiveDirectory: *fIsActiveDirectory,
BaseDN: *fBaseDN,
ReadonlyUser: *fReadonlyUser,
ReadonlyPassword: *fReadonlyPassword,
LDAP: ldap.Config{
Server: *fLdapServer,
BaseDN: *fBaseDN,
IsActiveDirectory: *fIsActiveDirectory,
},
ReadonlyUser: *fReadonlyUser,
ReadonlyPassword: *fReadonlyPassword,

MinLength: *fMinLength,
MinNumbers: *fMinNumbers,
Expand Down
2 changes: 1 addition & 1 deletion internal/rpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Handler struct {
}

func New(opts *options.Opts) (*Handler, error) {
ldap, err := ldap.New(opts.LdapServer, opts.BaseDN, opts.ReadonlyUser, opts.ReadonlyPassword, opts.IsActiveDirectory)
ldap, err := ldap.New(opts.LDAP, opts.ReadonlyUser, opts.ReadonlyPassword)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1c8de01

Please sign in to comment.