auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartListener

func StartListener(port int, callback func(code, state string) error) error

Types

type Auth

type Auth struct {
	TokenStore *store.TokenStore
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(config *config.Config) *Auth

NewAuth creates a new Auth object

func (*Auth) GetBearerTokenHeader

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

GetBearerTokenHeader gets the bearer token from the token store

func (*Auth) GetOAuth1Header

func (a *Auth) GetOAuth1Header(method, urlStr string, additionalParams map[string]string) (string, error)

GetOAuth1Header gets the OAuth1 header for a request

func (*Auth) GetOAuth2Header

func (a *Auth) GetOAuth2Header(username string) (string, error)

GetOAuth2Token gets or refreshes an OAuth2 token

func (*Auth) OAuth2Flow

func (a *Auth) OAuth2Flow(username string) (string, error)

OAuth2Flow starts the OAuth2 flow

func (*Auth) RefreshOAuth2Token

func (a *Auth) RefreshOAuth2Token(username string) (string, error)

RefreshOAuth2Token validates and refreshes an OAuth2 token if needed

func (*Auth) WithTokenStore

func (a *Auth) WithTokenStore(tokenStore *store.TokenStore) *Auth

WithTokenStore sets the token store for the Auth object

Jump to

Keyboard shortcuts

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