Skip to content

Commit

Permalink
Hello team,
Browse files Browse the repository at this point in the history
I've made some modifications related to JWT authentication that I would like to bring to your attention. It appears that token validation was not being performed in the methods listed below. Additionally, I attempted to integrate it with HLS, but encountered some issues. It might be beneficial to review these changes to ensure everything is functioning as expected.

Modified Files:

internal/api/api.go
internal/metrics/metrics.go
internal/playback/server.go
internal/pprof/pprof.go
Your feedback and review on these changes would be greatly appreciated. Please let me know if there are any concerns or if further adjustments are needed.

Thank you for your attention to this matter.
  • Loading branch information
Rafael Scheidt authored and Rafael Scheidt committed Apr 16, 2024
1 parent 3a96811 commit 610f241
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ func (a *API) mwAuth(ctx *gin.Context) {
err := a.AuthManager.Authenticate(&auth.Request{
User: user,
Pass: pass,
Query: ctx.Request.URL.RawQuery,
IP: net.ParseIP(ctx.ClientIP()),
Action: conf.AuthActionAPI,
})
Expand Down
1 change: 1 addition & 0 deletions internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (m *Metrics) mwAuth(ctx *gin.Context) {
err := m.AuthManager.Authenticate(&auth.Request{
User: user,
Pass: pass,
Query: ctx.Request.URL.RawQuery,
IP: net.ParseIP(ctx.ClientIP()),
Action: conf.AuthActionMetrics,
})
Expand Down
1 change: 1 addition & 0 deletions internal/playback/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (p *Server) doAuth(ctx *gin.Context, pathName string) bool {
err := p.AuthManager.Authenticate(&auth.Request{
User: user,
Pass: pass,
Query: ctx.Request.URL.RawQuery,
IP: net.ParseIP(ctx.ClientIP()),
Action: conf.AuthActionPlayback,
Path: pathName,
Expand Down
1 change: 1 addition & 0 deletions internal/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (pp *PPROF) ServeHTTP(w http.ResponseWriter, r *http.Request) {
err := pp.AuthManager.Authenticate(&auth.Request{
User: user,
Pass: pass,
Query: r.URL.RawQuery,
IP: net.ParseIP(ip),
Action: conf.AuthActionMetrics,
})
Expand Down

0 comments on commit 610f241

Please sign in to comment.