1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00
kyverno/pkg/policy/auth/fake/auth.go
Charles-Edouard Brétéché 0b7a6a1e3e
fix: kyverno apply panic for mutate policies (#9492)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-24 09:37:48 +00:00

32 lines
858 B
Go

package fake
import "context"
// FakeAuth providers implementation for testing, retuning true for all operations
type FakeAuth struct{}
// NewFakeAuth returns a new instance of Fake Auth that returns true for each operation
func NewFakeAuth() *FakeAuth {
a := FakeAuth{}
return &a
}
// CanICreate returns 'true'
func (a *FakeAuth) CanICreate(_ context.Context, kind, namespace, sub string) (bool, error) {
return true, nil
}
// CanIUpdate returns 'true'
func (a *FakeAuth) CanIUpdate(_ context.Context, kind, namespace, sub string) (bool, error) {
return true, nil
}
// CanIDelete returns 'true'
func (a *FakeAuth) CanIDelete(_ context.Context, kind, namespace, sub string) (bool, error) {
return true, nil
}
// CanIGet returns 'true'
func (a *FakeAuth) CanIGet(_ context.Context, kind, namespace, sub string) (bool, error) {
return true, nil
}