util

package
v0.0.0-...-07b82e6 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPersistence

func GetPersistence(c string) *mgo.Collection

func GetRemoteAddr

func GetRemoteAddr(raddr string) string

func IncrementFailedLogin

func IncrementFailedLogin(ip string, u string)

func NewCASFailureResponse

func NewCASFailureResponse(c string, msg string) []byte

func NewCASProxyFailureResponse

func NewCASProxyFailureResponse(c string, msg string) []byte

func NewCASProxySuccessResponse

func NewCASProxySuccessResponse(pt string) []byte

func NewCASSuccessResponse

func NewCASSuccessResponse(u string, pgtiou string) []byte

func ResolveTemplate

func ResolveTemplate(tmpl string) string

func Url

func Url(path string) string

Types

type CASAuthenticationFailure

type CASAuthenticationFailure struct {
	XMLName xml.Name `xml:"cas:authenticationFailure"`
	Code    string   `xml:"code,attr"`
	Message string   `xml:",chardata"`
}

type CASAuthenticationSuccess

type CASAuthenticationSuccess struct {
	XMLName xml.Name `xml:"cas:authenticationSuccess"`
	User    CASUser
	PgtIou  CASPgtIou `xml:",omitempty"`
}

type CASPgtIou

type CASPgtIou struct {
	XMLName xml.Name `xml:"cas:proxyGrantingTicket"`
	Ticket  string   `xml:",chardata"`
}

type CASProxyFailure

type CASProxyFailure struct {
	XMLName xml.Name `xml:"cas:proxyFailure"`
	Code    string   `xml:"string"`
	Message string   `xml:",chardata"`
}

type CASProxySuccess

type CASProxySuccess struct {
	XMLName xml.Name `xml:"cas:proxyTicket"`
	Ticket  string   `xml:",chardata"`
}

type CASServiceResponse

type CASServiceResponse struct {
	XMLName      xml.Name `xml:"cas:serviceResponse"`
	Xmlns        string   `xml:"xmlns:cas,attr"`
	Success      *CASAuthenticationSuccess
	Failure      *CASAuthenticationFailure
	ProxySuccess *CASProxySuccess
	ProxyFailure *CASProxyFailure
}

func NewCASResponse

func NewCASResponse() CASServiceResponse

type CASUser

type CASUser struct {
	XMLName xml.Name `xml:"cas:user"`
	User    string   `xml:",chardata"`
}

type FailedLogin

type FailedLogin struct {
	Id        string    `bson:"_id"`
	Ip        string    `bson:"ip,omitempty"`
	Username  string    `bson:"username,omitempty"`
	Count     uint      `bson:"count"`
	UpdatedAt time.Time `bson:"updated_at"`
}

type LoginRequestorData

type LoginRequestorData struct {
	Config   *config.Config
	Session  LoginRequestorSession
	Message  LoginRequestorMessage
	ShowForm bool
}

type LoginRequestorMessage

type LoginRequestorMessage struct {
	Type    string
	Message string
}

type LoginRequestorSession

type LoginRequestorSession struct {
	Ticket   string
	Service  string
	Url      string
	Username string
}

Jump to

Keyboard shortcuts

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