Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHINENG-11685: remove gzip middleware #1470

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/aws/aws-sdk-go v1.53.10
github.com/ezamriy/gorpm v0.0.0-20160905202458-25f7273cbf51
github.com/getkin/kin-openapi v0.124.0
github.com/gin-contrib/gzip v1.0.1
github.com/gin-contrib/timeout v1.0.1
github.com/gin-gonic/gin v1.10.0
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1
Expand Down Expand Up @@ -49,6 +48,7 @@ require (
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/gin-contrib/gzip v1.0.1 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
Expand Down
1 change: 0 additions & 1 deletion manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func RunManager() {
app.Use(middlewares.MaxConnections(utils.CoreCfg.MaxGinConnections))
app.Use(middlewares.Ratelimit(utils.CoreCfg.Ratelimit))
app.Use(middlewares.RequestResponseLogger())
app.Use(middlewares.Gzip())
endpointsConfig := getEndpointsConfig()
middlewares.SetSwagger(app, endpointsConfig)
app.Use(middlewares.WithTimeout(utils.CoreCfg.ResponseTimeout))
Expand Down
15 changes: 0 additions & 15 deletions manager/middlewares/gzip.go

This file was deleted.

13 changes: 0 additions & 13 deletions manager/middlewares/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"app/manager/config"
"fmt"
"net/http"
"net/http/httputil"
"strconv"
"strings"

Expand Down Expand Up @@ -193,22 +192,10 @@ func RBAC() gin.HandlerFunc {
}

return func(c *gin.Context) {
tempLogDebugGinContextRequestHeader(c, "RBAC before")
defer tempLogDebugGinContextRequestHeader(c, "RBAC after")
if isAccessGranted(c) {
return
}
c.AbortWithStatusJSON(http.StatusUnauthorized,
utils.ErrorResponse{Error: "You don't have access to this application"})
}
}

func tempLogDebugGinContextRequestHeader(c *gin.Context, origin string) {
if c != nil {
dump, err := httputil.DumpRequest(c.Request, false)
if err != nil {
utils.LogDebug("origin", origin, "err", err.Error(), "gin_context_req", nil, "gin context request handler")
}
utils.LogDebug("origin", origin, "gin_context_req", string(dump), "gin context request handler")
}
}
2 changes: 0 additions & 2 deletions platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"sync"
"time"

"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/redhatinsights/identity"
Expand Down Expand Up @@ -183,7 +182,6 @@ func platformMock() {
utils.LogInfo("Platform mock starting")
app := gin.New()
app.Use(middlewares.RequestResponseLogger())
app.Use(gzip.Gzip(gzip.DefaultCompression))
initVMaaS(app)
initRbac(app)

Expand Down
Loading