evesso

package
v0.0.0-...-efc180c Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package evesso provides support for EVE's single sign-on API.

Package evesso provides support for EVE's single sign-on API.

Index

Constants

View Source
const (

	// PublicData is the only scope available at present.
	PublicData = "publicData"
)

Variables

View Source
var (
	// Endpoint is the production EVE Online cluster. (Tranquility)
	Endpoint = oauth2.Endpoint{
		AuthURL:  "https://login.eveonline.com/oauth/authorize",
		TokenURL: "https://login.eveonline.com/oauth/token",
	}

	// TestEndpoint is the public testing EVE Online cluster. (Singularity)
	TestEndpoint = oauth2.Endpoint{
		AuthURL:  "https://sisilogin.testeveonline.com/oauth/authorize",
		TokenURL: "https://sisilogin.testeveonline.com/oauth/token",
	}
)

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// URL returns the authentication URL for a given state value.
	URL(state string) string
	// Exchange converts an authorization code into an OAuth2 token.
	Exchange(code string) (*oauth2.Token, error)
	// CharacterInfo returns information on the authentication token's scopes
	// and the character that was authenticated.
	CharacterInfo(token *oauth2.Token) (*CharacterInfo, error)
	// GetClient returns an http.Client that uses the provided token to authenticate
	// and auto-refreshes as necessary.
	GetClient(token *oauth2.Token) *http.Client
}

Authenticator provides an interface to EVE's OAuth2 interface.

func MakeAuthenticator

func MakeAuthenticator(endpoint oauth2.Endpoint, clientID, clientSecret, redirectURL string, scopes ...string) Authenticator

MakeAuthenticator returns an Authenticator object for the given client and access point. The provided client configuration (secret, ID, and redirect URL) must be registered for anything to work.

Optionally, add one or more scopes to request.

type CharacterInfo

type CharacterInfo struct {
	CharacterID        int
	CharacterName      string
	Scopes             string
	TokenType          string
	CharacterOwnerHash string
}

CharacterInfo is the information returned by the CREST API about the character that authenticated.

Jump to

Keyboard shortcuts

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