server

package
v0.0.0-...-dd8ea4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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

func LoadConfig(fileName string) (*Config, error)

type LetsEncryptConfig

type LetsEncryptConfig struct {
	Host     string `yaml:"host,omitempty"`
	Email    string `yaml:"email,omitempty"`
	CacheDir string `yaml:"cache_dir,omitempty"`
}

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
}

type TokenConfig

type TokenConfig struct {
	Issuer     string `yaml:"issuer,omitempty"`
	CertFile   string `yaml:"certificate,omitempty"`
	KeyFile    string `yaml:"key,omitempty"`
	Expiration int64  `yaml:"expiration,omitempty"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL