auth

package
v0.0.0-...-a2be96e Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeState

func DecodeState(state string, v interface{}) error

func EncodeState

func EncodeState(v interface{}) (string, error)

Types

type Config

type Config struct {
	Provider string
	Client   string
	Secret   string
}

type Service

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

func NewService

func NewService(cfg Config, tokens *TokenService) (*Service, error)

func (*Service) ExchangeCode

func (a *Service) ExchangeCode(ctx context.Context, code, state string) (string, error)

func (*Service) GetLoginURL

func (a *Service) GetLoginURL(ctx context.Context, redirect string) (string, error)

type State

type State struct {
	Redirect string `json:"redirect"`
}

type TokenService

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

func (*TokenService) AuthenticateUser

func (s *TokenService) AuthenticateUser(ctx context.Context, token string) (domain.UserID, error)

func (*TokenService) NewPersonalToken

func (s *TokenService) NewPersonalToken(ctx context.Context, userID domain.UserID) (string, error)

func (*TokenService) NewToken

func (s *TokenService) NewToken(ctx context.Context, userID domain.UserID) (string, error)

func (*TokenService) RevokePersonalToken

func (s *TokenService) RevokePersonalToken(ctx context.Context, userID domain.UserID) error

func (*TokenService) RevokeToken

func (s *TokenService) RevokeToken(ctx context.Context, token string) error

func (*TokenService) RevokeUserTokens

func (s *TokenService) RevokeUserTokens(ctx context.Context, userID domain.UserID) error

Jump to

Keyboard shortcuts

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