xsapi

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 2 Imported by: 5

README

go-xsapi

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DisplayClaims

type DisplayClaims struct {
	GamerTag string `json:"gtg"`
	XUID     string `json:"xid"`
	UserHash string `json:"uhs"`
}

DisplayClaims contains an information for user of Token.

type Token

type Token interface {
	// SetAuthHeader sets an 'Authorization' and a 'Signature' header in the request.
	SetAuthHeader(req *http.Request)
	// String formats the Token into a string that can be set as an 'Authorization' header
	// or a field in requests. It usually follows the format 'XBL3.0 x=<user hash>;<token>'.
	String() string
	// DisplayClaims returns the DisplayClaims, which contains an information for a user.
	// It is usually claimed from the response body returned from the authorization.
	DisplayClaims() DisplayClaims
}

type TokenSource

type TokenSource interface {
	Token() (Token, error)
}

TokenSource implements a Token method that returns a Token.

type Transport

type Transport struct {
	Source TokenSource

	Base http.RoundTripper
}

Transport is an http.RoundTripper that makes authenticated Xbox Live requests, wrapping a base RoundTripper and adding an 'Authorization' header and a 'Signature' header with a token from the supplied Sources.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip authorizes and authenticates the request using the [Token.SetAuthHeader] from Source of the Transport.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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