Skip to content

Commit

Permalink
Add end-to-end test for LDAP
Browse files Browse the repository at this point in the history
* use LDAP fake server package
* expose config from YAML function
* update go repository and deps list
  • Loading branch information
JonasScharpf committed Apr 18, 2024
1 parent 6771bab commit e2a1d74
Show file tree
Hide file tree
Showing 8 changed files with 542 additions and 129 deletions.
9 changes: 2 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,9 @@ go_repository(

go_repository(
name = "in_gopkg_asn1_ber_v1",
commit = "f715ec2f112d1e4195b827ad68cf44017a3ef2b1",
importpath = "gopkg.in/asn1-ber.v1",
)

go_repository(
name = "in_gopkg_ldap_v3",
commit = "9f0d712775a0973b7824a1585a86a4ea1d5263d9",
importpath = "gopkg.in/ldap.v3",
sum = "h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=",
version = "v1.0.0-20181015200546-f715ec2f112d",
)

gazelle_dependencies()
Expand Down
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ func newFromYaml(data []byte) (*Config, error) {
return &c, nil
}

func NewConfigFromYaml(data []byte) (*Config, error) {
return newFromYaml(data)
}

func validateConfig(c *Config) error {
if c.Dir == "" {
return errors.New("The 'dir' flag/key is required")
Expand Down
90 changes: 90 additions & 0 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ def go_dependencies():
sum = "h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=",
version = "v0.0.0-20211218093645-b94a6e3cc137",
)
go_repository(
name = "com_github_alexbrainman_sspi",
importpath = "github.com/alexbrainman/sspi",
sum = "h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI=",
version = "v0.0.0-20231016080023-1a75b4708caa",
)

go_repository(
name = "com_github_andybalholm_brotli",
importpath = "github.com/andybalholm/brotli",
Expand Down Expand Up @@ -65,6 +72,13 @@ def go_dependencies():
sum = "h1:QSdcrd/UFJv6Bp/CfoVf2SrENpFn9P6Yh8yb+xNhYMM=",
version = "v0.4.1",
)
go_repository(
name = "com_github_azure_go_ntlmssp",
importpath = "github.com/Azure/go-ntlmssp",
sum = "h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8=",
version = "v0.0.0-20221128193559-754e69321358",
)

go_repository(
name = "com_github_azuread_microsoft_authentication_library_for_go",
importpath = "github.com/AzureAD/microsoft-authentication-library-for-go",
Expand Down Expand Up @@ -230,6 +244,13 @@ def go_dependencies():
sum = "h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=",
version = "v1.9.1",
)
go_repository(
name = "com_github_go_asn1_ber_asn1_ber",
importpath = "github.com/go-asn1-ber/asn1-ber",
sum = "h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA=",
version = "v1.5.5",
)

go_repository(
name = "com_github_go_chi_chi_v4",
importpath = "github.com/go-chi/chi/v4",
Expand All @@ -243,6 +264,12 @@ def go_dependencies():
sum = "h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=",
version = "v0.2.1",
)
go_repository(
name = "com_github_go_ldap_ldap_v3",
importpath = "github.com/go-ldap/ldap/v3",
sum = "h1:loKJyspcRezt2Q3ZRMq2p/0v8iOurlmeXDPw6fikSvQ=",
version = "v3.4.8",
)

go_repository(
name = "com_github_go_logfmt_logfmt",
Expand Down Expand Up @@ -371,25 +398,88 @@ def go_dependencies():
sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=",
version = "v1.8.0",
)
go_repository(
name = "com_github_gorilla_securecookie",
importpath = "github.com/gorilla/securecookie",
sum = "h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=",
version = "v1.1.1",
)
go_repository(
name = "com_github_gorilla_sessions",
importpath = "github.com/gorilla/sessions",
sum = "h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=",
version = "v1.2.1",
)

go_repository(
name = "com_github_grpc_ecosystem_go_grpc_prometheus",
importpath = "github.com/grpc-ecosystem/go-grpc-prometheus",
sum = "h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=",
version = "v1.2.0",
)
go_repository(
name = "com_github_hashicorp_go_uuid",
importpath = "github.com/hashicorp/go-uuid",
sum = "h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=",
version = "v1.0.3",
)

go_repository(
name = "com_github_iris_contrib_schema",
importpath = "github.com/iris-contrib/schema",
sum = "h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw=",
version = "v0.0.6",
)
go_repository(
name = "com_github_jcmturner_aescts_v2",
importpath = "github.com/jcmturner/aescts/v2",
sum = "h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=",
version = "v2.0.0",
)
go_repository(
name = "com_github_jcmturner_dnsutils_v2",
importpath = "github.com/jcmturner/dnsutils/v2",
sum = "h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=",
version = "v2.0.0",
)
go_repository(
name = "com_github_jcmturner_gofork",
importpath = "github.com/jcmturner/gofork",
sum = "h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg=",
version = "v1.7.6",
)
go_repository(
name = "com_github_jcmturner_goidentity_v6",
importpath = "github.com/jcmturner/goidentity/v6",
sum = "h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=",
version = "v6.0.1",
)
go_repository(
name = "com_github_jcmturner_gokrb5_v8",
importpath = "github.com/jcmturner/gokrb5/v8",
sum = "h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8=",
version = "v8.4.4",
)
go_repository(
name = "com_github_jcmturner_rpc_v2",
importpath = "github.com/jcmturner/rpc/v2",
sum = "h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=",
version = "v2.0.3",
)

go_repository(
name = "com_github_joker_jade",
importpath = "github.com/Joker/jade",
sum = "h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk=",
version = "v1.1.3",
)
go_repository(
name = "com_github_jonasscharpf_godap",
importpath = "github.com/JonasScharpf/godap",
sum = "h1:7L5zT1awL4RZeLtT4vp+BlRoTrFBbRtMFOZMQCqub7I=",
version = "v0.0.0-20240417153024-2d460c2776c0",
)

go_repository(
name = "com_github_josharian_intern",
importpath = "github.com/josharian/intern",
Expand Down
63 changes: 30 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,80 @@ module github.com/buchgr/bazel-remote/v2

require (
github.com/abbot/go-http-auth v0.4.1-0.20220112235402-e1cee1c72f2f
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/djherbis/atime v1.1.0
github.com/golang/protobuf v1.5.3
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.5.0
github.com/google/uuid v1.6.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/klauspost/compress v1.17.4
github.com/minio/minio-go/v7 v7.0.66
github.com/klauspost/compress v1.17.8
github.com/minio/minio-go/v7 v7.0.69
github.com/mostynb/go-grpc-compression v1.2.2
github.com/mostynb/zstdpool-syncpool v0.0.13
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_model v0.6.1 // indirect
github.com/slok/go-http-metrics v0.11.0
github.com/urfave/cli/v2 v2.27.0
golang.org/x/oauth2 v0.15.0
golang.org/x/sync v0.5.0
golang.org/x/sys v0.15.0 // indirect
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.32.0
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d
gopkg.in/ldap.v3 v3.0.3
github.com/urfave/cli/v2 v2.27.1
golang.org/x/oauth2 v0.19.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.19.0 // indirect
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1
github.com/JonasScharpf/godap v0.0.0-20240417153024-2d460c2776c0
github.com/go-ldap/ldap/v3 v3.4.8
github.com/johannesboyne/gofakes3 v0.0.0-20230506070712-04da935ef877
github.com/valyala/gozstd v1.20.1
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0
google.golang.org/genproto/googleapis/bytestream v0.0.0-20231212172506-995d672761c0
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda
google.golang.org/genproto/googleapis/bytestream v0.0.0-20240401170217-c3f982113cda
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda
)

require (
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute v1.25.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/longrunning v0.5.4 // indirect
cloud.google.com/go/longrunning v0.5.6 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect
github.com/aws/aws-sdk-go v1.44.256 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/go-ldap/ldap/v3 v3.4.6 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/prometheus/common v0.52.3 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/net v0.19.0 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.8.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)

Expand Down
Loading

0 comments on commit e2a1d74

Please sign in to comment.