Documentation
¶
Index ¶
- type AuthServer
- func (as *AuthServer) Authenticate(ar *authRequest) (bool, authn.Labels, error)
- func (as *AuthServer) Authorize(ar *authRequest) ([]authzResult, error)
- func (as *AuthServer) CreateToken(ar *authRequest, ares []authzResult) (string, error)
- func (as *AuthServer) ParseRequest(req *http.Request) (*authRequest, error)
- func (as *AuthServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (as *AuthServer) Stop()
- type Config
- type LetsEncryptConfig
- type ServerConfig
- type TokenConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthServer ¶
type AuthServer struct {
// contains filtered or unexported fields
}
func NewAuthServer ¶
func NewAuthServer(c *Config) (*AuthServer, error)
func (*AuthServer) Authenticate ¶
func (as *AuthServer) Authenticate(ar *authRequest) (bool, authn.Labels, error)
func (*AuthServer) Authorize ¶
func (as *AuthServer) Authorize(ar *authRequest) ([]authzResult, error)
func (*AuthServer) CreateToken ¶
func (as *AuthServer) CreateToken(ar *authRequest, ares []authzResult) (string, error)
https://github.com/docker/distribution/blob/master/docs/spec/auth/token.md#example
func (*AuthServer) ParseRequest ¶
func (as *AuthServer) ParseRequest(req *http.Request) (*authRequest, error)
func (*AuthServer) ServeHTTP ¶
func (as *AuthServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*AuthServer) Stop ¶
func (as *AuthServer) Stop()
type Config ¶
type Config struct {
Server ServerConfig `yaml:"server"`
Token TokenConfig `yaml:"token"`
Users map[string]*authn.Requirements `yaml:"users,omitempty"`
GoogleAuth *authn.GoogleAuthConfig `yaml:"google_auth,omitempty"`
GitHubAuth *authn.GitHubAuthConfig `yaml:"github_auth,omitempty"`
LDAPAuth *authn.LDAPAuthConfig `yaml:"ldap_auth,omitempty"`
MongoAuth *authn.MongoAuthConfig `yaml:"mongo_auth,omitempty"`
ExtAuth *authn.ExtAuthConfig `yaml:"ext_auth,omitempty"`
ACL authz.ACL `yaml:"acl,omitempty"`
ACLMongo *authz.ACLMongoConfig `yaml:"acl_mongo,omitempty"`
ExtAuthz *authz.ExtAuthzConfig `yaml:"ext_authz,omitempty"`
}
func LoadConfig ¶
type LetsEncryptConfig ¶
type ServerConfig ¶
type ServerConfig struct {
ListenAddress string `yaml:"addr,omitempty"`
PathPrefix string `yaml:"path_prefix,omitempty"`
RealIPHeader string `yaml:"real_ip_header,omitempty"`
RealIPPos int `yaml:"real_ip_pos,omitempty"`
CertFile string `yaml:"certificate,omitempty"`
KeyFile string `yaml:"key,omitempty"`
LetsEncrypt LetsEncryptConfig `yaml:"letsencrypt,omitempty"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.