account

package
v0.0.0-...-080ad10 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AccountType = "xbox"

Variables

View Source
var ErrNilAccount = errors.New("account is nil")

Functions

func RandomKey

func RandomKey() (key []byte, err error)

RandomKey returns a new byte slice of random bytes to use as a key for Xbox account.

func WriteAuthData

func WriteAuthData(account *accounts.Account, data AuthData, key []byte) error

func WriteProperties

func WriteProperties(account *accounts.Account, properties Properties) error

Types

type AuthData

type AuthData struct {
	MsftAccessToken          string    `json:"msftAccessToken"`               // Microsoft access token used to access Xbox services.
	MsftRefreshToken         string    `json:"msftRefreshToken"`              // Microsoft refresh token used to refresh access token after it has expired.
	MsftAccessTokenExpiresAt time.Time `json:"msftAccessTokenExpiresAt"`      // Time after which Microsoft token should be considered expired.
	XBLToken                 string    `json:"xblToken"`                      // Xbox Live token.
	UserHash                 string    `json:"userHash"`                      // Xbox Live user hash.
	XSTSToken                string    `json:"xstsToken"`                     // Xbox Live Token Service token.
	MinecraftToken           string    `json:"minecraftToken"`                // Minecraft token used to call Minecraft APIs and to log in into the game.
	MinecraftTokenExpiresAt  time.Time `json:"minecraftAccessTokenExpiresAt"` // Time after which Minecraft token should be considered expired.
}

AuthData stores the authentication data for Xbox Minecraft account.

func ReadAuthData

func ReadAuthData(account accounts.Account, key []byte) (data AuthData, err error)

type Properties

type Properties struct {
	KID string `mapstructure:"xbox:kid"` // Key identifier in the keyring.
}

func ReadProperties

func ReadProperties(account *accounts.Account) (properties Properties, err error)

Jump to

Keyboard shortcuts

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