server

package
v0.0.0-...-76185f6 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2015 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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

func (ACLEntry) String

func (e ACLEntry) String() string

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) 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

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

type MatchConditions

type MatchConditions struct {
	Account *string `yaml:"account,omitempty" json:"account,omitempty"`
	Type    *string `yaml:"type,omitempty" json:"type,omitempty"`
	Name    *string `yaml:"name,omitempty" json:"name,omitempty"`
}

type ServerConfig

type ServerConfig struct {
	ListenAddress string `yaml:"addr,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