Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tigranbs committed Oct 30, 2023
1 parent caa8f60 commit e9aa62d
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions middlewares/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,6 @@ func getRemoteAuthContext(c *gin.Context, pkgName, token, pkgService, action str
return authResult, nil
}

func getServiceFromPath(c *gin.Context) string {
fullPath := c.FullPath()

hostname := c.Request.Host
hostnameSplit := strings.Split(hostname, ".")
if len(hostnameSplit) == 3 {
return hostnameSplit[0]
}

pathSplit := strings.Split(fullPath, "/")
if len(pathSplit) < 2 {
return ""
}
pathPrefix := pathSplit[1]
if pathPrefix == "v2" {
return "container"
}
return pathPrefix
}

func GetAuthCtx(c *gin.Context) *AuthResult {
return c.MustGet("auth").(*AuthResult)
}
Expand Down

0 comments on commit e9aa62d

Please sign in to comment.