Documentation
¶
Index ¶
- type Service
- func (s *Service) GetSession() (*types.Session, error)
- func (s *Service) LoadSession(path string) error
- func (s *Service) Login(ctx context.Context, email, password string) error
- func (s *Service) LoginInteractive(ctx context.Context, email, password string) error
- func (s *Service) LoginWithEmailOTP(ctx context.Context, email, password, otpCode string) error
- func (s *Service) LoginWithMFA(ctx context.Context, email, password, mfaCode string) error
- func (s *Service) LoginWithTOTP(ctx context.Context, email, password, totpSecret string) error
- func (s *Service) SaveSession(path string) error
- func (s *Service) SetSession(session *types.Session)
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 ¶
GetSession returns the current session
func (*Service) LoadSession ¶
LoadSession loads session from file
func (*Service) LoginInteractive ¶
LoginInteractive performs interactive login with prompts for MFA/OTP when needed
func (*Service) LoginWithEmailOTP ¶
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 ¶
LoginWithMFA performs login with MFA code
func (*Service) LoginWithTOTP ¶
LoginWithTOTP performs login with TOTP secret
func (*Service) SaveSession ¶
SaveSession saves session to file
func (*Service) SetSession ¶
SetSession sets the current session