auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientKeyring

func ClientKeyring() (keyring gokeyring.Keyring, err error)

ClientKeyring returns the appropriate keyring (system or file) but does not change the keyring pref.

func InteractiveAuthorizer

func InteractiveAuthorizer(oauthAuthorizeURL string) (code string, err error)

InteractiveAuthorizer prompts the user to log in with their browser and then enter their auth code.

func Login

func Login(user string, allowHTTP bool, keyring gokeyring.Keyring, authorizer Authorizer) error

Login authenticates the user and saves the credentials in the system keychain.

func LoginKeyring

func LoginKeyring(useCleartextFileKeyring bool) (keyring gokeyring.Keyring, err error)

LoginKeyring sets the keyring pref and returns the appropriate keyring (system or file).

func Logout

func Logout(user string) error

func Switch

func Switch(user string) error

func Whoami

func Whoami() (string, error)

Types

type Authorizer

type Authorizer func(oauthAuthorizeURL string) (code string, err error)

Authorizer is a function that can exchange an OAuth authorization URL for an authorization code.

type Client

type Client struct {
	Client *apiclient.GoToSocialSwaggerDocumentation
	Auth   runtime.ClientAuthInfoWriter
	// contains filtered or unexported fields
}

Client is a GtS API client with attached authentication credentials and rate limiter. Credentials may be no-op.

func NewAuthClient

func NewAuthClient(user string, keyring gokeyring.Keyring) (*Client, error)

func (*Client) Wait

func (c *Client) Wait() error

Jump to

Keyboard shortcuts

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