mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-30 15:02:00 -08:00
Some checks are pending
code_lint / golangci_lint (push) Waiting to run
code_lint / mod_tidy (push) Waiting to run
code_lint / api_docs (push) Waiting to run
code_test / test_64 (push) Waiting to run
code_test / test_32 (push) Waiting to run
code_test / test_e2e (push) Waiting to run
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
28 lines
692 B
Go
28 lines
692 B
Go
package test
|
|
|
|
import "github.com/bluenviron/mediamtx/internal/auth"
|
|
|
|
// AuthManager is a dummy auth manager.
|
|
type AuthManager struct {
|
|
AuthenticateImpl func(req *auth.Request) error
|
|
RefreshJWTJWKSImpl func()
|
|
}
|
|
|
|
// Authenticate replicates auth.Manager.Replicate
|
|
func (m *AuthManager) Authenticate(req *auth.Request) 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) error {
|
|
return nil
|
|
},
|
|
RefreshJWTJWKSImpl: func() {
|
|
},
|
|
}
|