Documentation ¶
Index ¶
- type ACLEntry
- type AuthRequest
- type AuthServer
- func (as *AuthServer) Authenticate(ar *AuthRequest) error
- func (as *AuthServer) Authorize(ar *AuthRequest) (bool, error)
- func (as *AuthServer) CreateToken(ar *AuthRequest) (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 MatchConditions
- type ServerConfig
- type TokenConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLEntry ¶
type ACLEntry struct { Match *MatchConditions `yaml:"match"` Actions *[]string `yaml:"actions,flow"` }
func (*ACLEntry) Check ¶
func (e *ACLEntry) Check(rq *AuthRequest) error
func (*ACLEntry) Matches ¶
func (e *ACLEntry) Matches(rq *AuthRequest) bool
type AuthRequest ¶
type AuthRequest struct { RemoteAddr string User string Password authn.PasswordString Account string Type string Name string Service string Actions []string }
func (AuthRequest) String ¶
func (ar AuthRequest) String() string
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) error
func (*AuthServer) Authorize ¶
func (as *AuthServer) Authorize(ar *AuthRequest) (bool, error)
func (*AuthServer) CreateToken ¶
func (as *AuthServer) CreateToken(ar *AuthRequest) (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"` Ldap *authn.LdapAuthConfig `yaml:"ldap,omitempty"` ACL []*ACLEntry `yaml:"acl"` }
func LoadConfig ¶
type MatchConditions ¶
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.