auth

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package auth is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotLoggedIn = errors.New("not logged in")
View Source
var ErrTokenNotFound = errors.New("credential not found")

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func New

func New(sink output.Sink, platform api.PlatformAPI, storage AuthTokenStorage, authToken, webAppURL string, allowLogin bool) *Auth

func (*Auth) GetToken

func (a *Auth) GetToken(ctx context.Context) (string, error)

GetToken tries in order: 1) keyring 2) LOCALSTACK_AUTH_TOKEN env var 3) device flow login

func (*Auth) Logout

func (a *Auth) Logout() error

Logout removes the stored auth token from the keyring

type AuthTokenStorage

type AuthTokenStorage interface {
	GetAuthToken() (string, error)
	SetAuthToken(token string) error
	DeleteAuthToken() error
}

func NewTokenStorage

func NewTokenStorage(forceFileKeyring bool, logger log.Logger) (AuthTokenStorage, error)

type LoginProvider

type LoginProvider interface {
	Login(ctx context.Context) (string, error)
}

type MockAuthTokenStorage

type MockAuthTokenStorage struct {
	// contains filtered or unexported fields
}

MockAuthTokenStorage is a mock of AuthTokenStorage interface.

func NewMockAuthTokenStorage

func NewMockAuthTokenStorage(ctrl *gomock.Controller) *MockAuthTokenStorage

NewMockAuthTokenStorage creates a new mock instance.

func (*MockAuthTokenStorage) DeleteAuthToken

func (m *MockAuthTokenStorage) DeleteAuthToken() error

DeleteAuthToken mocks base method.

func (*MockAuthTokenStorage) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAuthTokenStorage) GetAuthToken

func (m *MockAuthTokenStorage) GetAuthToken() (string, error)

GetAuthToken mocks base method.

func (*MockAuthTokenStorage) SetAuthToken

func (m *MockAuthTokenStorage) SetAuthToken(token string) error

SetAuthToken mocks base method.

type MockAuthTokenStorageMockRecorder

type MockAuthTokenStorageMockRecorder struct {
	// contains filtered or unexported fields
}

MockAuthTokenStorageMockRecorder is the mock recorder for MockAuthTokenStorage.

func (*MockAuthTokenStorageMockRecorder) DeleteAuthToken

func (mr *MockAuthTokenStorageMockRecorder) DeleteAuthToken() *gomock.Call

DeleteAuthToken indicates an expected call of DeleteAuthToken.

func (*MockAuthTokenStorageMockRecorder) GetAuthToken

func (mr *MockAuthTokenStorageMockRecorder) GetAuthToken() *gomock.Call

GetAuthToken indicates an expected call of GetAuthToken.

func (*MockAuthTokenStorageMockRecorder) SetAuthToken

func (mr *MockAuthTokenStorageMockRecorder) SetAuthToken(token any) *gomock.Call

SetAuthToken indicates an expected call of SetAuthToken.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL