Documentation ¶
Index ¶
- type FakeClient
- func (f *FakeClient) Authenticate(ctx context.Context, r *authn.Request) (*authn.Identity, error)
- func (f FakeClient) IsEnabled() bool
- func (f *FakeClient) Name() string
- func (f *FakeClient) Priority() uint
- func (f *FakeClient) Test(ctx context.Context, r *authn.Request) bool
- func (f *FakeClient) UsageStatFn(ctx context.Context) (map[string]any, error)
- type FakePasswordClient
- type FakeRedirectClient
- func (f FakeRedirectClient) Authenticate(ctx context.Context, r *authn.Request) (*authn.Identity, error)
- func (f FakeRedirectClient) IsEnabled() bool
- func (f FakeRedirectClient) Name() string
- func (f FakeRedirectClient) RedirectURL(ctx context.Context, r *authn.Request) (*authn.Redirect, error)
- func (f FakeRedirectClient) Test(ctx context.Context, r *authn.Request) bool
- type FakeService
- func (f *FakeService) Authenticate(ctx context.Context, r *authn.Request) (*authn.Identity, error)
- func (f *FakeService) IsClientEnabled(name string) bool
- func (f *FakeService) Login(ctx context.Context, client string, r *authn.Request) (*authn.Identity, error)
- func (f *FakeService) Logout(_ context.Context, _ identity.Requester, _ *usertoken.UserToken) (*authn.Redirect, error)
- func (f *FakeService) RedirectURL(ctx context.Context, client string, r *authn.Request) (*authn.Redirect, error)
- func (f *FakeService) RegisterClient(c authn.Client)
- func (f *FakeService) RegisterPostAuthHook(hook authn.PostAuthHookFn, priority uint)
- func (f *FakeService) RegisterPostLoginHook(hook authn.PostLoginHookFn, priority uint)
- func (f *FakeService) RegisterPreLogoutHook(hook authn.PreLogoutHookFn, priority uint)
- func (f *FakeService) ResolveIdentity(ctx context.Context, orgID int64, namespaceID authn.NamespaceID) (*authn.Identity, error)
- func (f *FakeService) SyncIdentity(ctx context.Context, identity *authn.Identity) error
- type MockClient
- func (m MockClient) Authenticate(ctx context.Context, r *authn.Request) (*authn.Identity, error)
- func (m MockClient) Hook(ctx context.Context, identity *authn.Identity, r *authn.Request) error
- func (m MockClient) IsEnabled() bool
- func (m *MockClient) Logout(ctx context.Context, user identity.Requester) (*authn.Redirect, bool)
- func (m MockClient) Name() string
- func (m *MockClient) Namespace() string
- func (m MockClient) Priority() uint
- func (m *MockClient) ResolveIdentity(ctx context.Context, orgID int64, namespaceID authn.NamespaceID) (*authn.Identity, error)
- func (m MockClient) Test(ctx context.Context, r *authn.Request) bool
- type MockProxyClient
- type MockService
- func (m *MockService) Authenticate(ctx context.Context, r *authn.Request) (*authn.Identity, error)
- func (m *MockService) IsClientEnabled(name string) bool
- func (m *MockService) Login(ctx context.Context, client string, r *authn.Request) (*authn.Identity, error)
- func (*MockService) Logout(_ context.Context, _ identity.Requester, _ *usertoken.UserToken) (*authn.Redirect, error)
- func (m *MockService) RedirectURL(ctx context.Context, client string, r *authn.Request) (*authn.Redirect, error)
- func (m *MockService) RegisterClient(c authn.Client)
- func (m *MockService) RegisterPostAuthHook(hook authn.PostAuthHookFn, priority uint)
- func (m *MockService) RegisterPostLoginHook(hook authn.PostLoginHookFn, priority uint)
- func (m *MockService) RegisterPreLogoutHook(hook authn.PreLogoutHookFn, priority uint)
- func (m *MockService) ResolveIdentity(ctx context.Context, orgID int64, namespaceID authn.NamespaceID) (*authn.Identity, error)
- func (m *MockService) SyncIdentity(ctx context.Context, identity *authn.Identity) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeClient ¶
type FakeClient struct { ExpectedName string ExpectedErr error ExpectedTest bool ExpectedPriority uint ExpectedIdentity *authn.Identity ExpectedStats map[string]any }
func (*FakeClient) Authenticate ¶
func (FakeClient) IsEnabled ¶
func (f FakeClient) IsEnabled() bool
func (*FakeClient) Name ¶
func (f *FakeClient) Name() string
func (*FakeClient) Priority ¶
func (f *FakeClient) Priority() uint
func (*FakeClient) UsageStatFn ¶
type FakePasswordClient ¶
type FakeRedirectClient ¶
type FakeRedirectClient struct { ExpectedErr error ExpectedURL string ExpectedName string ExpectedOK bool ExpectedRedirect *authn.Redirect ExpectedIdentity *authn.Identity }
func (FakeRedirectClient) Authenticate ¶
func (FakeRedirectClient) IsEnabled ¶
func (f FakeRedirectClient) IsEnabled() bool
func (FakeRedirectClient) Name ¶
func (f FakeRedirectClient) Name() string
func (FakeRedirectClient) RedirectURL ¶
type FakeService ¶
type FakeService struct { ExpectedErr error ExpectedRedirect *authn.Redirect ExpectedIdentity *authn.Identity ExpectedErrs []error ExpectedIdentities []*authn.Identity CurrentIndex int }
func (*FakeService) Authenticate ¶
func (*FakeService) IsClientEnabled ¶
func (f *FakeService) IsClientEnabled(name string) bool
func (*FakeService) RedirectURL ¶
func (*FakeService) RegisterClient ¶
func (f *FakeService) RegisterClient(c authn.Client)
func (*FakeService) RegisterPostAuthHook ¶
func (f *FakeService) RegisterPostAuthHook(hook authn.PostAuthHookFn, priority uint)
func (*FakeService) RegisterPostLoginHook ¶
func (f *FakeService) RegisterPostLoginHook(hook authn.PostLoginHookFn, priority uint)
func (*FakeService) RegisterPreLogoutHook ¶
func (f *FakeService) RegisterPreLogoutHook(hook authn.PreLogoutHookFn, priority uint)
func (*FakeService) ResolveIdentity ¶
func (f *FakeService) ResolveIdentity(ctx context.Context, orgID int64, namespaceID authn.NamespaceID) (*authn.Identity, error)
func (*FakeService) SyncIdentity ¶
type MockClient ¶
type MockClient struct { NameFunc func() string AuthenticateFunc func(ctx context.Context, r *authn.Request) (*authn.Identity, error) TestFunc func(ctx context.Context, r *authn.Request) bool PriorityFunc func() uint HookFunc func(ctx context.Context, identity *authn.Identity, r *authn.Request) error LogoutFunc func(ctx context.Context, user identity.Requester) (*authn.Redirect, bool) NamespaceFunc func() string ResolveIdentityFunc func(ctx context.Context, orgID int64, namespaceID authn.NamespaceID) (*authn.Identity, error) }
func (MockClient) Authenticate ¶
func (MockClient) IsEnabled ¶
func (m MockClient) IsEnabled() bool
func (MockClient) Name ¶
func (m MockClient) Name() string
func (*MockClient) Namespace ¶
func (m *MockClient) Namespace() string
func (MockClient) Priority ¶
func (m MockClient) Priority() uint
func (*MockClient) ResolveIdentity ¶
func (m *MockClient) ResolveIdentity(ctx context.Context, orgID int64, namespaceID authn.NamespaceID) (*authn.Identity, error)
ResolveIdentity implements authn.IdentityResolverClient.
type MockProxyClient ¶
type MockService ¶
type MockService struct { SyncIdentityFunc func(ctx context.Context, identity *authn.Identity) error RegisterPostAuthHookFunc func(hook authn.PostAuthHookFn, priority uint) }
func (*MockService) Authenticate ¶
func (*MockService) IsClientEnabled ¶
func (m *MockService) IsClientEnabled(name string) bool
func (*MockService) RedirectURL ¶
func (*MockService) RegisterClient ¶
func (m *MockService) RegisterClient(c authn.Client)
func (*MockService) RegisterPostAuthHook ¶
func (m *MockService) RegisterPostAuthHook(hook authn.PostAuthHookFn, priority uint)
func (*MockService) RegisterPostLoginHook ¶
func (m *MockService) RegisterPostLoginHook(hook authn.PostLoginHookFn, priority uint)
func (*MockService) RegisterPreLogoutHook ¶
func (m *MockService) RegisterPreLogoutHook(hook authn.PreLogoutHookFn, priority uint)
func (*MockService) ResolveIdentity ¶
func (m *MockService) ResolveIdentity(ctx context.Context, orgID int64, namespaceID authn.NamespaceID) (*authn.Identity, error)
func (*MockService) SyncIdentity ¶
Click to show internal directories.
Click to hide internal directories.