passport

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Client *passportsdk.Client
	// contains filtered or unexported fields
}

Provider implements the Provider interface

func New

func New(creds authsdk.Credentials, cookieName string, logger *log.Logger) *Provider

New returns a new passport provider

func (Provider) Endpoints

func (p Provider) Endpoints() *authsdk.Endpoints

Endpoints returns the provider endpoints

func (Provider) Name

func (p Provider) Name() string

Name returns the name of provider

func (Provider) Options

func (p Provider) Options() *authsdk.Options

Options returns the provider options

func (Provider) Session

func (p Provider) Session(req *http.Request) (authsdk.Session, error)

Session returns a Session

func (*Provider) SetEndpoints

func (p *Provider) SetEndpoints(endpoints *authsdk.Endpoints)

SetEndpoints sets the provider endpoints

func (*Provider) SetOptions

func (p *Provider) SetOptions(options *authsdk.Options)

SetOptions sets the provider options

type Session

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

Session implements the Session interface

func NewSession

func NewSession(user auth.User) *Session

NewSession returns a new Session

func (Session) IsAllowed

func (s Session) IsAllowed(action string) bool

IsAllowed returns whether user can perform an action

func (Session) User

func (s Session) User() *auth.User

User returns the user info

Jump to

Keyboard shortcuts

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