Fix #6 checking for groups

This commit is contained in:
Tiago Augusto Pimenta 2018-12-17 18:27:38 -02:00
parent e273f12a92
commit c60463dd0b
6 changed files with 33 additions and 31 deletions

View file

@ -2,13 +2,15 @@ FROM golang:alpine
COPY . /go/src/github.com/tiagoapimenta/nginx-ldap-auth
ENV CGO_ENABLED=0
RUN cd /go/src/github.com/tiagoapimenta/nginx-ldap-auth && \
apk add --no-cache git && \
go get -u gopkg.in/yaml.v2 && \
go get -u gopkg.in/ldap.v2 && \
go build -ldflags='-s -w' -v -o /go/bin/nginx-ldap-auth ./main
go build -a -x -ldflags='-s -w -extldflags -static' -v -o /go/bin/nginx-ldap-auth ./main
FROM alpine
FROM scratch
MAINTAINER Tiago A. Pimenta <tiagoapimenta@gmail.com>
@ -20,6 +22,6 @@ VOLUME /etc/nginx-ldap-auth
EXPOSE 5555
USER nobody
USER 65534:65534
CMD [ "nginx-ldap-auth", "--config", "/etc/nginx-ldap-auth/config.yaml" ]
CMD [ "/usr/local/bin/nginx-ldap-auth", "--config", "/etc/nginx-ldap-auth/config.yaml" ]

2
build
View file

@ -3,7 +3,7 @@
set -e
base='docker.io/tpimenta/nginx-ldap-auth'
version='v1.0.3'
version='v1.0.4'
image="$base:$version"
atexit() {

View file

@ -66,10 +66,10 @@ spec:
spec:
serviceAccountName: nginx-ldap-auth
containers:
- image: docker.io/tpimenta/nginx-ldap-auth:v1.0.3
- image: docker.io/tpimenta/nginx-ldap-auth:v1.0.4
name: nginx-ldap-auth
command:
- "nginx-ldap-auth"
- "/usr/local/bin/nginx-ldap-auth"
- "--config"
- "/etc/nginx-ldap-auth/config.yaml"
ports:

View file

@ -26,10 +26,10 @@ spec:
app: nginx-ldap-auth
spec:
containers:
- image: docker.io/tpimenta/nginx-ldap-auth:v1.0.3
- image: docker.io/tpimenta/nginx-ldap-auth:v1.0.4
name: nginx-ldap-auth
command:
- "nginx-ldap-auth"
- "/usr/local/bin/nginx-ldap-auth"
- "--config"
- "/etc/nginx-ldap-auth/config.yaml"
ports:

View file

@ -54,7 +54,7 @@ func (p *Service) validate(username, password string) (bool, error) {
return false, err
}
if ok || p.required == nil || len(p.required) == 0 {
if !ok || p.required == nil || len(p.required) == 0 {
return err == nil, nil
}

View file

@ -41,4 +41,4 @@ docker run \
-v '/tmp/config.yaml:/etc/nginx-ldap-auth/config.yaml:ro' \
--name ldap-test-client \
-d \
docker.io/tpimenta/nginx-ldap-auth:v1.0.3
docker.io/tpimenta/nginx-ldap-auth:v1.0.4