2020-03-11 18:14:23 -07:00
|
|
|
package fake
|
|
|
|
|
2022-11-29 14:59:40 +01:00
|
|
|
import "context"
|
|
|
|
|
2022-05-17 08:19:03 +02:00
|
|
|
// FakeAuth providers implementation for testing, retuning true for all operations
|
|
|
|
type FakeAuth struct{}
|
2020-03-11 18:14:23 -07:00
|
|
|
|
2022-05-17 08:19:03 +02:00
|
|
|
// NewFakeAuth returns a new instance of Fake Auth that returns true for each operation
|
2020-03-11 18:14:23 -07:00
|
|
|
func NewFakeAuth() *FakeAuth {
|
|
|
|
a := FakeAuth{}
|
|
|
|
return &a
|
|
|
|
}
|
|
|
|
|
|
|
|
// CanICreate returns 'true'
|
2023-06-22 22:14:06 +08:00
|
|
|
func (a *FakeAuth) CanICreate(_ context.Context, kind, namespace, sub string) (bool, error) {
|
2020-03-11 18:14:23 -07:00
|
|
|
return true, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// CanIUpdate returns 'true'
|
2023-06-22 22:14:06 +08:00
|
|
|
func (a *FakeAuth) CanIUpdate(_ context.Context, kind, namespace, sub string) (bool, error) {
|
2020-03-11 18:14:23 -07:00
|
|
|
return true, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// CanIDelete returns 'true'
|
2023-06-22 22:14:06 +08:00
|
|
|
func (a *FakeAuth) CanIDelete(_ context.Context, kind, namespace, sub string) (bool, error) {
|
2020-03-11 18:14:23 -07:00
|
|
|
return true, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// CanIGet returns 'true'
|
2023-06-22 22:14:06 +08:00
|
|
|
func (a *FakeAuth) CanIGet(_ context.Context, kind, namespace, sub string) (bool, error) {
|
2020-03-11 18:14:23 -07:00
|
|
|
return true, nil
|
|
|
|
}
|