Documentation
¶
Overview ¶
Package auth provides shared authentication logic for Phobos CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
Authenticate(ctx context.Context) (*oauth2.Token, error)
StoreToken(token *oauth2.Token) error
}
Authenticator handles authentication flow.
func NewSSOAuthenticator ¶
func NewSSOAuthenticator(phobosURL string, opts ...Option) (Authenticator, error)
NewSSOAuthenticator creates a new SSO authenticator.
type MockAuthenticator ¶
MockAuthenticator is an autogenerated mock type for the Authenticator type
func NewMockAuthenticator ¶
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 ¶
Authenticate provides a mock function with given fields: ctx
func (*MockAuthenticator) StoreToken ¶
func (_m *MockAuthenticator) StoreToken(token *oauth2.Token) error
StoreToken provides a mock function with given fields: token
type Option ¶
type Option func(*Options)
Option is a functional option for authenticator options.
func WithGRPCClient ¶
WithGRPCClient sets the gRPC client.