Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Credential ¶
type Credential interface { // AddAuthorization adds authorization information to request AddAuthorization(req *http.Request) }
Credential ...
func NewBasicAuthCredential ¶
func NewBasicAuthCredential(username, password string) Credential
NewBasicAuthCredential ...
type Handler ¶
type Handler interface { // Scheme : basic, bearer Scheme() string //AuthorizeRequest adds basic auth or token auth to the header of request AuthorizeRequest(req *http.Request, params map[string]string) error }
Handler authorizes requests according to the schema
func NewStandardTokenHandler ¶
func NewStandardTokenHandler(credential Credential, scopeType, scopeName string, scopeActions ...string) Handler
NewStandardTokenHandler returns a standard token handler. The handler will request a token from token server and add it to the origin request TODO deal with https
type RequestAuthorizer ¶
type RequestAuthorizer struct {
// contains filtered or unexported fields
}
RequestAuthorizer holds a handler list, which will authorize request. Implements interface RequestModifier
func NewRequestAuthorizer ¶
func NewRequestAuthorizer(handlers []Handler, challenges []au.Challenge) *RequestAuthorizer
NewRequestAuthorizer ...
func (*RequestAuthorizer) ModifyRequest ¶
func (r *RequestAuthorizer) ModifyRequest(req *http.Request) error
ModifyRequest adds authorization to the request
Click to show internal directories.
Click to hide internal directories.