saml

package
v0.0.0-...-9f1a7a8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestIdNotFound = &tsuruErrors.ValidationError{Message: "Field attribute InResponseTo not found in saml response data"}
	ErrCheckSignature    = &tsuruErrors.ValidationError{Message: "SAMLResponse signature validation"}
)
View Source
var (
	ErrMissingRequestIdError        = &tsuruErrors.ValidationError{Message: "You must provide RequestID to login"}
	ErrMissingFormValueError        = &tsuruErrors.ValidationError{Message: "SAMLResponse form value missing"}
	ErrParseResponseError           = &tsuruErrors.ValidationError{Message: "SAMLResponse parse error"}
	ErrEmptyIDPResponseError        = &tsuruErrors.ValidationError{Message: "SAMLResponse form value missing"}
	ErrRequestWaitingForCredentials = &tsuruErrors.ValidationError{Message: "Waiting credentials from IDP"}
)
View Source
var (
	ErrRequestNotFound = &errors.ValidationError{Message: "request not found or expired"}
)

Functions

func Metadata

func Metadata() (string, error)

Types

type AuthnRequestData

type AuthnRequestData struct {
	Base64AuthRequest string
	URL               string
	ID                string
}

type BaseConfig

type BaseConfig struct {
	EntityID              string
	DisplayName           string
	Description           string
	PublicCert            string
	PrivateKey            string
	IdpURL                string
	IdpPublicCert         string
	SignRequest           bool
	SignedResponse        bool
	DeflatEncodedResponse bool
}

type SAMLAuthParser

type SAMLAuthParser interface {
	Parse(infoResponse string) (*saml.Response, error)
}

type SAMLAuthScheme

type SAMLAuthScheme struct {
	BaseConfig BaseConfig
	Parser     SAMLAuthParser
}

func (*SAMLAuthScheme) AppLogin

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

func (SAMLAuthScheme) AppLogout

func (s SAMLAuthScheme) AppLogout(token string) error

func (*SAMLAuthScheme) Auth

func (s *SAMLAuthScheme) Auth(token string) (auth.Token, error)

func (*SAMLAuthScheme) Create

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

func (*SAMLAuthScheme) Info

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

func (*SAMLAuthScheme) Login

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

func (*SAMLAuthScheme) Logout

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

func (*SAMLAuthScheme) Name

func (s *SAMLAuthScheme) Name() string

func (*SAMLAuthScheme) Parse

func (s *SAMLAuthScheme) Parse(xml string) (*saml.Response, error)

func (*SAMLAuthScheme) Remove

func (s *SAMLAuthScheme) Remove(u *auth.User) error

type Token

type Token struct {
	Token     string        `json:"token"`
	Creation  time.Time     `json:"creation"`
	Expires   time.Duration `json:"expires"`
	UserEmail string        `json:"email"`
	AppName   string        `json:"app"`
}

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) Permissions

func (t *Token) Permissions() ([]permission.Permission, error)

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