Skip to content
Snippets Groups Projects
Verified Commit 29e0a6a9 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Improve docker images

parent ce3ff1a2
Branches
No related tags found
No related merge requests found
FROM golang:alpine as go_builder
RUN apk add --no-cache curl git gcc musl-dev
RUN curl https://glide.sh/get | sh
RUN apk add --no-cache musl-dev
WORKDIR /go/src/app
COPY *.go go.* ./
RUN go mod download
RUN CGO_ENABLED=false go build -o app .
FROM alpine:3.10
RUN apk add --no-cache ca-certificates
FROM gcr.io/distroless/static
WORKDIR /
COPY --from=go_builder /go/src/app/app /app
COPY templates /templates
......
......@@ -97,6 +97,21 @@ func (r *oauthProxy) loggingMiddleware(next http.Handler) http.Handler {
})
}
// requestHeaderSanitizingMiddleware is responsible for sanitizing the request headers
func (r *oauthProxy) requestHeaderSanitizingMiddleware() func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
for k := range req.Header {
if strings.HasPrefix(strings.ToLower(k), "x-auth") {
req.Header.Del(k)
}
}
next.ServeHTTP(w, req)
})
}
}
// authenticationMiddleware is responsible for verifying the access token
func (r *oauthProxy) authenticationMiddleware(whitelisted bool) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment