Skip to content

Commit

Permalink
Testing context variable setting
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Jan 26, 2024
1 parent 7dfbe5d commit 0e18eb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/handlers/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func MakeCreateHandler(cfg *types.Config, back types.ServerlessBackend) gin.Hand
return func(c *gin.Context) {
var service types.Service

mcUntyped, mcExists := c.Get("mc")
uidOrigin, uidExists := c.Get("uid_origin")
mcUntyped, mcExists := c.Get("mc")

if !mcExists {
c.String(http.StatusInternalServerError, fmt.Sprintln("Missing multitenancy config"))
Expand All @@ -62,7 +62,7 @@ func MakeCreateHandler(cfg *types.Config, back types.ServerlessBackend) gin.Hand
c.String(http.StatusInternalServerError, fmt.Sprintln("Missing EGI user uid"))
}

mc, mcParsed := mcUntyped.(*auth.MultitenancyConfig)
mc, mcParsed := mcUntyped.(auth.MultitenancyConfig)
uid, uidParsed := uidOrigin.(string)

if !mcParsed {
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/auth/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func getOIDCMiddleware(kubeClientset *kubernetes.Clientset, minIOAdminClient *ut
}
}
oidcLogger.Printf("User %s already exists", uid)
c.Set("multitenancyConfig", &mc)
c.Set("uidOrigin", &uid)
c.Set("uidOrigin", uid)
c.Set("multitenancyConfig", mc)
c.Next()
}
}
Expand Down

0 comments on commit 0e18eb7

Please sign in to comment.