Files
mediamtx/internal/test/auth_manager.go
T
Alessandro RosandGitHub 52d14ba47c fix error 400 with parallel describe and publish requests (#5095) (#5502)
When a path is dynamic, and the path receives multiple describe and
publish requests in parallel, describe requests might cause the path to
be deleted, and this might cause pending publish requests to fail,
since the path has been deleted.

This patch improves the situation by checking for pending requests
before deleting a path.
2026-02-22 00:00:41 +01:00

28 lines
721 B
Go

// Package test contains test utilities.
package test
import "github.com/bluenviron/mediamtx/internal/auth"
// AuthManager is a dummy auth manager.
type AuthManager struct {
AuthenticateImpl func(req *auth.Request) *auth.Error
RefreshJWTJWKSImpl func()
}
// Authenticate replicates auth.Manager.Authenticate.
func (m *AuthManager) Authenticate(req *auth.Request) *auth.Error {
return m.AuthenticateImpl(req)
}
// RefreshJWTJWKS is a function that simulates a JWKS refresh.
func (m *AuthManager) RefreshJWTJWKS() {
m.RefreshJWTJWKSImpl()
}
// NilAuthManager is an auth manager that accepts everything.
var NilAuthManager = &AuthManager{
AuthenticateImpl: func(_ *auth.Request) *auth.Error {
return nil
},
}