mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
* fix auth checks with apiVersion and subresource Signed-off-by: ShutingZhao <shuting@nirmata.com> * add kuttl tests Signed-off-by: ShutingZhao <shuting@nirmata.com> * remove duplicate code Signed-off-by: ShutingZhao <shuting@nirmata.com> * update permissions Signed-off-by: ShutingZhao <shuting@nirmata.com> --------- Signed-off-by: ShutingZhao <shuting@nirmata.com>
32 lines
858 B
Go
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
|
|
}
|