Documentation
¶
Index ¶
- type AuthenticateUseCase
- type ClientHostNameRepository
- type Deliver
- type Executor
- type ExpirationRepository
- type ExpirationUseCase
- type IDRepository
- type LogoutUseCase
- type ProxyCallBackRepository
- type TerminateUseCase
- type Ticket
- type TicketRepository
- type TicketType
- type TicketUseCase
- type ValidateUseCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticateUseCase ¶
type AuthenticateUseCase interface {
Authenticate(id, pass string) (map[string]interface{}, error)
}
AuthenticateUseCase interface for authenticate
type ClientHostNameRepository ¶
ClientHostNameRepository is an interface to find real-ip/hostname
type ExpirationRepository ¶
ExpirationRepository repository interface that find all expired items
type ExpirationUseCase ¶
type ExpirationUseCase interface {
RevokeAll() error
}
ExpirationUseCase interface for expiration check
type IDRepository ¶
type IDRepository interface {
Issue(t TicketType) string
}
IDRepository is an interface to issue an ID
type LogoutUseCase ¶
LogoutUseCase define behaviors for logout by tgt
type ProxyCallBackRepository ¶
ProxyCallBackRepository is an interface to dial proxy-callback-url
type TerminateUseCase ¶
TerminateUseCase define behaviors for terminate ticket
type Ticket ¶
type Ticket struct {
// required fields
ID string
Type TicketType
ClientHostName string
CreatedAt time.Time
// required for service-ticket, proxy-ticket, proxy-granting-ticket and ticket-granting-ticket
LastReferencedAt *time.Time
// required for service ticket
Service string
// required for service ticket
// that granted by proxy granting ticket and ticket granting ticket
GrantedBy *Ticket
// required for service or ticket granting ticket
UserName string
// required for proxy granting ticket
IOU string
// set true if this is service-ticket and primary
Primary bool
// required for ticket granting ticket, usually serialized json is set
ExtraAttributes interface{}
}
Ticket struct for ticket
type TicketRepository ¶
type TicketRepository interface {
Find(id string) (*Ticket, error)
Delete(*Ticket) error
DeleteRelatedTicket(*Ticket) error
Create(*Ticket) error
Consume(*Ticket) error
}
TicketRepository repository for ticket
type TicketType ¶
type TicketType int8
TicketType types of ticket
const ( // TicketTypeService type of service ticket TicketTypeService TicketType = iota + 1 // TicketTypeProxy type of proxy ticket TicketTypeProxy // TicketTypeTicketGranting type of ticket-granting ticket TicketTypeTicketGranting // TicketTypeProxyGranting type of proxy-granting ticket TicketTypeProxyGranting // TicketTypeProxyGrantingIOU type of proxy-granting ticket iou // TODO check is this really necessary TicketTypeProxyGrantingIOU // TicketTypeLogin type of login ticket TicketTypeLogin )
func ParseTicketType ¶
func ParseTicketType(s string) TicketType
ParseTicketType parse to ticket type from string
func (TicketType) Prefix ¶
func (t TicketType) Prefix() string
Prefix return ticket-type prefix string
type TicketUseCase ¶
type TicketUseCase interface {
Find(id string) (*Ticket, error)
NewLogin(r *http.Request) (*Ticket, error)
NewProxyGranting(r *http.Request, callbackURL *url.URL, st *Ticket) (*Ticket, error)
NewService(r *http.Request, service *url.URL, tgt *Ticket, primary bool) (*Ticket, error)
NewGranting(r *http.Request, username string, extraAttributes interface{}) (*Ticket, error)
NewProxy(r *http.Request, service string, grantedBy *Ticket) (*Ticket, error)
Consume(*Ticket) error
}
TicketUseCase define behaviors about finding and generating ticket
type ValidateUseCase ¶
type ValidateUseCase interface {
ValidateLogin(ticket *Ticket) error
ValidateGranting(ticket *Ticket) error
ValidateService(ticket *Ticket, service *url.URL, renew bool) error
ValidateProxy(ticket *Ticket, service *url.URL) error
ValidateProxyGranting(ticket *Ticket) error
}
ValidateUseCase define behaviors for validation
Directories
¶
| Path | Synopsis |
|---|---|
|
auth
|
|
|
cmd
|
|
|
cashew
command
|
|
|
cashew-isolator
command
|
|
|
deliver
|
|
|
executor
|
|
|
helpers
|
|
|
mocks
|
|
|
timer
Package timer is a generated GoMock package.
|
Package timer is a generated GoMock package. |
|
provider
|
|
|
repository
|
|
|
usecase
|
|
|
validator
|
|
|
values
|
|