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.
28 lines
721 B
Go
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
|
|
},
|
|
}
|