diff --git a/apis/management.cattle.io/v3/authn_types.go b/apis/management.cattle.io/v3/authn_types.go index 94fb8351..d305f5ac 100644 --- a/apis/management.cattle.io/v3/authn_types.go +++ b/apis/management.cattle.io/v3/authn_types.go @@ -2,6 +2,7 @@ package v3 import ( "github.com/rancher/norman/condition" + "github.com/rancher/norman/types" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -143,6 +144,15 @@ type AuthConfig struct { AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" norman:"type=array[reference[principal]]"` } +type SamlToken struct { + types.Namespaced + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Token string `json:"token" norman:"writeOnly,noupdate"` + ExpiresAt string `json:"expiresAt"` +} + type LocalConfig struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/apis/management.cattle.io/v3/fakes/zz_generated_saml_token_mock.go b/apis/management.cattle.io/v3/fakes/zz_generated_saml_token_mock.go new file mode 100644 index 00000000..2dc99adb --- /dev/null +++ b/apis/management.cattle.io/v3/fakes/zz_generated_saml_token_mock.go @@ -0,0 +1,1845 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fakes + +import ( + context "context" + sync "sync" + time "time" + + controller "github.com/rancher/norman/controller" + objectclient "github.com/rancher/norman/objectclient" + v3 "github.com/rancher/types/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockSamlTokenListerMockGet sync.RWMutex + lockSamlTokenListerMockList sync.RWMutex +) + +// Ensure, that SamlTokenListerMock does implement SamlTokenLister. +// If this is not the case, regenerate this file with moq. +var _ v3.SamlTokenLister = &SamlTokenListerMock{} + +// SamlTokenListerMock is a mock implementation of SamlTokenLister. +// +// func TestSomethingThatUsesSamlTokenLister(t *testing.T) { +// +// // make and configure a mocked SamlTokenLister +// mockedSamlTokenLister := &SamlTokenListerMock{ +// GetFunc: func(namespace string, name string) (*v3.SamlToken, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v3.SamlToken, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedSamlTokenLister in code that requires SamlTokenLister +// // and then make assertions. +// +// } +type SamlTokenListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v3.SamlToken, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v3.SamlToken, error) + + // calls tracks calls to the methods. + calls struct { + // Get holds details about calls to the Get method. + Get []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // List holds details about calls to the List method. + List []struct { + // Namespace is the namespace argument value. + Namespace string + // Selector is the selector argument value. + Selector labels.Selector + } + } +} + +// Get calls GetFunc. +func (mock *SamlTokenListerMock) Get(namespace string, name string) (*v3.SamlToken, error) { + if mock.GetFunc == nil { + panic("SamlTokenListerMock.GetFunc: method is nil but SamlTokenLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockSamlTokenListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockSamlTokenListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedSamlTokenLister.GetCalls()) +func (mock *SamlTokenListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockSamlTokenListerMockGet.RLock() + calls = mock.calls.Get + lockSamlTokenListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *SamlTokenListerMock) List(namespace string, selector labels.Selector) ([]*v3.SamlToken, error) { + if mock.ListFunc == nil { + panic("SamlTokenListerMock.ListFunc: method is nil but SamlTokenLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockSamlTokenListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockSamlTokenListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedSamlTokenLister.ListCalls()) +func (mock *SamlTokenListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockSamlTokenListerMockList.RLock() + calls = mock.calls.List + lockSamlTokenListerMockList.RUnlock() + return calls +} + +var ( + lockSamlTokenControllerMockAddClusterScopedFeatureHandler sync.RWMutex + lockSamlTokenControllerMockAddClusterScopedHandler sync.RWMutex + lockSamlTokenControllerMockAddFeatureHandler sync.RWMutex + lockSamlTokenControllerMockAddHandler sync.RWMutex + lockSamlTokenControllerMockEnqueue sync.RWMutex + lockSamlTokenControllerMockEnqueueAfter sync.RWMutex + lockSamlTokenControllerMockGeneric sync.RWMutex + lockSamlTokenControllerMockInformer sync.RWMutex + lockSamlTokenControllerMockLister sync.RWMutex + lockSamlTokenControllerMockStart sync.RWMutex + lockSamlTokenControllerMockSync sync.RWMutex +) + +// Ensure, that SamlTokenControllerMock does implement SamlTokenController. +// If this is not the case, regenerate this file with moq. +var _ v3.SamlTokenController = &SamlTokenControllerMock{} + +// SamlTokenControllerMock is a mock implementation of SamlTokenController. +// +// func TestSomethingThatUsesSamlTokenController(t *testing.T) { +// +// // make and configure a mocked SamlTokenController +// mockedSamlTokenController := &SamlTokenControllerMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.SamlTokenHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v3.SamlTokenHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3.SamlTokenHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v3.SamlTokenHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// EnqueueFunc: func(namespace string, name string) { +// panic("mock out the Enqueue method") +// }, +// EnqueueAfterFunc: func(namespace string, name string, after time.Duration) { +// panic("mock out the EnqueueAfter method") +// }, +// GenericFunc: func() controller.GenericController { +// panic("mock out the Generic method") +// }, +// InformerFunc: func() cache.SharedIndexInformer { +// panic("mock out the Informer method") +// }, +// ListerFunc: func() v3.SamlTokenLister { +// panic("mock out the Lister method") +// }, +// StartFunc: func(ctx context.Context, threadiness int) error { +// panic("mock out the Start method") +// }, +// SyncFunc: func(ctx context.Context) error { +// panic("mock out the Sync method") +// }, +// } +// +// // use mockedSamlTokenController in code that requires SamlTokenController +// // and then make assertions. +// +// } +type SamlTokenControllerMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.SamlTokenHandlerFunc) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v3.SamlTokenHandlerFunc) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3.SamlTokenHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v3.SamlTokenHandlerFunc) + + // EnqueueFunc mocks the Enqueue method. + EnqueueFunc func(namespace string, name string) + + // EnqueueAfterFunc mocks the EnqueueAfter method. + EnqueueAfterFunc func(namespace string, name string, after time.Duration) + + // GenericFunc mocks the Generic method. + GenericFunc func() controller.GenericController + + // InformerFunc mocks the Informer method. + InformerFunc func() cache.SharedIndexInformer + + // ListerFunc mocks the Lister method. + ListerFunc func() v3.SamlTokenLister + + // StartFunc mocks the Start method. + StartFunc func(ctx context.Context, threadiness int) error + + // SyncFunc mocks the Sync method. + SyncFunc func(ctx context.Context) error + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v3.SamlTokenHandlerFunc + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v3.SamlTokenHandlerFunc + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3.SamlTokenHandlerFunc + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler v3.SamlTokenHandlerFunc + } + // Enqueue holds details about calls to the Enqueue method. + Enqueue []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // EnqueueAfter holds details about calls to the EnqueueAfter method. + EnqueueAfter []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // After is the after argument value. + After time.Duration + } + // Generic holds details about calls to the Generic method. + Generic []struct { + } + // Informer holds details about calls to the Informer method. + Informer []struct { + } + // Lister holds details about calls to the Lister method. + Lister []struct { + } + // Start holds details about calls to the Start method. + Start []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Threadiness is the threadiness argument value. + Threadiness int + } + // Sync holds details about calls to the Sync method. + Sync []struct { + // Ctx is the ctx argument value. + Ctx context.Context + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *SamlTokenControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3.SamlTokenHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("SamlTokenControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but SamlTokenController.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockSamlTokenControllerMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockSamlTokenControllerMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedSamlTokenController.AddClusterScopedFeatureHandlerCalls()) +func (mock *SamlTokenControllerMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3.SamlTokenHandlerFunc + } + lockSamlTokenControllerMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockSamlTokenControllerMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *SamlTokenControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v3.SamlTokenHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("SamlTokenControllerMock.AddClusterScopedHandlerFunc: method is nil but SamlTokenController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockSamlTokenControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockSamlTokenControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedSamlTokenController.AddClusterScopedHandlerCalls()) +func (mock *SamlTokenControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3.SamlTokenHandlerFunc + } + lockSamlTokenControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockSamlTokenControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *SamlTokenControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3.SamlTokenHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("SamlTokenControllerMock.AddFeatureHandlerFunc: method is nil but SamlTokenController.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockSamlTokenControllerMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockSamlTokenControllerMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedSamlTokenController.AddFeatureHandlerCalls()) +func (mock *SamlTokenControllerMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.SamlTokenHandlerFunc + } + lockSamlTokenControllerMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockSamlTokenControllerMockAddFeatureHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *SamlTokenControllerMock) AddHandler(ctx context.Context, name string, handler v3.SamlTokenHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("SamlTokenControllerMock.AddHandlerFunc: method is nil but SamlTokenController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockSamlTokenControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockSamlTokenControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedSamlTokenController.AddHandlerCalls()) +func (mock *SamlTokenControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v3.SamlTokenHandlerFunc + } + lockSamlTokenControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockSamlTokenControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *SamlTokenControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("SamlTokenControllerMock.EnqueueFunc: method is nil but SamlTokenController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockSamlTokenControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockSamlTokenControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedSamlTokenController.EnqueueCalls()) +func (mock *SamlTokenControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockSamlTokenControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockSamlTokenControllerMockEnqueue.RUnlock() + return calls +} + +// EnqueueAfter calls EnqueueAfterFunc. +func (mock *SamlTokenControllerMock) EnqueueAfter(namespace string, name string, after time.Duration) { + if mock.EnqueueAfterFunc == nil { + panic("SamlTokenControllerMock.EnqueueAfterFunc: method is nil but SamlTokenController.EnqueueAfter was just called") + } + callInfo := struct { + Namespace string + Name string + After time.Duration + }{ + Namespace: namespace, + Name: name, + After: after, + } + lockSamlTokenControllerMockEnqueueAfter.Lock() + mock.calls.EnqueueAfter = append(mock.calls.EnqueueAfter, callInfo) + lockSamlTokenControllerMockEnqueueAfter.Unlock() + mock.EnqueueAfterFunc(namespace, name, after) +} + +// EnqueueAfterCalls gets all the calls that were made to EnqueueAfter. +// Check the length with: +// len(mockedSamlTokenController.EnqueueAfterCalls()) +func (mock *SamlTokenControllerMock) EnqueueAfterCalls() []struct { + Namespace string + Name string + After time.Duration +} { + var calls []struct { + Namespace string + Name string + After time.Duration + } + lockSamlTokenControllerMockEnqueueAfter.RLock() + calls = mock.calls.EnqueueAfter + lockSamlTokenControllerMockEnqueueAfter.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *SamlTokenControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("SamlTokenControllerMock.GenericFunc: method is nil but SamlTokenController.Generic was just called") + } + callInfo := struct { + }{} + lockSamlTokenControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockSamlTokenControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedSamlTokenController.GenericCalls()) +func (mock *SamlTokenControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockSamlTokenControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockSamlTokenControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *SamlTokenControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("SamlTokenControllerMock.InformerFunc: method is nil but SamlTokenController.Informer was just called") + } + callInfo := struct { + }{} + lockSamlTokenControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockSamlTokenControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedSamlTokenController.InformerCalls()) +func (mock *SamlTokenControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockSamlTokenControllerMockInformer.RLock() + calls = mock.calls.Informer + lockSamlTokenControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *SamlTokenControllerMock) Lister() v3.SamlTokenLister { + if mock.ListerFunc == nil { + panic("SamlTokenControllerMock.ListerFunc: method is nil but SamlTokenController.Lister was just called") + } + callInfo := struct { + }{} + lockSamlTokenControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockSamlTokenControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedSamlTokenController.ListerCalls()) +func (mock *SamlTokenControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockSamlTokenControllerMockLister.RLock() + calls = mock.calls.Lister + lockSamlTokenControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *SamlTokenControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("SamlTokenControllerMock.StartFunc: method is nil but SamlTokenController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockSamlTokenControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockSamlTokenControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedSamlTokenController.StartCalls()) +func (mock *SamlTokenControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockSamlTokenControllerMockStart.RLock() + calls = mock.calls.Start + lockSamlTokenControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *SamlTokenControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("SamlTokenControllerMock.SyncFunc: method is nil but SamlTokenController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockSamlTokenControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockSamlTokenControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedSamlTokenController.SyncCalls()) +func (mock *SamlTokenControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockSamlTokenControllerMockSync.RLock() + calls = mock.calls.Sync + lockSamlTokenControllerMockSync.RUnlock() + return calls +} + +var ( + lockSamlTokenInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex + lockSamlTokenInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex + lockSamlTokenInterfaceMockAddClusterScopedHandler sync.RWMutex + lockSamlTokenInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockSamlTokenInterfaceMockAddFeatureHandler sync.RWMutex + lockSamlTokenInterfaceMockAddFeatureLifecycle sync.RWMutex + lockSamlTokenInterfaceMockAddHandler sync.RWMutex + lockSamlTokenInterfaceMockAddLifecycle sync.RWMutex + lockSamlTokenInterfaceMockController sync.RWMutex + lockSamlTokenInterfaceMockCreate sync.RWMutex + lockSamlTokenInterfaceMockDelete sync.RWMutex + lockSamlTokenInterfaceMockDeleteCollection sync.RWMutex + lockSamlTokenInterfaceMockDeleteNamespaced sync.RWMutex + lockSamlTokenInterfaceMockGet sync.RWMutex + lockSamlTokenInterfaceMockGetNamespaced sync.RWMutex + lockSamlTokenInterfaceMockList sync.RWMutex + lockSamlTokenInterfaceMockListNamespaced sync.RWMutex + lockSamlTokenInterfaceMockObjectClient sync.RWMutex + lockSamlTokenInterfaceMockUpdate sync.RWMutex + lockSamlTokenInterfaceMockWatch sync.RWMutex +) + +// Ensure, that SamlTokenInterfaceMock does implement SamlTokenInterface. +// If this is not the case, regenerate this file with moq. +var _ v3.SamlTokenInterface = &SamlTokenInterfaceMock{} + +// SamlTokenInterfaceMock is a mock implementation of SamlTokenInterface. +// +// func TestSomethingThatUsesSamlTokenInterface(t *testing.T) { +// +// // make and configure a mocked SamlTokenInterface +// mockedSamlTokenInterface := &SamlTokenInterfaceMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.SamlTokenHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.SamlTokenLifecycle) { +// panic("mock out the AddClusterScopedFeatureLifecycle method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v3.SamlTokenHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v3.SamlTokenLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3.SamlTokenHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v3.SamlTokenLifecycle) { +// panic("mock out the AddFeatureLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v3.SamlTokenHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v3.SamlTokenLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v3.SamlTokenController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v3.SamlToken) (*v3.SamlToken, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1.GetOptions) (*v3.SamlToken, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1.GetOptions) (*v3.SamlToken, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1.ListOptions) (*v3.SamlTokenList, error) { +// panic("mock out the List method") +// }, +// ListNamespacedFunc: func(namespace string, opts v1.ListOptions) (*v3.SamlTokenList, error) { +// panic("mock out the ListNamespaced method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v3.SamlToken) (*v3.SamlToken, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedSamlTokenInterface in code that requires SamlTokenInterface +// // and then make assertions. +// +// } +type SamlTokenInterfaceMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.SamlTokenHandlerFunc) + + // AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.SamlTokenLifecycle) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v3.SamlTokenHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v3.SamlTokenLifecycle) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3.SamlTokenHandlerFunc) + + // AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method. + AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v3.SamlTokenLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v3.SamlTokenHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v3.SamlTokenLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v3.SamlTokenController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v3.SamlToken) (*v3.SamlToken, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1.GetOptions) (*v3.SamlToken, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1.GetOptions) (*v3.SamlToken, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1.ListOptions) (*v3.SamlTokenList, error) + + // ListNamespacedFunc mocks the ListNamespaced method. + ListNamespacedFunc func(namespace string, opts v1.ListOptions) (*v3.SamlTokenList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v3.SamlToken) (*v3.SamlToken, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1.ListOptions) (watch.Interface, error) + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v3.SamlTokenHandlerFunc + } + // AddClusterScopedFeatureLifecycle holds details about calls to the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.SamlTokenLifecycle + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v3.SamlTokenHandlerFunc + } + // AddClusterScopedLifecycle holds details about calls to the AddClusterScopedLifecycle method. + AddClusterScopedLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.SamlTokenLifecycle + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3.SamlTokenHandlerFunc + } + // AddFeatureLifecycle holds details about calls to the AddFeatureLifecycle method. + AddFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.SamlTokenLifecycle + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3.SamlTokenHandlerFunc + } + // AddLifecycle holds details about calls to the AddLifecycle method. + AddLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v3.SamlTokenLifecycle + } + // Controller holds details about calls to the Controller method. + Controller []struct { + } + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v3.SamlToken + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1.ListOptions + } + // DeleteNamespaced holds details about calls to the DeleteNamespaced method. + DeleteNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // GetNamespaced holds details about calls to the GetNamespaced method. + GetNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ListNamespaced holds details about calls to the ListNamespaced method. + ListNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ObjectClient holds details about calls to the ObjectClient method. + ObjectClient []struct { + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v3.SamlToken + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *SamlTokenInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3.SamlTokenHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("SamlTokenInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but SamlTokenInterface.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockSamlTokenInterfaceMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockSamlTokenInterfaceMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedSamlTokenInterface.AddClusterScopedFeatureHandlerCalls()) +func (mock *SamlTokenInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3.SamlTokenHandlerFunc + } + lockSamlTokenInterfaceMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockSamlTokenInterfaceMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc. +func (mock *SamlTokenInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3.SamlTokenLifecycle) { + if mock.AddClusterScopedFeatureLifecycleFunc == nil { + panic("SamlTokenInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but SamlTokenInterface.AddClusterScopedFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.SamlTokenLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockSamlTokenInterfaceMockAddClusterScopedFeatureLifecycle.Lock() + mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo) + lockSamlTokenInterfaceMockAddClusterScopedFeatureLifecycle.Unlock() + mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle) +} + +// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle. +// Check the length with: +// len(mockedSamlTokenInterface.AddClusterScopedFeatureLifecycleCalls()) +func (mock *SamlTokenInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.SamlTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3.SamlTokenLifecycle + } + lockSamlTokenInterfaceMockAddClusterScopedFeatureLifecycle.RLock() + calls = mock.calls.AddClusterScopedFeatureLifecycle + lockSamlTokenInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *SamlTokenInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v3.SamlTokenHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("SamlTokenInterfaceMock.AddClusterScopedHandlerFunc: method is nil but SamlTokenInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockSamlTokenInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockSamlTokenInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedSamlTokenInterface.AddClusterScopedHandlerCalls()) +func (mock *SamlTokenInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3.SamlTokenHandlerFunc + } + lockSamlTokenInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockSamlTokenInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *SamlTokenInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v3.SamlTokenLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("SamlTokenInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but SamlTokenInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.SamlTokenLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockSamlTokenInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockSamlTokenInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedSamlTokenInterface.AddClusterScopedLifecycleCalls()) +func (mock *SamlTokenInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.SamlTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3.SamlTokenLifecycle + } + lockSamlTokenInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockSamlTokenInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *SamlTokenInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3.SamlTokenHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("SamlTokenInterfaceMock.AddFeatureHandlerFunc: method is nil but SamlTokenInterface.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockSamlTokenInterfaceMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockSamlTokenInterfaceMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedSamlTokenInterface.AddFeatureHandlerCalls()) +func (mock *SamlTokenInterfaceMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3.SamlTokenHandlerFunc + } + lockSamlTokenInterfaceMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockSamlTokenInterfaceMockAddFeatureHandler.RUnlock() + return calls +} + +// AddFeatureLifecycle calls AddFeatureLifecycleFunc. +func (mock *SamlTokenInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v3.SamlTokenLifecycle) { + if mock.AddFeatureLifecycleFunc == nil { + panic("SamlTokenInterfaceMock.AddFeatureLifecycleFunc: method is nil but SamlTokenInterface.AddFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.SamlTokenLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Lifecycle: lifecycle, + } + lockSamlTokenInterfaceMockAddFeatureLifecycle.Lock() + mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo) + lockSamlTokenInterfaceMockAddFeatureLifecycle.Unlock() + mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle) +} + +// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle. +// Check the length with: +// len(mockedSamlTokenInterface.AddFeatureLifecycleCalls()) +func (mock *SamlTokenInterfaceMock) AddFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.SamlTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3.SamlTokenLifecycle + } + lockSamlTokenInterfaceMockAddFeatureLifecycle.RLock() + calls = mock.calls.AddFeatureLifecycle + lockSamlTokenInterfaceMockAddFeatureLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *SamlTokenInterfaceMock) AddHandler(ctx context.Context, name string, sync v3.SamlTokenHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("SamlTokenInterfaceMock.AddHandlerFunc: method is nil but SamlTokenInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v3.SamlTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockSamlTokenInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockSamlTokenInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedSamlTokenInterface.AddHandlerCalls()) +func (mock *SamlTokenInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v3.SamlTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v3.SamlTokenHandlerFunc + } + lockSamlTokenInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockSamlTokenInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *SamlTokenInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v3.SamlTokenLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("SamlTokenInterfaceMock.AddLifecycleFunc: method is nil but SamlTokenInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v3.SamlTokenLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockSamlTokenInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockSamlTokenInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedSamlTokenInterface.AddLifecycleCalls()) +func (mock *SamlTokenInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v3.SamlTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v3.SamlTokenLifecycle + } + lockSamlTokenInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockSamlTokenInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *SamlTokenInterfaceMock) Controller() v3.SamlTokenController { + if mock.ControllerFunc == nil { + panic("SamlTokenInterfaceMock.ControllerFunc: method is nil but SamlTokenInterface.Controller was just called") + } + callInfo := struct { + }{} + lockSamlTokenInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockSamlTokenInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedSamlTokenInterface.ControllerCalls()) +func (mock *SamlTokenInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockSamlTokenInterfaceMockController.RLock() + calls = mock.calls.Controller + lockSamlTokenInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *SamlTokenInterfaceMock) Create(in1 *v3.SamlToken) (*v3.SamlToken, error) { + if mock.CreateFunc == nil { + panic("SamlTokenInterfaceMock.CreateFunc: method is nil but SamlTokenInterface.Create was just called") + } + callInfo := struct { + In1 *v3.SamlToken + }{ + In1: in1, + } + lockSamlTokenInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockSamlTokenInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedSamlTokenInterface.CreateCalls()) +func (mock *SamlTokenInterfaceMock) CreateCalls() []struct { + In1 *v3.SamlToken +} { + var calls []struct { + In1 *v3.SamlToken + } + lockSamlTokenInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockSamlTokenInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *SamlTokenInterfaceMock) Delete(name string, options *v1.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("SamlTokenInterfaceMock.DeleteFunc: method is nil but SamlTokenInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1.DeleteOptions + }{ + Name: name, + Options: options, + } + lockSamlTokenInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockSamlTokenInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedSamlTokenInterface.DeleteCalls()) +func (mock *SamlTokenInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Name string + Options *v1.DeleteOptions + } + lockSamlTokenInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockSamlTokenInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *SamlTokenInterfaceMock) DeleteCollection(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("SamlTokenInterfaceMock.DeleteCollectionFunc: method is nil but SamlTokenInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockSamlTokenInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockSamlTokenInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedSamlTokenInterface.DeleteCollectionCalls()) +func (mock *SamlTokenInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions +} { + var calls []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + } + lockSamlTokenInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockSamlTokenInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *SamlTokenInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("SamlTokenInterfaceMock.DeleteNamespacedFunc: method is nil but SamlTokenInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockSamlTokenInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockSamlTokenInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedSamlTokenInterface.DeleteNamespacedCalls()) +func (mock *SamlTokenInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1.DeleteOptions + } + lockSamlTokenInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockSamlTokenInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *SamlTokenInterfaceMock) Get(name string, opts v1.GetOptions) (*v3.SamlToken, error) { + if mock.GetFunc == nil { + panic("SamlTokenInterfaceMock.GetFunc: method is nil but SamlTokenInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1.GetOptions + }{ + Name: name, + Opts: opts, + } + lockSamlTokenInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockSamlTokenInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedSamlTokenInterface.GetCalls()) +func (mock *SamlTokenInterfaceMock) GetCalls() []struct { + Name string + Opts v1.GetOptions +} { + var calls []struct { + Name string + Opts v1.GetOptions + } + lockSamlTokenInterfaceMockGet.RLock() + calls = mock.calls.Get + lockSamlTokenInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *SamlTokenInterfaceMock) GetNamespaced(namespace string, name string, opts v1.GetOptions) (*v3.SamlToken, error) { + if mock.GetNamespacedFunc == nil { + panic("SamlTokenInterfaceMock.GetNamespacedFunc: method is nil but SamlTokenInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockSamlTokenInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockSamlTokenInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedSamlTokenInterface.GetNamespacedCalls()) +func (mock *SamlTokenInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1.GetOptions + } + lockSamlTokenInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockSamlTokenInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *SamlTokenInterfaceMock) List(opts v1.ListOptions) (*v3.SamlTokenList, error) { + if mock.ListFunc == nil { + panic("SamlTokenInterfaceMock.ListFunc: method is nil but SamlTokenInterface.List was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockSamlTokenInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockSamlTokenInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedSamlTokenInterface.ListCalls()) +func (mock *SamlTokenInterfaceMock) ListCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockSamlTokenInterfaceMockList.RLock() + calls = mock.calls.List + lockSamlTokenInterfaceMockList.RUnlock() + return calls +} + +// ListNamespaced calls ListNamespacedFunc. +func (mock *SamlTokenInterfaceMock) ListNamespaced(namespace string, opts v1.ListOptions) (*v3.SamlTokenList, error) { + if mock.ListNamespacedFunc == nil { + panic("SamlTokenInterfaceMock.ListNamespacedFunc: method is nil but SamlTokenInterface.ListNamespaced was just called") + } + callInfo := struct { + Namespace string + Opts v1.ListOptions + }{ + Namespace: namespace, + Opts: opts, + } + lockSamlTokenInterfaceMockListNamespaced.Lock() + mock.calls.ListNamespaced = append(mock.calls.ListNamespaced, callInfo) + lockSamlTokenInterfaceMockListNamespaced.Unlock() + return mock.ListNamespacedFunc(namespace, opts) +} + +// ListNamespacedCalls gets all the calls that were made to ListNamespaced. +// Check the length with: +// len(mockedSamlTokenInterface.ListNamespacedCalls()) +func (mock *SamlTokenInterfaceMock) ListNamespacedCalls() []struct { + Namespace string + Opts v1.ListOptions +} { + var calls []struct { + Namespace string + Opts v1.ListOptions + } + lockSamlTokenInterfaceMockListNamespaced.RLock() + calls = mock.calls.ListNamespaced + lockSamlTokenInterfaceMockListNamespaced.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *SamlTokenInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("SamlTokenInterfaceMock.ObjectClientFunc: method is nil but SamlTokenInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockSamlTokenInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockSamlTokenInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedSamlTokenInterface.ObjectClientCalls()) +func (mock *SamlTokenInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockSamlTokenInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockSamlTokenInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *SamlTokenInterfaceMock) Update(in1 *v3.SamlToken) (*v3.SamlToken, error) { + if mock.UpdateFunc == nil { + panic("SamlTokenInterfaceMock.UpdateFunc: method is nil but SamlTokenInterface.Update was just called") + } + callInfo := struct { + In1 *v3.SamlToken + }{ + In1: in1, + } + lockSamlTokenInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockSamlTokenInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedSamlTokenInterface.UpdateCalls()) +func (mock *SamlTokenInterfaceMock) UpdateCalls() []struct { + In1 *v3.SamlToken +} { + var calls []struct { + In1 *v3.SamlToken + } + lockSamlTokenInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockSamlTokenInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *SamlTokenInterfaceMock) Watch(opts v1.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("SamlTokenInterfaceMock.WatchFunc: method is nil but SamlTokenInterface.Watch was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockSamlTokenInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockSamlTokenInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedSamlTokenInterface.WatchCalls()) +func (mock *SamlTokenInterfaceMock) WatchCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockSamlTokenInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockSamlTokenInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockSamlTokensGetterMockSamlTokens sync.RWMutex +) + +// Ensure, that SamlTokensGetterMock does implement SamlTokensGetter. +// If this is not the case, regenerate this file with moq. +var _ v3.SamlTokensGetter = &SamlTokensGetterMock{} + +// SamlTokensGetterMock is a mock implementation of SamlTokensGetter. +// +// func TestSomethingThatUsesSamlTokensGetter(t *testing.T) { +// +// // make and configure a mocked SamlTokensGetter +// mockedSamlTokensGetter := &SamlTokensGetterMock{ +// SamlTokensFunc: func(namespace string) v3.SamlTokenInterface { +// panic("mock out the SamlTokens method") +// }, +// } +// +// // use mockedSamlTokensGetter in code that requires SamlTokensGetter +// // and then make assertions. +// +// } +type SamlTokensGetterMock struct { + // SamlTokensFunc mocks the SamlTokens method. + SamlTokensFunc func(namespace string) v3.SamlTokenInterface + + // calls tracks calls to the methods. + calls struct { + // SamlTokens holds details about calls to the SamlTokens method. + SamlTokens []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// SamlTokens calls SamlTokensFunc. +func (mock *SamlTokensGetterMock) SamlTokens(namespace string) v3.SamlTokenInterface { + if mock.SamlTokensFunc == nil { + panic("SamlTokensGetterMock.SamlTokensFunc: method is nil but SamlTokensGetter.SamlTokens was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockSamlTokensGetterMockSamlTokens.Lock() + mock.calls.SamlTokens = append(mock.calls.SamlTokens, callInfo) + lockSamlTokensGetterMockSamlTokens.Unlock() + return mock.SamlTokensFunc(namespace) +} + +// SamlTokensCalls gets all the calls that were made to SamlTokens. +// Check the length with: +// len(mockedSamlTokensGetter.SamlTokensCalls()) +func (mock *SamlTokensGetterMock) SamlTokensCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockSamlTokensGetterMockSamlTokens.RLock() + calls = mock.calls.SamlTokens + lockSamlTokensGetterMockSamlTokens.RUnlock() + return calls +} diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 0958c08c..aaf81b8b 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -434,6 +434,7 @@ func authnTypes(schemas *types.Schemas) *types.Schemas { AddMapperForType(&Version, v3.Group{}, m.DisplayName{}). MustImport(&Version, v3.Group{}). MustImport(&Version, v3.GroupMember{}). + MustImport(&Version, v3.SamlToken{}). AddMapperForType(&Version, v3.Principal{}, m.DisplayName{}). MustImportAndCustomize(&Version, v3.Principal{}, func(schema *types.Schema) { schema.CollectionMethods = []string{http.MethodGet} diff --git a/apis/management.cattle.io/v3/zz_generated_deepcopy.go b/apis/management.cattle.io/v3/zz_generated_deepcopy.go index 115e0d9d..0a893327 100644 --- a/apis/management.cattle.io/v3/zz_generated_deepcopy.go +++ b/apis/management.cattle.io/v3/zz_generated_deepcopy.go @@ -9177,6 +9177,66 @@ func (in *SamlConfigTestOutput) DeepCopy() *SamlConfigTestOutput { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SamlToken) DeepCopyInto(out *SamlToken) { + *out = *in + out.Namespaced = in.Namespaced + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SamlToken. +func (in *SamlToken) DeepCopy() *SamlToken { + if in == nil { + return nil + } + out := new(SamlToken) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SamlToken) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SamlTokenList) DeepCopyInto(out *SamlTokenList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SamlToken, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SamlTokenList. +func (in *SamlTokenList) DeepCopy() *SamlTokenList { + if in == nil { + return nil + } + out := new(SamlTokenList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SamlTokenList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SaveAsTemplateInput) DeepCopyInto(out *SaveAsTemplateInput) { *out = *in diff --git a/apis/management.cattle.io/v3/zz_generated_k8s_client.go b/apis/management.cattle.io/v3/zz_generated_k8s_client.go index 12a6a134..e78047a6 100644 --- a/apis/management.cattle.io/v3/zz_generated_k8s_client.go +++ b/apis/management.cattle.io/v3/zz_generated_k8s_client.go @@ -42,6 +42,7 @@ type Interface interface { TemplateContentsGetter GroupsGetter GroupMembersGetter + SamlTokensGetter PrincipalsGetter UsersGetter AuthConfigsGetter @@ -112,6 +113,7 @@ type Client struct { templateContentControllers map[string]TemplateContentController groupControllers map[string]GroupController groupMemberControllers map[string]GroupMemberController + samlTokenControllers map[string]SamlTokenController principalControllers map[string]PrincipalController userControllers map[string]UserController authConfigControllers map[string]AuthConfigController @@ -190,6 +192,7 @@ func NewForConfig(config rest.Config) (Interface, error) { templateContentControllers: map[string]TemplateContentController{}, groupControllers: map[string]GroupController{}, groupMemberControllers: map[string]GroupMemberController{}, + samlTokenControllers: map[string]SamlTokenController{}, principalControllers: map[string]PrincipalController{}, userControllers: map[string]UserController{}, authConfigControllers: map[string]AuthConfigController{}, @@ -532,6 +535,19 @@ func (c *Client) GroupMembers(namespace string) GroupMemberInterface { } } +type SamlTokensGetter interface { + SamlTokens(namespace string) SamlTokenInterface +} + +func (c *Client) SamlTokens(namespace string) SamlTokenInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SamlTokenResource, SamlTokenGroupVersionKind, samlTokenFactory{}) + return &samlTokenClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} + type PrincipalsGetter interface { Principals(namespace string) PrincipalInterface } diff --git a/apis/management.cattle.io/v3/zz_generated_saml_token_controller.go b/apis/management.cattle.io/v3/zz_generated_saml_token_controller.go new file mode 100644 index 00000000..87273cd2 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_saml_token_controller.go @@ -0,0 +1,331 @@ +package v3 + +import ( + "context" + "time" + + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + SamlTokenGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "SamlToken", + } + SamlTokenResource = metav1.APIResource{ + Name: "samltokens", + SingularName: "samltoken", + Namespaced: true, + + Kind: SamlTokenGroupVersionKind.Kind, + } + + SamlTokenGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "samltokens", + } +) + +func init() { + resource.Put(SamlTokenGroupVersionResource) +} + +func NewSamlToken(namespace, name string, obj SamlToken) *SamlToken { + obj.APIVersion, obj.Kind = SamlTokenGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type SamlTokenList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []SamlToken `json:"items"` +} + +type SamlTokenHandlerFunc func(key string, obj *SamlToken) (runtime.Object, error) + +type SamlTokenChangeHandlerFunc func(obj *SamlToken) (runtime.Object, error) + +type SamlTokenLister interface { + List(namespace string, selector labels.Selector) (ret []*SamlToken, err error) + Get(namespace, name string) (*SamlToken, error) +} + +type SamlTokenController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() SamlTokenLister + AddHandler(ctx context.Context, name string, handler SamlTokenHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SamlTokenHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler SamlTokenHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler SamlTokenHandlerFunc) + Enqueue(namespace, name string) + EnqueueAfter(namespace, name string, after time.Duration) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type SamlTokenInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*SamlToken) (*SamlToken, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SamlToken, error) + Get(name string, opts metav1.GetOptions) (*SamlToken, error) + Update(*SamlToken) (*SamlToken, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*SamlTokenList, error) + ListNamespaced(namespace string, opts metav1.ListOptions) (*SamlTokenList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() SamlTokenController + AddHandler(ctx context.Context, name string, sync SamlTokenHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SamlTokenHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle SamlTokenLifecycle) + AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SamlTokenLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SamlTokenHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SamlTokenHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SamlTokenLifecycle) + AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SamlTokenLifecycle) +} + +type samlTokenLister struct { + controller *samlTokenController +} + +func (l *samlTokenLister) List(namespace string, selector labels.Selector) (ret []*SamlToken, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*SamlToken)) + }) + return +} + +func (l *samlTokenLister) Get(namespace, name string) (*SamlToken, error) { + var key string + if namespace != "" { + key = namespace + "/" + name + } else { + key = name + } + obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(schema.GroupResource{ + Group: SamlTokenGroupVersionKind.Group, + Resource: "samlToken", + }, key) + } + return obj.(*SamlToken), nil +} + +type samlTokenController struct { + controller.GenericController +} + +func (c *samlTokenController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *samlTokenController) Lister() SamlTokenLister { + return &samlTokenLister{ + controller: c, + } +} + +func (c *samlTokenController) AddHandler(ctx context.Context, name string, handler SamlTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*SamlToken); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *samlTokenController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler SamlTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*SamlToken); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *samlTokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler SamlTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*SamlToken); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *samlTokenController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler SamlTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*SamlToken); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type samlTokenFactory struct { +} + +func (c samlTokenFactory) Object() runtime.Object { + return &SamlToken{} +} + +func (c samlTokenFactory) List() runtime.Object { + return &SamlTokenList{} +} + +func (s *samlTokenClient) Controller() SamlTokenController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.samlTokenControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(SamlTokenGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &samlTokenController{ + GenericController: genericController, + } + + s.client.samlTokenControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type samlTokenClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller SamlTokenController +} + +func (s *samlTokenClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *samlTokenClient) Create(o *SamlToken) (*SamlToken, error) { + obj, err := s.objectClient.Create(o) + return obj.(*SamlToken), err +} + +func (s *samlTokenClient) Get(name string, opts metav1.GetOptions) (*SamlToken, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*SamlToken), err +} + +func (s *samlTokenClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SamlToken, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*SamlToken), err +} + +func (s *samlTokenClient) Update(o *SamlToken) (*SamlToken, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*SamlToken), err +} + +func (s *samlTokenClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *samlTokenClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *samlTokenClient) List(opts metav1.ListOptions) (*SamlTokenList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*SamlTokenList), err +} + +func (s *samlTokenClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*SamlTokenList, error) { + obj, err := s.objectClient.ListNamespaced(namespace, opts) + return obj.(*SamlTokenList), err +} + +func (s *samlTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *samlTokenClient) Patch(o *SamlToken, patchType types.PatchType, data []byte, subresources ...string) (*SamlToken, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*SamlToken), err +} + +func (s *samlTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *samlTokenClient) AddHandler(ctx context.Context, name string, sync SamlTokenHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *samlTokenClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SamlTokenHandlerFunc) { + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *samlTokenClient) AddLifecycle(ctx context.Context, name string, lifecycle SamlTokenLifecycle) { + sync := NewSamlTokenLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *samlTokenClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SamlTokenLifecycle) { + sync := NewSamlTokenLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *samlTokenClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SamlTokenHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *samlTokenClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SamlTokenHandlerFunc) { + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +func (s *samlTokenClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SamlTokenLifecycle) { + sync := NewSamlTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *samlTokenClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SamlTokenLifecycle) { + sync := NewSamlTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} diff --git a/apis/management.cattle.io/v3/zz_generated_saml_token_lifecycle_adapter.go b/apis/management.cattle.io/v3/zz_generated_saml_token_lifecycle_adapter.go new file mode 100644 index 00000000..0fe894b8 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_saml_token_lifecycle_adapter.go @@ -0,0 +1,66 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/runtime" +) + +type SamlTokenLifecycle interface { + Create(obj *SamlToken) (runtime.Object, error) + Remove(obj *SamlToken) (runtime.Object, error) + Updated(obj *SamlToken) (runtime.Object, error) +} + +type samlTokenLifecycleAdapter struct { + lifecycle SamlTokenLifecycle +} + +func (w *samlTokenLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *samlTokenLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *samlTokenLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*SamlToken)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *samlTokenLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*SamlToken)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *samlTokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*SamlToken)) + if o == nil { + return nil, err + } + return o, err +} + +func NewSamlTokenLifecycleAdapter(name string, clusterScoped bool, client SamlTokenInterface, l SamlTokenLifecycle) SamlTokenHandlerFunc { + if clusterScoped { + resource.PutClusterScoped(SamlTokenGroupVersionResource) + } + adapter := &samlTokenLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *SamlToken) (runtime.Object, error) { + newObj, err := syncFn(key, obj) + if o, ok := newObj.(runtime.Object); ok { + return o, err + } + return nil, err + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_scheme.go b/apis/management.cattle.io/v3/zz_generated_scheme.go index 5cb495f5..309a85d9 100644 --- a/apis/management.cattle.io/v3/zz_generated_scheme.go +++ b/apis/management.cattle.io/v3/zz_generated_scheme.go @@ -78,6 +78,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &GroupList{}, &GroupMember{}, &GroupMemberList{}, + &SamlToken{}, + &SamlTokenList{}, &Principal{}, &PrincipalList{}, &User{}, diff --git a/apis/management.cattle.io/v3public/authn_types.go b/apis/management.cattle.io/v3public/authn_types.go index 4a0c44a4..f3b9d055 100644 --- a/apis/management.cattle.io/v3public/authn_types.go +++ b/apis/management.cattle.io/v3public/authn_types.go @@ -11,6 +11,14 @@ type AuthProvider struct { Type string `json:"type"` } +type AuthToken struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Token string `json:"token"` + ExpiresAt string `json:"expiresAt"` +} + type GenericLogin struct { TTLMillis int64 `json:"ttl,omitempty"` Description string `json:"description,omitempty" norman:"type=string,required"` @@ -118,6 +126,9 @@ type OKTAProvider struct { type SamlLoginInput struct { FinalRedirectURL string `json:"finalRedirectUrl"` + RequestID string `json:"requestId"` + PublicKey string `json:"publicKey"` + ResponseType string `json:"responseType"` } type SamlLoginOutput struct { diff --git a/apis/management.cattle.io/v3public/fakes/zz_generated_auth_token_mock.go b/apis/management.cattle.io/v3public/fakes/zz_generated_auth_token_mock.go new file mode 100644 index 00000000..7ab7333f --- /dev/null +++ b/apis/management.cattle.io/v3public/fakes/zz_generated_auth_token_mock.go @@ -0,0 +1,1845 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fakes + +import ( + context "context" + sync "sync" + time "time" + + controller "github.com/rancher/norman/controller" + objectclient "github.com/rancher/norman/objectclient" + v3public "github.com/rancher/types/apis/management.cattle.io/v3public" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockAuthTokenListerMockGet sync.RWMutex + lockAuthTokenListerMockList sync.RWMutex +) + +// Ensure, that AuthTokenListerMock does implement AuthTokenLister. +// If this is not the case, regenerate this file with moq. +var _ v3public.AuthTokenLister = &AuthTokenListerMock{} + +// AuthTokenListerMock is a mock implementation of AuthTokenLister. +// +// func TestSomethingThatUsesAuthTokenLister(t *testing.T) { +// +// // make and configure a mocked AuthTokenLister +// mockedAuthTokenLister := &AuthTokenListerMock{ +// GetFunc: func(namespace string, name string) (*v3public.AuthToken, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v3public.AuthToken, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedAuthTokenLister in code that requires AuthTokenLister +// // and then make assertions. +// +// } +type AuthTokenListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v3public.AuthToken, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v3public.AuthToken, error) + + // calls tracks calls to the methods. + calls struct { + // Get holds details about calls to the Get method. + Get []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // List holds details about calls to the List method. + List []struct { + // Namespace is the namespace argument value. + Namespace string + // Selector is the selector argument value. + Selector labels.Selector + } + } +} + +// Get calls GetFunc. +func (mock *AuthTokenListerMock) Get(namespace string, name string) (*v3public.AuthToken, error) { + if mock.GetFunc == nil { + panic("AuthTokenListerMock.GetFunc: method is nil but AuthTokenLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockAuthTokenListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockAuthTokenListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedAuthTokenLister.GetCalls()) +func (mock *AuthTokenListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockAuthTokenListerMockGet.RLock() + calls = mock.calls.Get + lockAuthTokenListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *AuthTokenListerMock) List(namespace string, selector labels.Selector) ([]*v3public.AuthToken, error) { + if mock.ListFunc == nil { + panic("AuthTokenListerMock.ListFunc: method is nil but AuthTokenLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockAuthTokenListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockAuthTokenListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedAuthTokenLister.ListCalls()) +func (mock *AuthTokenListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockAuthTokenListerMockList.RLock() + calls = mock.calls.List + lockAuthTokenListerMockList.RUnlock() + return calls +} + +var ( + lockAuthTokenControllerMockAddClusterScopedFeatureHandler sync.RWMutex + lockAuthTokenControllerMockAddClusterScopedHandler sync.RWMutex + lockAuthTokenControllerMockAddFeatureHandler sync.RWMutex + lockAuthTokenControllerMockAddHandler sync.RWMutex + lockAuthTokenControllerMockEnqueue sync.RWMutex + lockAuthTokenControllerMockEnqueueAfter sync.RWMutex + lockAuthTokenControllerMockGeneric sync.RWMutex + lockAuthTokenControllerMockInformer sync.RWMutex + lockAuthTokenControllerMockLister sync.RWMutex + lockAuthTokenControllerMockStart sync.RWMutex + lockAuthTokenControllerMockSync sync.RWMutex +) + +// Ensure, that AuthTokenControllerMock does implement AuthTokenController. +// If this is not the case, regenerate this file with moq. +var _ v3public.AuthTokenController = &AuthTokenControllerMock{} + +// AuthTokenControllerMock is a mock implementation of AuthTokenController. +// +// func TestSomethingThatUsesAuthTokenController(t *testing.T) { +// +// // make and configure a mocked AuthTokenController +// mockedAuthTokenController := &AuthTokenControllerMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// EnqueueFunc: func(namespace string, name string) { +// panic("mock out the Enqueue method") +// }, +// EnqueueAfterFunc: func(namespace string, name string, after time.Duration) { +// panic("mock out the EnqueueAfter method") +// }, +// GenericFunc: func() controller.GenericController { +// panic("mock out the Generic method") +// }, +// InformerFunc: func() cache.SharedIndexInformer { +// panic("mock out the Informer method") +// }, +// ListerFunc: func() v3public.AuthTokenLister { +// panic("mock out the Lister method") +// }, +// StartFunc: func(ctx context.Context, threadiness int) error { +// panic("mock out the Start method") +// }, +// SyncFunc: func(ctx context.Context) error { +// panic("mock out the Sync method") +// }, +// } +// +// // use mockedAuthTokenController in code that requires AuthTokenController +// // and then make assertions. +// +// } +type AuthTokenControllerMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3public.AuthTokenHandlerFunc) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v3public.AuthTokenHandlerFunc) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3public.AuthTokenHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v3public.AuthTokenHandlerFunc) + + // EnqueueFunc mocks the Enqueue method. + EnqueueFunc func(namespace string, name string) + + // EnqueueAfterFunc mocks the EnqueueAfter method. + EnqueueAfterFunc func(namespace string, name string, after time.Duration) + + // GenericFunc mocks the Generic method. + GenericFunc func() controller.GenericController + + // InformerFunc mocks the Informer method. + InformerFunc func() cache.SharedIndexInformer + + // ListerFunc mocks the Lister method. + ListerFunc func() v3public.AuthTokenLister + + // StartFunc mocks the Start method. + StartFunc func(ctx context.Context, threadiness int) error + + // SyncFunc mocks the Sync method. + SyncFunc func(ctx context.Context) error + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v3public.AuthTokenHandlerFunc + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v3public.AuthTokenHandlerFunc + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3public.AuthTokenHandlerFunc + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler v3public.AuthTokenHandlerFunc + } + // Enqueue holds details about calls to the Enqueue method. + Enqueue []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // EnqueueAfter holds details about calls to the EnqueueAfter method. + EnqueueAfter []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // After is the after argument value. + After time.Duration + } + // Generic holds details about calls to the Generic method. + Generic []struct { + } + // Informer holds details about calls to the Informer method. + Informer []struct { + } + // Lister holds details about calls to the Lister method. + Lister []struct { + } + // Start holds details about calls to the Start method. + Start []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Threadiness is the threadiness argument value. + Threadiness int + } + // Sync holds details about calls to the Sync method. + Sync []struct { + // Ctx is the ctx argument value. + Ctx context.Context + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *AuthTokenControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v3public.AuthTokenHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("AuthTokenControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but AuthTokenController.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockAuthTokenControllerMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockAuthTokenControllerMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedAuthTokenController.AddClusterScopedFeatureHandlerCalls()) +func (mock *AuthTokenControllerMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v3public.AuthTokenHandlerFunc + } + lockAuthTokenControllerMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockAuthTokenControllerMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *AuthTokenControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v3public.AuthTokenHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("AuthTokenControllerMock.AddClusterScopedHandlerFunc: method is nil but AuthTokenController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockAuthTokenControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockAuthTokenControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedAuthTokenController.AddClusterScopedHandlerCalls()) +func (mock *AuthTokenControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v3public.AuthTokenHandlerFunc + } + lockAuthTokenControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockAuthTokenControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *AuthTokenControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3public.AuthTokenHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("AuthTokenControllerMock.AddFeatureHandlerFunc: method is nil but AuthTokenController.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockAuthTokenControllerMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockAuthTokenControllerMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedAuthTokenController.AddFeatureHandlerCalls()) +func (mock *AuthTokenControllerMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3public.AuthTokenHandlerFunc + } + lockAuthTokenControllerMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockAuthTokenControllerMockAddFeatureHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *AuthTokenControllerMock) AddHandler(ctx context.Context, name string, handler v3public.AuthTokenHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("AuthTokenControllerMock.AddHandlerFunc: method is nil but AuthTokenController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockAuthTokenControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockAuthTokenControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedAuthTokenController.AddHandlerCalls()) +func (mock *AuthTokenControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v3public.AuthTokenHandlerFunc + } + lockAuthTokenControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockAuthTokenControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *AuthTokenControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("AuthTokenControllerMock.EnqueueFunc: method is nil but AuthTokenController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockAuthTokenControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockAuthTokenControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedAuthTokenController.EnqueueCalls()) +func (mock *AuthTokenControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockAuthTokenControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockAuthTokenControllerMockEnqueue.RUnlock() + return calls +} + +// EnqueueAfter calls EnqueueAfterFunc. +func (mock *AuthTokenControllerMock) EnqueueAfter(namespace string, name string, after time.Duration) { + if mock.EnqueueAfterFunc == nil { + panic("AuthTokenControllerMock.EnqueueAfterFunc: method is nil but AuthTokenController.EnqueueAfter was just called") + } + callInfo := struct { + Namespace string + Name string + After time.Duration + }{ + Namespace: namespace, + Name: name, + After: after, + } + lockAuthTokenControllerMockEnqueueAfter.Lock() + mock.calls.EnqueueAfter = append(mock.calls.EnqueueAfter, callInfo) + lockAuthTokenControllerMockEnqueueAfter.Unlock() + mock.EnqueueAfterFunc(namespace, name, after) +} + +// EnqueueAfterCalls gets all the calls that were made to EnqueueAfter. +// Check the length with: +// len(mockedAuthTokenController.EnqueueAfterCalls()) +func (mock *AuthTokenControllerMock) EnqueueAfterCalls() []struct { + Namespace string + Name string + After time.Duration +} { + var calls []struct { + Namespace string + Name string + After time.Duration + } + lockAuthTokenControllerMockEnqueueAfter.RLock() + calls = mock.calls.EnqueueAfter + lockAuthTokenControllerMockEnqueueAfter.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *AuthTokenControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("AuthTokenControllerMock.GenericFunc: method is nil but AuthTokenController.Generic was just called") + } + callInfo := struct { + }{} + lockAuthTokenControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockAuthTokenControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedAuthTokenController.GenericCalls()) +func (mock *AuthTokenControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockAuthTokenControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockAuthTokenControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *AuthTokenControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("AuthTokenControllerMock.InformerFunc: method is nil but AuthTokenController.Informer was just called") + } + callInfo := struct { + }{} + lockAuthTokenControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockAuthTokenControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedAuthTokenController.InformerCalls()) +func (mock *AuthTokenControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockAuthTokenControllerMockInformer.RLock() + calls = mock.calls.Informer + lockAuthTokenControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *AuthTokenControllerMock) Lister() v3public.AuthTokenLister { + if mock.ListerFunc == nil { + panic("AuthTokenControllerMock.ListerFunc: method is nil but AuthTokenController.Lister was just called") + } + callInfo := struct { + }{} + lockAuthTokenControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockAuthTokenControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedAuthTokenController.ListerCalls()) +func (mock *AuthTokenControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockAuthTokenControllerMockLister.RLock() + calls = mock.calls.Lister + lockAuthTokenControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *AuthTokenControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("AuthTokenControllerMock.StartFunc: method is nil but AuthTokenController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockAuthTokenControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockAuthTokenControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedAuthTokenController.StartCalls()) +func (mock *AuthTokenControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockAuthTokenControllerMockStart.RLock() + calls = mock.calls.Start + lockAuthTokenControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *AuthTokenControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("AuthTokenControllerMock.SyncFunc: method is nil but AuthTokenController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockAuthTokenControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockAuthTokenControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedAuthTokenController.SyncCalls()) +func (mock *AuthTokenControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockAuthTokenControllerMockSync.RLock() + calls = mock.calls.Sync + lockAuthTokenControllerMockSync.RUnlock() + return calls +} + +var ( + lockAuthTokenInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex + lockAuthTokenInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex + lockAuthTokenInterfaceMockAddClusterScopedHandler sync.RWMutex + lockAuthTokenInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockAuthTokenInterfaceMockAddFeatureHandler sync.RWMutex + lockAuthTokenInterfaceMockAddFeatureLifecycle sync.RWMutex + lockAuthTokenInterfaceMockAddHandler sync.RWMutex + lockAuthTokenInterfaceMockAddLifecycle sync.RWMutex + lockAuthTokenInterfaceMockController sync.RWMutex + lockAuthTokenInterfaceMockCreate sync.RWMutex + lockAuthTokenInterfaceMockDelete sync.RWMutex + lockAuthTokenInterfaceMockDeleteCollection sync.RWMutex + lockAuthTokenInterfaceMockDeleteNamespaced sync.RWMutex + lockAuthTokenInterfaceMockGet sync.RWMutex + lockAuthTokenInterfaceMockGetNamespaced sync.RWMutex + lockAuthTokenInterfaceMockList sync.RWMutex + lockAuthTokenInterfaceMockListNamespaced sync.RWMutex + lockAuthTokenInterfaceMockObjectClient sync.RWMutex + lockAuthTokenInterfaceMockUpdate sync.RWMutex + lockAuthTokenInterfaceMockWatch sync.RWMutex +) + +// Ensure, that AuthTokenInterfaceMock does implement AuthTokenInterface. +// If this is not the case, regenerate this file with moq. +var _ v3public.AuthTokenInterface = &AuthTokenInterfaceMock{} + +// AuthTokenInterfaceMock is a mock implementation of AuthTokenInterface. +// +// func TestSomethingThatUsesAuthTokenInterface(t *testing.T) { +// +// // make and configure a mocked AuthTokenInterface +// mockedAuthTokenInterface := &AuthTokenInterfaceMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3public.AuthTokenLifecycle) { +// panic("mock out the AddClusterScopedFeatureLifecycle method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v3public.AuthTokenLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v3public.AuthTokenLifecycle) { +// panic("mock out the AddFeatureLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v3public.AuthTokenHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v3public.AuthTokenLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v3public.AuthTokenController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v3public.AuthToken) (*v3public.AuthToken, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1.GetOptions) (*v3public.AuthToken, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1.GetOptions) (*v3public.AuthToken, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1.ListOptions) (*v3public.AuthTokenList, error) { +// panic("mock out the List method") +// }, +// ListNamespacedFunc: func(namespace string, opts v1.ListOptions) (*v3public.AuthTokenList, error) { +// panic("mock out the ListNamespaced method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v3public.AuthToken) (*v3public.AuthToken, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedAuthTokenInterface in code that requires AuthTokenInterface +// // and then make assertions. +// +// } +type AuthTokenInterfaceMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3public.AuthTokenHandlerFunc) + + // AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3public.AuthTokenLifecycle) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v3public.AuthTokenHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v3public.AuthTokenLifecycle) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v3public.AuthTokenHandlerFunc) + + // AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method. + AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v3public.AuthTokenLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v3public.AuthTokenHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v3public.AuthTokenLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v3public.AuthTokenController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v3public.AuthToken) (*v3public.AuthToken, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1.GetOptions) (*v3public.AuthToken, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1.GetOptions) (*v3public.AuthToken, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1.ListOptions) (*v3public.AuthTokenList, error) + + // ListNamespacedFunc mocks the ListNamespaced method. + ListNamespacedFunc func(namespace string, opts v1.ListOptions) (*v3public.AuthTokenList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v3public.AuthToken) (*v3public.AuthToken, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1.ListOptions) (watch.Interface, error) + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v3public.AuthTokenHandlerFunc + } + // AddClusterScopedFeatureLifecycle holds details about calls to the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v3public.AuthTokenLifecycle + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v3public.AuthTokenHandlerFunc + } + // AddClusterScopedLifecycle holds details about calls to the AddClusterScopedLifecycle method. + AddClusterScopedLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v3public.AuthTokenLifecycle + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3public.AuthTokenHandlerFunc + } + // AddFeatureLifecycle holds details about calls to the AddFeatureLifecycle method. + AddFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v3public.AuthTokenLifecycle + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v3public.AuthTokenHandlerFunc + } + // AddLifecycle holds details about calls to the AddLifecycle method. + AddLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v3public.AuthTokenLifecycle + } + // Controller holds details about calls to the Controller method. + Controller []struct { + } + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v3public.AuthToken + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1.ListOptions + } + // DeleteNamespaced holds details about calls to the DeleteNamespaced method. + DeleteNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // GetNamespaced holds details about calls to the GetNamespaced method. + GetNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ListNamespaced holds details about calls to the ListNamespaced method. + ListNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ObjectClient holds details about calls to the ObjectClient method. + ObjectClient []struct { + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v3public.AuthToken + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *AuthTokenInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v3public.AuthTokenHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("AuthTokenInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but AuthTokenInterface.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockAuthTokenInterfaceMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockAuthTokenInterfaceMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedAuthTokenInterface.AddClusterScopedFeatureHandlerCalls()) +func (mock *AuthTokenInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v3public.AuthTokenHandlerFunc + } + lockAuthTokenInterfaceMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockAuthTokenInterfaceMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc. +func (mock *AuthTokenInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v3public.AuthTokenLifecycle) { + if mock.AddClusterScopedFeatureLifecycleFunc == nil { + panic("AuthTokenInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but AuthTokenInterface.AddClusterScopedFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3public.AuthTokenLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockAuthTokenInterfaceMockAddClusterScopedFeatureLifecycle.Lock() + mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo) + lockAuthTokenInterfaceMockAddClusterScopedFeatureLifecycle.Unlock() + mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle) +} + +// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle. +// Check the length with: +// len(mockedAuthTokenInterface.AddClusterScopedFeatureLifecycleCalls()) +func (mock *AuthTokenInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3public.AuthTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v3public.AuthTokenLifecycle + } + lockAuthTokenInterfaceMockAddClusterScopedFeatureLifecycle.RLock() + calls = mock.calls.AddClusterScopedFeatureLifecycle + lockAuthTokenInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *AuthTokenInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v3public.AuthTokenHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("AuthTokenInterfaceMock.AddClusterScopedHandlerFunc: method is nil but AuthTokenInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockAuthTokenInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockAuthTokenInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedAuthTokenInterface.AddClusterScopedHandlerCalls()) +func (mock *AuthTokenInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v3public.AuthTokenHandlerFunc + } + lockAuthTokenInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockAuthTokenInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *AuthTokenInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v3public.AuthTokenLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("AuthTokenInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but AuthTokenInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3public.AuthTokenLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockAuthTokenInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockAuthTokenInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedAuthTokenInterface.AddClusterScopedLifecycleCalls()) +func (mock *AuthTokenInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3public.AuthTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v3public.AuthTokenLifecycle + } + lockAuthTokenInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockAuthTokenInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *AuthTokenInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v3public.AuthTokenHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("AuthTokenInterfaceMock.AddFeatureHandlerFunc: method is nil but AuthTokenInterface.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockAuthTokenInterfaceMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockAuthTokenInterfaceMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedAuthTokenInterface.AddFeatureHandlerCalls()) +func (mock *AuthTokenInterfaceMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v3public.AuthTokenHandlerFunc + } + lockAuthTokenInterfaceMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockAuthTokenInterfaceMockAddFeatureHandler.RUnlock() + return calls +} + +// AddFeatureLifecycle calls AddFeatureLifecycleFunc. +func (mock *AuthTokenInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v3public.AuthTokenLifecycle) { + if mock.AddFeatureLifecycleFunc == nil { + panic("AuthTokenInterfaceMock.AddFeatureLifecycleFunc: method is nil but AuthTokenInterface.AddFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3public.AuthTokenLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Lifecycle: lifecycle, + } + lockAuthTokenInterfaceMockAddFeatureLifecycle.Lock() + mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo) + lockAuthTokenInterfaceMockAddFeatureLifecycle.Unlock() + mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle) +} + +// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle. +// Check the length with: +// len(mockedAuthTokenInterface.AddFeatureLifecycleCalls()) +func (mock *AuthTokenInterfaceMock) AddFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3public.AuthTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v3public.AuthTokenLifecycle + } + lockAuthTokenInterfaceMockAddFeatureLifecycle.RLock() + calls = mock.calls.AddFeatureLifecycle + lockAuthTokenInterfaceMockAddFeatureLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *AuthTokenInterfaceMock) AddHandler(ctx context.Context, name string, sync v3public.AuthTokenHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("AuthTokenInterfaceMock.AddHandlerFunc: method is nil but AuthTokenInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v3public.AuthTokenHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockAuthTokenInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockAuthTokenInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedAuthTokenInterface.AddHandlerCalls()) +func (mock *AuthTokenInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v3public.AuthTokenHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v3public.AuthTokenHandlerFunc + } + lockAuthTokenInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockAuthTokenInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *AuthTokenInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v3public.AuthTokenLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("AuthTokenInterfaceMock.AddLifecycleFunc: method is nil but AuthTokenInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v3public.AuthTokenLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockAuthTokenInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockAuthTokenInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedAuthTokenInterface.AddLifecycleCalls()) +func (mock *AuthTokenInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v3public.AuthTokenLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v3public.AuthTokenLifecycle + } + lockAuthTokenInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockAuthTokenInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *AuthTokenInterfaceMock) Controller() v3public.AuthTokenController { + if mock.ControllerFunc == nil { + panic("AuthTokenInterfaceMock.ControllerFunc: method is nil but AuthTokenInterface.Controller was just called") + } + callInfo := struct { + }{} + lockAuthTokenInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockAuthTokenInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedAuthTokenInterface.ControllerCalls()) +func (mock *AuthTokenInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockAuthTokenInterfaceMockController.RLock() + calls = mock.calls.Controller + lockAuthTokenInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *AuthTokenInterfaceMock) Create(in1 *v3public.AuthToken) (*v3public.AuthToken, error) { + if mock.CreateFunc == nil { + panic("AuthTokenInterfaceMock.CreateFunc: method is nil but AuthTokenInterface.Create was just called") + } + callInfo := struct { + In1 *v3public.AuthToken + }{ + In1: in1, + } + lockAuthTokenInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockAuthTokenInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedAuthTokenInterface.CreateCalls()) +func (mock *AuthTokenInterfaceMock) CreateCalls() []struct { + In1 *v3public.AuthToken +} { + var calls []struct { + In1 *v3public.AuthToken + } + lockAuthTokenInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockAuthTokenInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *AuthTokenInterfaceMock) Delete(name string, options *v1.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("AuthTokenInterfaceMock.DeleteFunc: method is nil but AuthTokenInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1.DeleteOptions + }{ + Name: name, + Options: options, + } + lockAuthTokenInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockAuthTokenInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedAuthTokenInterface.DeleteCalls()) +func (mock *AuthTokenInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Name string + Options *v1.DeleteOptions + } + lockAuthTokenInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockAuthTokenInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *AuthTokenInterfaceMock) DeleteCollection(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("AuthTokenInterfaceMock.DeleteCollectionFunc: method is nil but AuthTokenInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockAuthTokenInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockAuthTokenInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedAuthTokenInterface.DeleteCollectionCalls()) +func (mock *AuthTokenInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions +} { + var calls []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + } + lockAuthTokenInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockAuthTokenInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *AuthTokenInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("AuthTokenInterfaceMock.DeleteNamespacedFunc: method is nil but AuthTokenInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockAuthTokenInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockAuthTokenInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedAuthTokenInterface.DeleteNamespacedCalls()) +func (mock *AuthTokenInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1.DeleteOptions + } + lockAuthTokenInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockAuthTokenInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *AuthTokenInterfaceMock) Get(name string, opts v1.GetOptions) (*v3public.AuthToken, error) { + if mock.GetFunc == nil { + panic("AuthTokenInterfaceMock.GetFunc: method is nil but AuthTokenInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1.GetOptions + }{ + Name: name, + Opts: opts, + } + lockAuthTokenInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockAuthTokenInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedAuthTokenInterface.GetCalls()) +func (mock *AuthTokenInterfaceMock) GetCalls() []struct { + Name string + Opts v1.GetOptions +} { + var calls []struct { + Name string + Opts v1.GetOptions + } + lockAuthTokenInterfaceMockGet.RLock() + calls = mock.calls.Get + lockAuthTokenInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *AuthTokenInterfaceMock) GetNamespaced(namespace string, name string, opts v1.GetOptions) (*v3public.AuthToken, error) { + if mock.GetNamespacedFunc == nil { + panic("AuthTokenInterfaceMock.GetNamespacedFunc: method is nil but AuthTokenInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockAuthTokenInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockAuthTokenInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedAuthTokenInterface.GetNamespacedCalls()) +func (mock *AuthTokenInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1.GetOptions + } + lockAuthTokenInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockAuthTokenInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *AuthTokenInterfaceMock) List(opts v1.ListOptions) (*v3public.AuthTokenList, error) { + if mock.ListFunc == nil { + panic("AuthTokenInterfaceMock.ListFunc: method is nil but AuthTokenInterface.List was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockAuthTokenInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockAuthTokenInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedAuthTokenInterface.ListCalls()) +func (mock *AuthTokenInterfaceMock) ListCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockAuthTokenInterfaceMockList.RLock() + calls = mock.calls.List + lockAuthTokenInterfaceMockList.RUnlock() + return calls +} + +// ListNamespaced calls ListNamespacedFunc. +func (mock *AuthTokenInterfaceMock) ListNamespaced(namespace string, opts v1.ListOptions) (*v3public.AuthTokenList, error) { + if mock.ListNamespacedFunc == nil { + panic("AuthTokenInterfaceMock.ListNamespacedFunc: method is nil but AuthTokenInterface.ListNamespaced was just called") + } + callInfo := struct { + Namespace string + Opts v1.ListOptions + }{ + Namespace: namespace, + Opts: opts, + } + lockAuthTokenInterfaceMockListNamespaced.Lock() + mock.calls.ListNamespaced = append(mock.calls.ListNamespaced, callInfo) + lockAuthTokenInterfaceMockListNamespaced.Unlock() + return mock.ListNamespacedFunc(namespace, opts) +} + +// ListNamespacedCalls gets all the calls that were made to ListNamespaced. +// Check the length with: +// len(mockedAuthTokenInterface.ListNamespacedCalls()) +func (mock *AuthTokenInterfaceMock) ListNamespacedCalls() []struct { + Namespace string + Opts v1.ListOptions +} { + var calls []struct { + Namespace string + Opts v1.ListOptions + } + lockAuthTokenInterfaceMockListNamespaced.RLock() + calls = mock.calls.ListNamespaced + lockAuthTokenInterfaceMockListNamespaced.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *AuthTokenInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("AuthTokenInterfaceMock.ObjectClientFunc: method is nil but AuthTokenInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockAuthTokenInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockAuthTokenInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedAuthTokenInterface.ObjectClientCalls()) +func (mock *AuthTokenInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockAuthTokenInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockAuthTokenInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *AuthTokenInterfaceMock) Update(in1 *v3public.AuthToken) (*v3public.AuthToken, error) { + if mock.UpdateFunc == nil { + panic("AuthTokenInterfaceMock.UpdateFunc: method is nil but AuthTokenInterface.Update was just called") + } + callInfo := struct { + In1 *v3public.AuthToken + }{ + In1: in1, + } + lockAuthTokenInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockAuthTokenInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedAuthTokenInterface.UpdateCalls()) +func (mock *AuthTokenInterfaceMock) UpdateCalls() []struct { + In1 *v3public.AuthToken +} { + var calls []struct { + In1 *v3public.AuthToken + } + lockAuthTokenInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockAuthTokenInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *AuthTokenInterfaceMock) Watch(opts v1.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("AuthTokenInterfaceMock.WatchFunc: method is nil but AuthTokenInterface.Watch was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockAuthTokenInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockAuthTokenInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedAuthTokenInterface.WatchCalls()) +func (mock *AuthTokenInterfaceMock) WatchCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockAuthTokenInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockAuthTokenInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockAuthTokensGetterMockAuthTokens sync.RWMutex +) + +// Ensure, that AuthTokensGetterMock does implement AuthTokensGetter. +// If this is not the case, regenerate this file with moq. +var _ v3public.AuthTokensGetter = &AuthTokensGetterMock{} + +// AuthTokensGetterMock is a mock implementation of AuthTokensGetter. +// +// func TestSomethingThatUsesAuthTokensGetter(t *testing.T) { +// +// // make and configure a mocked AuthTokensGetter +// mockedAuthTokensGetter := &AuthTokensGetterMock{ +// AuthTokensFunc: func(namespace string) v3public.AuthTokenInterface { +// panic("mock out the AuthTokens method") +// }, +// } +// +// // use mockedAuthTokensGetter in code that requires AuthTokensGetter +// // and then make assertions. +// +// } +type AuthTokensGetterMock struct { + // AuthTokensFunc mocks the AuthTokens method. + AuthTokensFunc func(namespace string) v3public.AuthTokenInterface + + // calls tracks calls to the methods. + calls struct { + // AuthTokens holds details about calls to the AuthTokens method. + AuthTokens []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// AuthTokens calls AuthTokensFunc. +func (mock *AuthTokensGetterMock) AuthTokens(namespace string) v3public.AuthTokenInterface { + if mock.AuthTokensFunc == nil { + panic("AuthTokensGetterMock.AuthTokensFunc: method is nil but AuthTokensGetter.AuthTokens was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockAuthTokensGetterMockAuthTokens.Lock() + mock.calls.AuthTokens = append(mock.calls.AuthTokens, callInfo) + lockAuthTokensGetterMockAuthTokens.Unlock() + return mock.AuthTokensFunc(namespace) +} + +// AuthTokensCalls gets all the calls that were made to AuthTokens. +// Check the length with: +// len(mockedAuthTokensGetter.AuthTokensCalls()) +func (mock *AuthTokensGetterMock) AuthTokensCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockAuthTokensGetterMockAuthTokens.RLock() + calls = mock.calls.AuthTokens + lockAuthTokensGetterMockAuthTokens.RUnlock() + return calls +} diff --git a/apis/management.cattle.io/v3public/schema/public_schema.go b/apis/management.cattle.io/v3public/schema/public_schema.go index 1f6f7f89..491fdaad 100644 --- a/apis/management.cattle.io/v3public/schema/public_schema.go +++ b/apis/management.cattle.io/v3public/schema/public_schema.go @@ -27,6 +27,10 @@ func authProvidersTypes(schemas *types.Schemas) *types.Schemas { schema.CollectionMethods = []string{} schema.ResourceMethods = []string{} }). + MustImportAndCustomize(&PublicVersion, v3public.AuthToken{}, func(schema *types.Schema) { + schema.CollectionMethods = []string{http.MethodGet, http.MethodDelete} + schema.ResourceMethods = []string{http.MethodGet, http.MethodDelete} + }). MustImportAndCustomize(&PublicVersion, v3public.AuthProvider{}, func(schema *types.Schema) { schema.CollectionMethods = []string{http.MethodGet} }). diff --git a/apis/management.cattle.io/v3public/zz_generated_auth_token_controller.go b/apis/management.cattle.io/v3public/zz_generated_auth_token_controller.go new file mode 100644 index 00000000..9c407922 --- /dev/null +++ b/apis/management.cattle.io/v3public/zz_generated_auth_token_controller.go @@ -0,0 +1,330 @@ +package v3public + +import ( + "context" + "time" + + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + AuthTokenGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "AuthToken", + } + AuthTokenResource = metav1.APIResource{ + Name: "authtokens", + SingularName: "authtoken", + Namespaced: false, + Kind: AuthTokenGroupVersionKind.Kind, + } + + AuthTokenGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "authtokens", + } +) + +func init() { + resource.Put(AuthTokenGroupVersionResource) +} + +func NewAuthToken(namespace, name string, obj AuthToken) *AuthToken { + obj.APIVersion, obj.Kind = AuthTokenGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type AuthTokenList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AuthToken `json:"items"` +} + +type AuthTokenHandlerFunc func(key string, obj *AuthToken) (runtime.Object, error) + +type AuthTokenChangeHandlerFunc func(obj *AuthToken) (runtime.Object, error) + +type AuthTokenLister interface { + List(namespace string, selector labels.Selector) (ret []*AuthToken, err error) + Get(namespace, name string) (*AuthToken, error) +} + +type AuthTokenController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() AuthTokenLister + AddHandler(ctx context.Context, name string, handler AuthTokenHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AuthTokenHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler AuthTokenHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler AuthTokenHandlerFunc) + Enqueue(namespace, name string) + EnqueueAfter(namespace, name string, after time.Duration) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type AuthTokenInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*AuthToken) (*AuthToken, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthToken, error) + Get(name string, opts metav1.GetOptions) (*AuthToken, error) + Update(*AuthToken) (*AuthToken, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*AuthTokenList, error) + ListNamespaced(namespace string, opts metav1.ListOptions) (*AuthTokenList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() AuthTokenController + AddHandler(ctx context.Context, name string, sync AuthTokenHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AuthTokenHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle AuthTokenLifecycle) + AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AuthTokenLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AuthTokenHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AuthTokenHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AuthTokenLifecycle) + AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AuthTokenLifecycle) +} + +type authTokenLister struct { + controller *authTokenController +} + +func (l *authTokenLister) List(namespace string, selector labels.Selector) (ret []*AuthToken, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*AuthToken)) + }) + return +} + +func (l *authTokenLister) Get(namespace, name string) (*AuthToken, error) { + var key string + if namespace != "" { + key = namespace + "/" + name + } else { + key = name + } + obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(schema.GroupResource{ + Group: AuthTokenGroupVersionKind.Group, + Resource: "authToken", + }, key) + } + return obj.(*AuthToken), nil +} + +type authTokenController struct { + controller.GenericController +} + +func (c *authTokenController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *authTokenController) Lister() AuthTokenLister { + return &authTokenLister{ + controller: c, + } +} + +func (c *authTokenController) AddHandler(ctx context.Context, name string, handler AuthTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*AuthToken); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *authTokenController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler AuthTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*AuthToken); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *authTokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler AuthTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*AuthToken); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *authTokenController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler AuthTokenHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*AuthToken); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type authTokenFactory struct { +} + +func (c authTokenFactory) Object() runtime.Object { + return &AuthToken{} +} + +func (c authTokenFactory) List() runtime.Object { + return &AuthTokenList{} +} + +func (s *authTokenClient) Controller() AuthTokenController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.authTokenControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(AuthTokenGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &authTokenController{ + GenericController: genericController, + } + + s.client.authTokenControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type authTokenClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller AuthTokenController +} + +func (s *authTokenClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *authTokenClient) Create(o *AuthToken) (*AuthToken, error) { + obj, err := s.objectClient.Create(o) + return obj.(*AuthToken), err +} + +func (s *authTokenClient) Get(name string, opts metav1.GetOptions) (*AuthToken, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*AuthToken), err +} + +func (s *authTokenClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthToken, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*AuthToken), err +} + +func (s *authTokenClient) Update(o *AuthToken) (*AuthToken, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*AuthToken), err +} + +func (s *authTokenClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *authTokenClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *authTokenClient) List(opts metav1.ListOptions) (*AuthTokenList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*AuthTokenList), err +} + +func (s *authTokenClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*AuthTokenList, error) { + obj, err := s.objectClient.ListNamespaced(namespace, opts) + return obj.(*AuthTokenList), err +} + +func (s *authTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *authTokenClient) Patch(o *AuthToken, patchType types.PatchType, data []byte, subresources ...string) (*AuthToken, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*AuthToken), err +} + +func (s *authTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *authTokenClient) AddHandler(ctx context.Context, name string, sync AuthTokenHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *authTokenClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AuthTokenHandlerFunc) { + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *authTokenClient) AddLifecycle(ctx context.Context, name string, lifecycle AuthTokenLifecycle) { + sync := NewAuthTokenLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *authTokenClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AuthTokenLifecycle) { + sync := NewAuthTokenLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *authTokenClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AuthTokenHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *authTokenClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AuthTokenHandlerFunc) { + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +func (s *authTokenClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AuthTokenLifecycle) { + sync := NewAuthTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *authTokenClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AuthTokenLifecycle) { + sync := NewAuthTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} diff --git a/apis/management.cattle.io/v3public/zz_generated_auth_token_lifecycle_adapter.go b/apis/management.cattle.io/v3public/zz_generated_auth_token_lifecycle_adapter.go new file mode 100644 index 00000000..78622212 --- /dev/null +++ b/apis/management.cattle.io/v3public/zz_generated_auth_token_lifecycle_adapter.go @@ -0,0 +1,66 @@ +package v3public + +import ( + "github.com/rancher/norman/lifecycle" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/runtime" +) + +type AuthTokenLifecycle interface { + Create(obj *AuthToken) (runtime.Object, error) + Remove(obj *AuthToken) (runtime.Object, error) + Updated(obj *AuthToken) (runtime.Object, error) +} + +type authTokenLifecycleAdapter struct { + lifecycle AuthTokenLifecycle +} + +func (w *authTokenLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *authTokenLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *authTokenLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*AuthToken)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *authTokenLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*AuthToken)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *authTokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*AuthToken)) + if o == nil { + return nil, err + } + return o, err +} + +func NewAuthTokenLifecycleAdapter(name string, clusterScoped bool, client AuthTokenInterface, l AuthTokenLifecycle) AuthTokenHandlerFunc { + if clusterScoped { + resource.PutClusterScoped(AuthTokenGroupVersionResource) + } + adapter := &authTokenLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *AuthToken) (runtime.Object, error) { + newObj, err := syncFn(key, obj) + if o, ok := newObj.(runtime.Object); ok { + return o, err + } + return nil, err + } +} diff --git a/apis/management.cattle.io/v3public/zz_generated_deepcopy.go b/apis/management.cattle.io/v3public/zz_generated_deepcopy.go index 20eca042..e2f859db 100644 --- a/apis/management.cattle.io/v3public/zz_generated_deepcopy.go +++ b/apis/management.cattle.io/v3public/zz_generated_deepcopy.go @@ -115,6 +115,65 @@ func (in *AuthProviderList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthToken) DeepCopyInto(out *AuthToken) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthToken. +func (in *AuthToken) DeepCopy() *AuthToken { + if in == nil { + return nil + } + out := new(AuthToken) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthToken) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthTokenList) DeepCopyInto(out *AuthTokenList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AuthToken, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthTokenList. +func (in *AuthTokenList) DeepCopy() *AuthTokenList { + if in == nil { + return nil + } + out := new(AuthTokenList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthTokenList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureADLogin) DeepCopyInto(out *AzureADLogin) { *out = *in diff --git a/apis/management.cattle.io/v3public/zz_generated_k8s_client.go b/apis/management.cattle.io/v3public/zz_generated_k8s_client.go index f5a10c73..59b00d50 100644 --- a/apis/management.cattle.io/v3public/zz_generated_k8s_client.go +++ b/apis/management.cattle.io/v3public/zz_generated_k8s_client.go @@ -20,6 +20,7 @@ type Interface interface { RESTClient() rest.Interface controller.Starter + AuthTokensGetter AuthProvidersGetter } @@ -28,6 +29,7 @@ type Client struct { restClient rest.Interface starters []controller.Starter + authTokenControllers map[string]AuthTokenController authProviderControllers map[string]AuthProviderController } @@ -44,6 +46,7 @@ func NewForConfig(config rest.Config) (Interface, error) { return &Client{ restClient: restClient, + authTokenControllers: map[string]AuthTokenController{}, authProviderControllers: map[string]AuthProviderController{}, }, nil } @@ -60,6 +63,19 @@ func (c *Client) Start(ctx context.Context, threadiness int) error { return controller.Start(ctx, threadiness, c.starters...) } +type AuthTokensGetter interface { + AuthTokens(namespace string) AuthTokenInterface +} + +func (c *Client) AuthTokens(namespace string) AuthTokenInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &AuthTokenResource, AuthTokenGroupVersionKind, authTokenFactory{}) + return &authTokenClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} + type AuthProvidersGetter interface { AuthProviders(namespace string) AuthProviderInterface } diff --git a/apis/management.cattle.io/v3public/zz_generated_scheme.go b/apis/management.cattle.io/v3public/zz_generated_scheme.go index 53a5ceaa..5c55193b 100644 --- a/apis/management.cattle.io/v3public/zz_generated_scheme.go +++ b/apis/management.cattle.io/v3public/zz_generated_scheme.go @@ -34,6 +34,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { // TODO this gets cleaned up when the types are fixed scheme.AddKnownTypes(SchemeGroupVersion, + &AuthToken{}, + &AuthTokenList{}, &AuthProvider{}, &AuthProviderList{}, ) diff --git a/client/management/v3/zz_generated_client.go b/client/management/v3/zz_generated_client.go index 1a3acf52..69125f0c 100644 --- a/client/management/v3/zz_generated_client.go +++ b/client/management/v3/zz_generated_client.go @@ -29,6 +29,7 @@ type Client struct { TemplateContent TemplateContentOperations Group GroupOperations GroupMember GroupMemberOperations + SamlToken SamlTokenOperations Principal PrincipalOperations User UserOperations AuthConfig AuthConfigOperations @@ -104,6 +105,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.TemplateContent = newTemplateContentClient(client) client.Group = newGroupClient(client) client.GroupMember = newGroupMemberClient(client) + client.SamlToken = newSamlTokenClient(client) client.Principal = newPrincipalClient(client) client.User = newUserClient(client) client.AuthConfig = newAuthConfigClient(client) diff --git a/client/management/v3/zz_generated_saml_token.go b/client/management/v3/zz_generated_saml_token.go new file mode 100644 index 00000000..91f0fb3c --- /dev/null +++ b/client/management/v3/zz_generated_saml_token.go @@ -0,0 +1,124 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + SamlTokenType = "samlToken" + SamlTokenFieldAnnotations = "annotations" + SamlTokenFieldCreated = "created" + SamlTokenFieldCreatorID = "creatorId" + SamlTokenFieldExpiresAt = "expiresAt" + SamlTokenFieldLabels = "labels" + SamlTokenFieldName = "name" + SamlTokenFieldNamespaceId = "namespaceId" + SamlTokenFieldOwnerReferences = "ownerReferences" + SamlTokenFieldRemoved = "removed" + SamlTokenFieldToken = "token" + SamlTokenFieldUUID = "uuid" +) + +type SamlToken struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + ExpiresAt string `json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + Token string `json:"token,omitempty" yaml:"token,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type SamlTokenCollection struct { + types.Collection + Data []SamlToken `json:"data,omitempty"` + client *SamlTokenClient +} + +type SamlTokenClient struct { + apiClient *Client +} + +type SamlTokenOperations interface { + List(opts *types.ListOpts) (*SamlTokenCollection, error) + ListAll(opts *types.ListOpts) (*SamlTokenCollection, error) + Create(opts *SamlToken) (*SamlToken, error) + Update(existing *SamlToken, updates interface{}) (*SamlToken, error) + Replace(existing *SamlToken) (*SamlToken, error) + ByID(id string) (*SamlToken, error) + Delete(container *SamlToken) error +} + +func newSamlTokenClient(apiClient *Client) *SamlTokenClient { + return &SamlTokenClient{ + apiClient: apiClient, + } +} + +func (c *SamlTokenClient) Create(container *SamlToken) (*SamlToken, error) { + resp := &SamlToken{} + err := c.apiClient.Ops.DoCreate(SamlTokenType, container, resp) + return resp, err +} + +func (c *SamlTokenClient) Update(existing *SamlToken, updates interface{}) (*SamlToken, error) { + resp := &SamlToken{} + err := c.apiClient.Ops.DoUpdate(SamlTokenType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *SamlTokenClient) Replace(obj *SamlToken) (*SamlToken, error) { + resp := &SamlToken{} + err := c.apiClient.Ops.DoReplace(SamlTokenType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *SamlTokenClient) List(opts *types.ListOpts) (*SamlTokenCollection, error) { + resp := &SamlTokenCollection{} + err := c.apiClient.Ops.DoList(SamlTokenType, opts, resp) + resp.client = c + return resp, err +} + +func (c *SamlTokenClient) ListAll(opts *types.ListOpts) (*SamlTokenCollection, error) { + resp := &SamlTokenCollection{} + resp, err := c.List(opts) + if err != nil { + return resp, err + } + data := resp.Data + for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { + data = append(data, next.Data...) + resp = next + resp.Data = data + } + if err != nil { + return resp, err + } + return resp, err +} + +func (cc *SamlTokenCollection) Next() (*SamlTokenCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &SamlTokenCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *SamlTokenClient) ByID(id string) (*SamlToken, error) { + resp := &SamlToken{} + err := c.apiClient.Ops.DoByID(SamlTokenType, id, resp) + return resp, err +} + +func (c *SamlTokenClient) Delete(container *SamlToken) error { + return c.apiClient.Ops.DoResourceDelete(SamlTokenType, &container.Resource) +} diff --git a/client/management/v3public/zz_generated_auth_token.go b/client/management/v3public/zz_generated_auth_token.go new file mode 100644 index 00000000..d406dc7f --- /dev/null +++ b/client/management/v3public/zz_generated_auth_token.go @@ -0,0 +1,122 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + AuthTokenType = "authToken" + AuthTokenFieldAnnotations = "annotations" + AuthTokenFieldCreated = "created" + AuthTokenFieldCreatorID = "creatorId" + AuthTokenFieldExpiresAt = "expiresAt" + AuthTokenFieldLabels = "labels" + AuthTokenFieldName = "name" + AuthTokenFieldOwnerReferences = "ownerReferences" + AuthTokenFieldRemoved = "removed" + AuthTokenFieldToken = "token" + AuthTokenFieldUUID = "uuid" +) + +type AuthToken struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + ExpiresAt string `json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + Token string `json:"token,omitempty" yaml:"token,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type AuthTokenCollection struct { + types.Collection + Data []AuthToken `json:"data,omitempty"` + client *AuthTokenClient +} + +type AuthTokenClient struct { + apiClient *Client +} + +type AuthTokenOperations interface { + List(opts *types.ListOpts) (*AuthTokenCollection, error) + ListAll(opts *types.ListOpts) (*AuthTokenCollection, error) + Create(opts *AuthToken) (*AuthToken, error) + Update(existing *AuthToken, updates interface{}) (*AuthToken, error) + Replace(existing *AuthToken) (*AuthToken, error) + ByID(id string) (*AuthToken, error) + Delete(container *AuthToken) error +} + +func newAuthTokenClient(apiClient *Client) *AuthTokenClient { + return &AuthTokenClient{ + apiClient: apiClient, + } +} + +func (c *AuthTokenClient) Create(container *AuthToken) (*AuthToken, error) { + resp := &AuthToken{} + err := c.apiClient.Ops.DoCreate(AuthTokenType, container, resp) + return resp, err +} + +func (c *AuthTokenClient) Update(existing *AuthToken, updates interface{}) (*AuthToken, error) { + resp := &AuthToken{} + err := c.apiClient.Ops.DoUpdate(AuthTokenType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *AuthTokenClient) Replace(obj *AuthToken) (*AuthToken, error) { + resp := &AuthToken{} + err := c.apiClient.Ops.DoReplace(AuthTokenType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *AuthTokenClient) List(opts *types.ListOpts) (*AuthTokenCollection, error) { + resp := &AuthTokenCollection{} + err := c.apiClient.Ops.DoList(AuthTokenType, opts, resp) + resp.client = c + return resp, err +} + +func (c *AuthTokenClient) ListAll(opts *types.ListOpts) (*AuthTokenCollection, error) { + resp := &AuthTokenCollection{} + resp, err := c.List(opts) + if err != nil { + return resp, err + } + data := resp.Data + for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { + data = append(data, next.Data...) + resp = next + resp.Data = data + } + if err != nil { + return resp, err + } + return resp, err +} + +func (cc *AuthTokenCollection) Next() (*AuthTokenCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &AuthTokenCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *AuthTokenClient) ByID(id string) (*AuthToken, error) { + resp := &AuthToken{} + err := c.apiClient.Ops.DoByID(AuthTokenType, id, resp) + return resp, err +} + +func (c *AuthTokenClient) Delete(container *AuthToken) error { + return c.apiClient.Ops.DoResourceDelete(AuthTokenType, &container.Resource) +} diff --git a/client/management/v3public/zz_generated_client.go b/client/management/v3public/zz_generated_client.go index 1c545caa..97714731 100644 --- a/client/management/v3public/zz_generated_client.go +++ b/client/management/v3public/zz_generated_client.go @@ -7,6 +7,7 @@ import ( type Client struct { clientbase.APIBaseClient + AuthToken AuthTokenOperations AuthProvider AuthProviderOperations } @@ -20,6 +21,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { APIBaseClient: baseClient, } + client.AuthToken = newAuthTokenClient(client) client.AuthProvider = newAuthProviderClient(client) return client, nil diff --git a/client/management/v3public/zz_generated_saml_login_input.go b/client/management/v3public/zz_generated_saml_login_input.go index 546195c1..a6fb24aa 100644 --- a/client/management/v3public/zz_generated_saml_login_input.go +++ b/client/management/v3public/zz_generated_saml_login_input.go @@ -3,8 +3,14 @@ package client const ( SamlLoginInputType = "samlLoginInput" SamlLoginInputFieldFinalRedirectURL = "finalRedirectUrl" + SamlLoginInputFieldPublicKey = "publicKey" + SamlLoginInputFieldRequestID = "requestId" + SamlLoginInputFieldResponseType = "responseType" ) type SamlLoginInput struct { FinalRedirectURL string `json:"finalRedirectUrl,omitempty" yaml:"finalRedirectUrl,omitempty"` + PublicKey string `json:"publicKey,omitempty" yaml:"publicKey,omitempty"` + RequestID string `json:"requestId,omitempty" yaml:"requestId,omitempty"` + ResponseType string `json:"responseType,omitempty" yaml:"responseType,omitempty"` } diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go index fc94dfd0..ac4dc312 100644 --- a/compose/zz_generated_compose.go +++ b/compose/zz_generated_compose.go @@ -32,6 +32,7 @@ type Config struct { TemplateContents map[string]managementClient.TemplateContent `json:"templateContents,omitempty" yaml:"templateContents,omitempty"` Groups map[string]managementClient.Group `json:"groups,omitempty" yaml:"groups,omitempty"` GroupMembers map[string]managementClient.GroupMember `json:"groupMembers,omitempty" yaml:"groupMembers,omitempty"` + SamlTokens map[string]managementClient.SamlToken `json:"samlTokens,omitempty" yaml:"samlTokens,omitempty"` Users map[string]managementClient.User `json:"users,omitempty" yaml:"users,omitempty"` LdapConfigs map[string]managementClient.LdapConfig `json:"ldapConfigs,omitempty" yaml:"ldapConfigs,omitempty"` Tokens map[string]managementClient.Token `json:"tokens,omitempty" yaml:"tokens,omitempty"` diff --git a/user/manager.go b/user/manager.go index 25fc1496..72f81742 100644 --- a/user/manager.go +++ b/user/manager.go @@ -16,4 +16,5 @@ type Manager interface { SetPrincipalOnCurrentUserByUserID(userID string, principal v3.Principal) (*v3.User, error) CreateNewUserClusterRoleBinding(userName string, userUID apitypes.UID) error GetUserByPrincipalID(principalName string) (*v3.User, error) + GetKubeconfigToken(clusterName, tokenName, description, kind, userName string) (*v3.Token, error) }