sso

package
v0.0.0-...-c12edbd Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(sso *SSO) func(http.Handler) http.Handler

New creates a sso middleware.

Types

type APIMessage

type APIMessage struct {
	User User `json:"user"`
}

type SSO

type SSO struct {
	UpstreamURL   *url.URL
	APIURL        *url.URL
	AppPublicURL  *url.URL
	StaticPath    string
	TemplatePath  string
	EncryptionKey []byte
	CSRFAuthKey   []byte
	Authorized    func(User) (bool, error)
	// contains filtered or unexported fields
}

func (*SSO) ServeHTTP

func (sso *SSO) ServeHTTP(w http.ResponseWriter, req *http.Request)

type State

type State struct {
	User  User   `json:"user"`
	Token string `json:"token"`
}

type User

type User struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	Login         string `json:"login"`
	Email         string `json:"email"`
	GravatarID    string `json:"gravatar_id"`
	IsSyncing     bool   `json:"is_syncing"`
	SyncedAt      string `json:"synced_at"`
	CorrectScopes bool   `json:"correct_scopes"`
	CreatedAt     string `json:"created_at"`
}

Jump to

Keyboard shortcuts

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