Documentation
¶
Overview ¶
Package auth provides shared authentication logic for Tharsis CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶ added in v0.31.0
type Authenticator interface {
Authenticate(ctx context.Context) (*oauth2.Token, error)
StoreToken(token *oauth2.Token) error
}
Authenticator handles authentication flow.
func NewSSOAuthenticator ¶ added in v0.31.0
func NewSSOAuthenticator(tharsisURL string, opts ...Option) (Authenticator, error)
NewSSOAuthenticator creates a new SSO authenticator.
type MockAuthenticator ¶ added in v0.31.0
MockAuthenticator is an autogenerated mock type for the Authenticator type
func NewMockAuthenticator ¶ added in v0.31.0
func NewMockAuthenticator(t interface {
mock.TestingT
Cleanup(func())
}) *MockAuthenticator
NewMockAuthenticator creates a new instance of MockAuthenticator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockAuthenticator) Authenticate ¶ added in v0.31.0
Authenticate provides a mock function with given fields: ctx
func (*MockAuthenticator) StoreToken ¶ added in v0.31.0
func (_m *MockAuthenticator) StoreToken(token *oauth2.Token) error
StoreToken provides a mock function with given fields: token
type Option ¶ added in v0.31.0
type Option func(*Options)
Option is a functional option for authenticator options.
func WithGRPCClient ¶ added in v0.31.0
func WithGRPCClient(grpcClient *client.GRPCClient) Option
WithGRPCClient sets the gRPC client.