auth

package
v0.0.0-...-ed7ff26 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidProvider = errors.New("invalid provider")
)

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	OAuth2   *oauth2.Config
	Provider string
	ADHBase  string
	Rostered bool
	Store    sessions.Store
}

func NewAuthService

func NewAuthService(store sessions.Store, oauth2provider string) *AuthService

func (*AuthService) GetUserInfo

func (s *AuthService) GetUserInfo(token *oauth2.Token) (string, bool, error)

Queries the userinfo endpoint with the provided oauth2 token. Will return the CID if available, whether or not the user is ok to use the system, and any errors that may have occurred.

The criteria to determine if a user can use the system is: - Are they a VATSIM member? - If facility.adh.base_api is set and the facility.adh.rostered bool in config is true, are they rostered?

func (*AuthService) Session

type AuthServiceSessions

type AuthServiceSessions struct {
	Session *sessions.Session
	// contains filtered or unexported fields
}

func (*AuthServiceSessions) Delete

func (s *AuthServiceSessions) Delete(key string)

func (*AuthServiceSessions) Get

func (s *AuthServiceSessions) Get(key string) interface{}

func (*AuthServiceSessions) Save

func (s *AuthServiceSessions) Save()

func (*AuthServiceSessions) Set

func (s *AuthServiceSessions) Set(key string, value interface{})

Jump to

Keyboard shortcuts

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