tokenstore

package
v0.0.0-...-dbefbc8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MailUser

type MailUser struct {
	CharacterID      int32
	TokenCharacterID int32
	Token            *oauth2.Token
}

type MailUserRequest

type MailUserRequest struct {
	CharacterID int32
	Password    string
}

type TokenRequest

type TokenRequest struct {
	CharacterID      int32
	TokenCharacterID int32
}

type TokenServerAPI

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

func NewTokenServerAPI

func NewTokenServerAPI() (*TokenServerAPI, error)

func NewTokenServerInternalAPI

func NewTokenServerInternalAPI() (*TokenServerAPI, error)

func (*TokenServerAPI) GetMailUser

func (s *TokenServerAPI) GetMailUser(characterID int32, password string) (*MailUser, error)

func (*TokenServerAPI) GetToken

func (s *TokenServerAPI) GetToken(characterID, tokenCharacterID int32) (*oauth2.Token, error)

type TokenStore

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

TokenStore provides storage and caching of OAuth2 Tokens

func NewTokenStore

func NewTokenStore(redis *redis.Pool, db *sqlx.DB, auth *goesi.SSOAuthenticator) *TokenStore

NewTokenStore provides mechinism for caching and storing SSO Tokens If a refresh token changes, do remember to invalidate the cache

func (*TokenStore) CheckSSOError

func (c *TokenStore) CheckSSOError(characterID int32, tokenCharacterID int32, in error) bool

CheckSSOError determines if the error was an oauth2 error, and updates the character in the database

func (*TokenStore) GetToken

func (c *TokenStore) GetToken(characterID int32, tokenCharacterID int32) (*oauth2.Token, error)

GetTokenSource retreives a token from storage and returns a token

func (*TokenStore) GetTokenSource

func (c *TokenStore) GetTokenSource(characterID int32, tokenCharacterID int32) (oauth2.TokenSource, error)

GetTokenSource retreives a token from storage and returns a token source

func (*TokenStore) SetToken

func (c *TokenStore) SetToken(characterID int32, tokenCharacterID int32, token *oauth2.Token) error

SetToken a token to storage

Jump to

Keyboard shortcuts

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