server

package
v0.0.0-...-c932893 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: GPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(s *Server, handler func(s *Server, w ldap.ResponseWriter, r *ldap.Message)) func(w ldap.ResponseWriter, r *ldap.Message)

Types

type InvalidCredentials

type InvalidCredentials struct {
	// contains filtered or unexported fields
}

func (InvalidCredentials) Error

func (i InvalidCredentials) Error() string

type LDAPAction

type LDAPAction int
const (
	AddOps LDAPAction = iota
	ModifyOps
	ModRDNOps
	DeleteOps
	SearchOps
)

func (LDAPAction) String

func (c LDAPAction) String() string

type LDAPPassThroughClient

type LDAPPassThroughClient struct {
	Server     string
	SearchBase string
	Timeout    int
	Filter     string
	BindDN     string
	Password   string
	Scope      string
}

func (*LDAPPassThroughClient) Authenticate

func (c *LDAPPassThroughClient) Authenticate(ctx context.Context, domain, user, password string) (bool, error)

type PassThroughClient

type PassThroughClient interface {
	Authenticate(ctx context.Context, domain, user, password string) (bool, error)
}

type PassThroughConfig

type PassThroughConfig map[string]PassThroughClient

func (PassThroughConfig) Add

func (p PassThroughConfig) Add(domain string, client PassThroughClient)

func (PassThroughConfig) Get

func (PassThroughConfig) Has

func (p PassThroughConfig) Has(domain string) bool

type Server

type Server struct {
	Suffix *schema.DN
	// contains filtered or unexported fields
}

func NewServer

func NewServer(c *ServerConfig) *Server

func (*Server) Config

func (s *Server) Config() *ServerConfig

func (*Server) DCRDN

func (s *Server) DCRDN() string

func (*Server) GetRootDN

func (s *Server) GetRootDN() *schema.DN

func (*Server) GetRootPW

func (s *Server) GetRootPW() string

func (*Server) GetSuffix

func (s *Server) GetSuffix() string

func (*Server) LoadSchema

func (s *Server) LoadSchema()

func (*Server) NormalizeDN

func (s *Server) NormalizeDN(dn string) (*schema.DN, error)

func (*Server) RefreshCache

func (s *Server) RefreshCache(ctx context.Context) error

func (*Server) Repo

func (s *Server) Repo() repo.Repository

func (*Server) RequiredAuthz

func (s *Server) RequiredAuthz(m *ldap.Message, ops LDAPAction, targetDN *schema.DN) bool

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) SuffixNorm

func (s *Server) SuffixNorm() []string

func (*Server) SuffixOrig

func (s *Server) SuffixOrig() []string

func (*Server) SuffixOrigStr

func (s *Server) SuffixOrigStr() string

type ServerConfig

type ServerConfig struct {
	*repo.DBRepositoryConfig
	*schema.SchemaConfig
	RootPW            string
	PassThroughConfig *PassThroughConfig
	BindAddress       string
	LogLevel          string
	PProfServer       string
	GoMaxProcs        int
	SimpleACL         []string
}

type SimpleACL

type SimpleACL struct {
	// contains filtered or unexported fields
}

func NewSimpleACL

func NewSimpleACL(server *Server) (*SimpleACL, error)

func (*SimpleACL) CanRead

func (s *SimpleACL) CanRead(session *auth.AuthSession) bool

func (*SimpleACL) CanVisible

func (s *SimpleACL) CanVisible(session *auth.AuthSession, attrName string) bool

func (*SimpleACL) CanWrite

func (s *SimpleACL) CanWrite(session *auth.AuthSession) bool

type SimpleACLDef

type SimpleACLDef struct {
	Scope               SimpleACLScopeSet
	InvisibleAttributes util.StringSet
}

type SimpleACLScope

type SimpleACLScope int
const (
	ReadScope SimpleACLScope = iota
	WriteScope
)

func (SimpleACLScope) String

func (c SimpleACLScope) String() string

type SimpleACLScopeSet

type SimpleACLScopeSet map[SimpleACLScope]struct{}

func (SimpleACLScopeSet) Add

func (s SimpleACLScopeSet) Add(scope SimpleACLScope)

func (SimpleACLScopeSet) Contains

func (s SimpleACLScopeSet) Contains(scope SimpleACLScope) bool

Jump to

Keyboard shortcuts

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