server

package
v0.0.0-...-c885542 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: Apache-2.0 Imports: 19 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, 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"`
}

func LoadConfig

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

type ServerConfig

type ServerConfig struct {
	ListenAddress string `yaml:"addr,omitempty"`
	RealIPHeader  string `yaml:"real_ip_header,omitempty"`
	CertFile      string `yaml:"certificate,omitempty"`
	KeyFile       string `yaml:"key,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