Skip to content
Snippets Groups Projects
Commit 81b7defd authored by Rohith's avatar Rohith
Browse files

- using the next and fixing up the comments

- adding the 0.0.5 build
parent 6e112718
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ build: buildtags
mkdir -p bin
godep go build -o bin/${NAME}
static: buildtags deps
static: golang deps
@echo "--> Compiling the static binary"
mkdir -p bin
CGO_ENABLED=0 GOOS=linux godep go build -a -tags netgo -ldflags '-w' -o bin/${NAME}
......
package main
const buildID = "v0.0.5, git+sha: da94978"
const buildID = "v0.0.5, git+sha: 4c3ee98"
......@@ -80,6 +80,8 @@ func (r *KeycloakProxy) entrypointHandler() gin.HandlerFunc {
break
}
}
cx.Next()
}
}
......@@ -156,7 +158,7 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc {
log.WithFields(log.Fields{
"username": userContext.name,
"expired_on": userContext.expiresAt.String(),
}).Errorf("the session has expired, verification switch off")
}).Errorf("the session has expired and verification switch off")
r.redirectToAuthorization(cx)
}
......@@ -198,6 +200,8 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc {
return
}
}
cx.Next()
}
}
......@@ -210,7 +214,7 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc {
// - if we have any roles requirements validate the roles exists in the access token
// - if er have any claim requirements validate the claims are the same
// - if everything is ok, we permit the request to pass through
//
func (r *KeycloakProxy) admissionHandler() gin.HandlerFunc {
return func(cx *gin.Context) {
// step: if authentication is required on this, grab the resource spec
......@@ -295,10 +299,14 @@ func (r *KeycloakProxy) admissionHandler() gin.HandlerFunc {
"expires": identity.expiresAt.Sub(time.Now()).String(),
"bearer": identity.bearerToken,
}).Debugf("resource access permitted: %s", cx.Request.RequestURI)
cx.Next()
}
}
//
// proxyHandler is responsible to proxy the requests on to the upstream endpoint
//
func (r *KeycloakProxy) proxyHandler() gin.HandlerFunc {
return func(cx *gin.Context) {
// step: retrieve the user context
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment