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
Branches
Tags v0.0.5
No related merge requests found
...@@ -29,7 +29,7 @@ build: buildtags ...@@ -29,7 +29,7 @@ build: buildtags
mkdir -p bin mkdir -p bin
godep go build -o bin/${NAME} godep go build -o bin/${NAME}
static: buildtags deps static: golang deps
@echo "--> Compiling the static binary" @echo "--> Compiling the static binary"
mkdir -p bin mkdir -p bin
CGO_ENABLED=0 GOOS=linux godep go build -a -tags netgo -ldflags '-w' -o bin/${NAME} CGO_ENABLED=0 GOOS=linux godep go build -a -tags netgo -ldflags '-w' -o bin/${NAME}
......
package main 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 { ...@@ -80,6 +80,8 @@ func (r *KeycloakProxy) entrypointHandler() gin.HandlerFunc {
break break
} }
} }
cx.Next()
} }
} }
...@@ -156,7 +158,7 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc { ...@@ -156,7 +158,7 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"username": userContext.name, "username": userContext.name,
"expired_on": userContext.expiresAt.String(), "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) r.redirectToAuthorization(cx)
} }
...@@ -198,6 +200,8 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc { ...@@ -198,6 +200,8 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc {
return return
} }
} }
cx.Next()
} }
} }
...@@ -210,7 +214,7 @@ func (r *KeycloakProxy) authenticationHandler() gin.HandlerFunc { ...@@ -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 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 er have any claim requirements validate the claims are the same
// - if everything is ok, we permit the request to pass through // - if everything is ok, we permit the request to pass through
//
func (r *KeycloakProxy) admissionHandler() gin.HandlerFunc { func (r *KeycloakProxy) admissionHandler() gin.HandlerFunc {
return func(cx *gin.Context) { return func(cx *gin.Context) {
// step: if authentication is required on this, grab the resource spec // step: if authentication is required on this, grab the resource spec
...@@ -295,10 +299,14 @@ func (r *KeycloakProxy) admissionHandler() gin.HandlerFunc { ...@@ -295,10 +299,14 @@ func (r *KeycloakProxy) admissionHandler() gin.HandlerFunc {
"expires": identity.expiresAt.Sub(time.Now()).String(), "expires": identity.expiresAt.Sub(time.Now()).String(),
"bearer": identity.bearerToken, "bearer": identity.bearerToken,
}).Debugf("resource access permitted: %s", cx.Request.RequestURI) }).Debugf("resource access permitted: %s", cx.Request.RequestURI)
cx.Next()
} }
} }
//
// proxyHandler is responsible to proxy the requests on to the upstream endpoint // proxyHandler is responsible to proxy the requests on to the upstream endpoint
//
func (r *KeycloakProxy) proxyHandler() gin.HandlerFunc { func (r *KeycloakProxy) proxyHandler() gin.HandlerFunc {
return func(cx *gin.Context) { return func(cx *gin.Context) {
// step: retrieve the user 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