auth

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 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 API

type API interface {
	// contains filtered or unexported methods
}

type Service

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

func New

func New(
	env skillz.Environment,
	client *http.Client,
	cache cache.AuthAPI,
	esiOAuth *oauth2.Config,
) *Service

func (*Service) AuthAttempt

func (s *Service) AuthAttempt(ctx context.Context, state string) (*skillz.AuthAttempt, error)

func (*Service) AuthorizationURI

func (s *Service) AuthorizationURI(ctx context.Context, state string, scopes []string) string

func (*Service) BearerForESICode

func (s *Service) BearerForESICode(ctx context.Context, code string) (*oauth2.Token, error)

func (*Service) DeleteAuthAttempt

func (s *Service) DeleteAuthAttempt(ctx context.Context, attempt *skillz.AuthAttempt) error

func (*Service) InitializeAttempt

func (s *Service) InitializeAttempt(ctx context.Context) (*skillz.AuthAttempt, error)

func (*Service) ParseAndVerifyESIToken

func (s *Service) ParseAndVerifyESIToken(ctx context.Context, t string) (jwt.Token, error)

func (*Service) ValidateESITokenForUser

func (s *Service) ValidateESITokenForUser(ctx context.Context, user *skillz.User) (bool, *oauth2.Token, error)

ValidateESITokenForUser takes a user token and, if expired, refreshed it.

Jump to

Keyboard shortcuts

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