Documentation
¶
Index ¶
- type MockAuth
- func (m *MockAuth) ClearTokens() error
- func (m *MockAuth) GetAccessToken(ctx context.Context) (string, error)
- func (m *MockAuth) GetUserID(ctx context.Context) (string, error)
- func (m *MockAuth) IsAuthenticated() bool
- func (m *MockAuth) RefreshTokenWithOrganization(ctx context.Context, workosOrgID domain.WorkosOrganizationID) (string, error)
- func (m *MockAuth) RefreshTokenWithoutOrganization(ctx context.Context) (string, error)
- func (m *MockAuth) StartDeviceAuth(ctx context.Context) (*auth.DeviceAuth, error)
- func (m *MockAuth) WaitForAuth(ctx context.Context, deviceCode string, interval time.Duration) (*auth.Result, error)
- type MockOAuthProvider
- func (m *MockOAuthProvider) AuthorizeDevice(ctx context.Context) (*auth.DeviceAuthResponse, error)
- func (m *MockOAuthProvider) PollAuthentication(ctx context.Context, deviceCode string) (*auth.AuthenticationResponse, error)
- func (m *MockOAuthProvider) RefreshToken(ctx context.Context, refreshToken string) (*auth.RefreshResponse, error)
- func (m *MockOAuthProvider) RefreshTokenWithOrganization(ctx context.Context, refreshToken string, ...) (*auth.RefreshResponse, error)
- type MockSecureStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockAuth ¶
type MockAuth struct {
StartDeviceAuthFunc func(ctx context.Context) (*auth.DeviceAuth, error)
WaitForAuthFunc func(ctx context.Context, deviceCode string, interval time.Duration) (*auth.Result, error)
IsAuthenticatedFunc func() bool
GetAccessTokenFunc func(ctx context.Context) (string, error)
GetUserIDFunc func(ctx context.Context) (string, error)
ClearTokensFunc func() error
RefreshTokenWithoutOrganizationFunc func(ctx context.Context) (string, error)
RefreshTokenWithOrganizationFunc func(ctx context.Context, workosOrgID domain.WorkosOrganizationID) (string, error)
}
MockAuth implements auth.Auth for testing.
func (*MockAuth) ClearTokens ¶
func (*MockAuth) GetAccessToken ¶
func (*MockAuth) IsAuthenticated ¶
func (*MockAuth) RefreshTokenWithOrganization ¶
func (*MockAuth) RefreshTokenWithoutOrganization ¶
func (*MockAuth) StartDeviceAuth ¶
type MockOAuthProvider ¶
type MockOAuthProvider struct {
AuthorizeDeviceFunc func(ctx context.Context) (*auth.DeviceAuthResponse, error)
PollAuthenticationFunc func(ctx context.Context, deviceCode string) (*auth.AuthenticationResponse, error)
RefreshTokenFunc func(ctx context.Context, refreshToken string) (*auth.RefreshResponse, error)
RefreshTokenWithOrganizationFunc func(ctx context.Context, refreshToken string, organizationID domain.WorkosOrganizationID) (*auth.RefreshResponse, error)
}
MockOAuthProvider is a test double for auth.OAuthProvider.
func (*MockOAuthProvider) AuthorizeDevice ¶
func (m *MockOAuthProvider) AuthorizeDevice(ctx context.Context) (*auth.DeviceAuthResponse, error)
func (*MockOAuthProvider) PollAuthentication ¶
func (m *MockOAuthProvider) PollAuthentication(ctx context.Context, deviceCode string) (*auth.AuthenticationResponse, error)
func (*MockOAuthProvider) RefreshToken ¶
func (m *MockOAuthProvider) RefreshToken(ctx context.Context, refreshToken string) (*auth.RefreshResponse, error)
func (*MockOAuthProvider) RefreshTokenWithOrganization ¶
func (m *MockOAuthProvider) RefreshTokenWithOrganization(ctx context.Context, refreshToken string, organizationID domain.WorkosOrganizationID) (*auth.RefreshResponse, error)
type MockSecureStorage ¶
type MockSecureStorage struct {
GetFunc func(key string) (string, error)
SetFunc func(key string, value string) error
DeleteFunc func(key string) error
}
MockSecureStorage is a test double for auth.SecureStorage.
func (*MockSecureStorage) Delete ¶
func (m *MockSecureStorage) Delete(key string) error
Click to show internal directories.
Click to hide internal directories.