oauth

package
v0.0.0-...-5650998 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2014 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingCodeError       = &tsuruErrors.ValidationError{Message: "You must provide code to login"}
	ErrMissingCodeRedirectUrl = &tsuruErrors.ValidationError{Message: "You must provide the used redirect url to login"}
	ErrEmptyAccessToken       = &tsuruErrors.NotAuthorizedError{Message: "Couldn't convert code to access token."}
	ErrEmptyUserEmail         = &tsuruErrors.NotAuthorizedError{Message: "Couldn't parse user email."}
)

Functions

This section is empty.

Types

type DBTokenCache

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

func (*DBTokenCache) PutToken

func (c *DBTokenCache) PutToken(t *goauth2.Token) error

func (*DBTokenCache) Token

func (c *DBTokenCache) Token() (*goauth2.Token, error)

type OAuthParser

type OAuthParser interface {
	Parse(infoResponse *http.Response) (string, error)
}

type OAuthScheme

type OAuthScheme struct {
	BaseConfig   goauth2.Config
	InfoUrl      string
	CallbackPort int
	Parser       OAuthParser
}

func (*OAuthScheme) AppLogin

func (s *OAuthScheme) AppLogin(appName string) (auth.Token, error)

func (*OAuthScheme) Auth

func (s *OAuthScheme) Auth(header string) (auth.Token, error)

func (*OAuthScheme) Create

func (s *OAuthScheme) Create(user *auth.User) (*auth.User, error)

func (*OAuthScheme) Info

func (s *OAuthScheme) Info() (auth.SchemeInfo, error)

func (*OAuthScheme) Login

func (s *OAuthScheme) Login(params map[string]string) (auth.Token, error)

func (*OAuthScheme) Logout

func (s *OAuthScheme) Logout(token string) error

func (*OAuthScheme) Name

func (s *OAuthScheme) Name() string

func (*OAuthScheme) Parse

func (s *OAuthScheme) Parse(infoResponse *http.Response) (string, error)

func (*OAuthScheme) Remove

func (s *OAuthScheme) Remove(token auth.Token) error

type Token

type Token struct {
	goauth2.Token
	UserEmail string `json:"email"`
}

func (*Token) GetAppName

func (t *Token) GetAppName() string

func (*Token) GetUserName

func (t *Token) GetUserName() string

func (*Token) GetValue

func (t *Token) GetValue() string

func (*Token) IsAppToken

func (t *Token) IsAppToken() bool

func (*Token) User

func (t *Token) User() (*auth.User, error)

Jump to

Keyboard shortcuts

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