Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authorizer ¶
type Authorizer interface { // Scheme : basic, bearer Scheme() string //Authorize adds basic auth or token auth to the header of request Authorize(req *http.Request, params map[string]string) error }
Authorizer authorizes requests according to the schema
func NewStandardTokenAuthorizer ¶
func NewStandardTokenAuthorizer(credential Credential, insecure bool, scopeType, scopeName string, scopeActions ...string) Authorizer
NewStandardTokenAuthorizer returns a standard token authorizer. The authorizer will request a token from token server and add it to the origin request
func NewUsernameTokenAuthorizer ¶
func NewUsernameTokenAuthorizer(username string, scopeType, scopeName string, scopeActions ...string) Authorizer
NewUsernameTokenAuthorizer returns a authorizer which will generate a token according to the user's privileges
type AuthorizerStore ¶
type AuthorizerStore struct {
// contains filtered or unexported fields
}
AuthorizerStore holds a authorizer list, which will authorize request. And it implements interface Modifier
func NewAuthorizerStore ¶
func NewAuthorizerStore(endpoint string, insecure bool, authorizers ...Authorizer) (*AuthorizerStore, error)
NewAuthorizerStore ...
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 ...
func NewCookieCredential ¶
func NewCookieCredential(c *http.Cookie) Credential
NewCookieCredential initialize a cookie based crendential handler, the cookie in parameter will be added to request to registry if this crendential is attached to a registry client.