Documentation ¶
Index ¶
Constants ¶
View Source
const ( ValueLength = 128 MaxValueLength = 139 MinValueLength = 32 )
Variables ¶
View Source
var CasErrorCodes = [...]string{
"INVALID_REQUEST",
"INVALID_TICKET_SPEC",
"INVALID_TICKET",
"INVALID_SERVICE",
"INVALID_USERNAME",
"INTERNAL_ERROR",
"UNAUTHORIZED_SERVICE_PROXY",
"INVALID_PROXY_CALLBACK",
}
CasErrorCodes contains all error codes in string format
Functions ¶
This section is empty.
Types ¶
type CasError ¶
type CasError struct { InnerError error Code CasErrorCode }
CasError contains CAS error information
func NewCasError ¶
func NewCasError(message string, code CasErrorCode) *CasError
func ValidateService ¶
func ValidateTicket ¶
type CasErrorCode ¶
type CasErrorCode int
CasErrorCode type declaration
const ( // ERROR_CODE_INVALID_REQUEST "not all of the required request parameters were present" ERROR_CODE_INVALID_REQUEST CasErrorCode = 1 + iota // ERROR_CODE_INVALID_TICKET_SPEC "failure to meet the requirements of validation specification" ERROR_CODE_INVALID_TICKET_SPEC // ERROR_CODE_INVALID_TICKET "the ticket provided was not valid, or the ticket did not come from an initial login and renew was set on validation." ERROR_CODE_INVALID_TICKET // INVALID_SERVICE "the ticket provided was valid, but the service specified did not match the service associated with the ticket." ERROR_CODE_INVALID_SERVICE // INVALID_USERNAME "the uid (username) was invalid or removed" ERROR_CODE_INVALID_USERNAME // ERROR_CODE_INTERNAL_ERROR "an internal error occurred during ticket validation" ERROR_CODE_INTERNAL_ERROR // ERROR_CODE_UNAUTHORIZED_SERVICE_PROXY "the service is not authorized to perform proxy authentication" ERROR_CODE_UNAUTHORIZED_SERVICE_PROXY // ERROR_CODE_INVALID_PROXY_CALLBACK "The proxy callback specified is invalid. The credentials specified for proxy authentication do not meet the security requirements" ERROR_CODE_INVALID_PROXY_CALLBACK )
func (CasErrorCode) String ¶
func (casErrorCode CasErrorCode) String() string
type MemoryStore ¶ added in v0.8.12
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is memory based Storage
func NewInMemory ¶ added in v0.8.12
func NewInMemory() *MemoryStore
NewMemoryStore returns new instance of MemoryStore
func (*MemoryStore) DeleteTicket ¶ added in v0.8.12
func (s *MemoryStore) DeleteTicket(ticket string)
DeleteTicket deletes given ticket
func (*MemoryStore) GetTicket ¶ added in v0.8.12
func (s *MemoryStore) GetTicket(ticket string) *Ticket
DoesTicketExist checks if given ticket exists
func (*MemoryStore) SaveTicket ¶ added in v0.8.12
func (s *MemoryStore) SaveTicket(ticket *Ticket)
SaveTicket stores the Ticket
type Ticket ¶
type Ticket struct { Id int `db:"id,pk" json:"id" form:"id"` // seriel in database Class string `db:"type" json:"type"` // ticket type: ST, PGT, PT, ... Value string `db:"value" json:"value"` // ticket id: (ST-|PGT-|PT-) UID string `db:"uid" json:"uid"` // uid in staff Service string `db:"service" json:"service"` // is an URL CreatedAt time.Time `db:"created" json:"created"` Renew bool }
Click to show internal directories.
Click to hide internal directories.