auth

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package auth manages WW authentication and credential storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	TLD string
}

Auth handles WW authentication for a given TLD.

func (*Auth) Expiry

func (a *Auth) Expiry(token string) (time.Time, error)

Expiry returns the expiry time embedded in the given JWT.

func (*Auth) Login

func (a *Auth) Login(email, password string) (string, error)

Login authenticates with email and password, stores credentials and token in the system keychain, and returns the JWT.

func (*Auth) Logout

func (a *Auth) Logout() error

Logout removes all stored credentials from the system keychain.

func (*Auth) Token

func (a *Auth) Token() (string, error)

Token returns a valid JWT, silently re-authenticating with stored credentials if the cached token is missing or within 5 minutes of expiry.

Jump to

Keyboard shortcuts

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