auth

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service handles authentication operations

func NewService

func NewService(baseURL string, httpClient *http.Client, logger types.Logger, userAgent string) *Service

NewService creates a new auth service. An optional userAgent can be provided; if empty, the default library user-agent is used.

func (*Service) GetSession

func (s *Service) GetSession() (*types.Session, error)

GetSession returns the current session

func (*Service) LoadSession

func (s *Service) LoadSession(path string) error

LoadSession loads session from file

func (*Service) Login

func (s *Service) Login(ctx context.Context, email, password string) error

Login performs authentication

func (*Service) LoginInteractive

func (s *Service) LoginInteractive(ctx context.Context, email, password string) error

LoginInteractive performs interactive login with prompts for MFA/OTP when needed

func (*Service) LoginWithEmailOTP

func (s *Service) LoginWithEmailOTP(ctx context.Context, email, password, otpCode string) error

LoginWithEmailOTP performs login with email OTP code. NOTE: The initial login must have already been attempted (which triggers the OTP email). Re-submits login with the OTP code in the email_otp field.

func (*Service) LoginWithMFA

func (s *Service) LoginWithMFA(ctx context.Context, email, password, mfaCode string) error

LoginWithMFA performs login with MFA code

func (*Service) LoginWithTOTP

func (s *Service) LoginWithTOTP(ctx context.Context, email, password, totpSecret string) error

LoginWithTOTP performs login with TOTP secret

func (*Service) SaveSession

func (s *Service) SaveSession(path string) error

SaveSession saves session to file

func (*Service) SetSession

func (s *Service) SetSession(session *types.Session)

SetSession sets the current session

Jump to

Keyboard shortcuts

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