go-vitess.v1: gopkg.in/src-d/go-vitess.v1/mysql/ldapauthserver Index | Files

package ldapauthserver

import "gopkg.in/src-d/go-vitess.v1/mysql/ldapauthserver"

Index

Package Files

auth_server_ldap.go

func Init Uses

func Init()

Init is public so it can be called from plugin_auth_ldap.go (go/cmd/vtgate)

type AuthServerLdap Uses

type AuthServerLdap struct {
    Client
    ServerConfig
    Method         string
    User           string
    Password       string
    GroupQuery     string
    UserDnPattern  string
    RefreshSeconds int64
}

AuthServerLdap implements AuthServer with an LDAP backend

func (*AuthServerLdap) AuthMethod Uses

func (asl *AuthServerLdap) AuthMethod(user string) (string, error)

AuthMethod is part of the AuthServer interface.

func (*AuthServerLdap) Negotiate Uses

func (asl *AuthServerLdap) Negotiate(c *mysql.Conn, user string, remoteAddr net.Addr) (mysql.Getter, error)

Negotiate is part of the AuthServer interface.

func (*AuthServerLdap) Salt Uses

func (asl *AuthServerLdap) Salt() ([]byte, error)

Salt will be unused in AuthServerLdap.

func (*AuthServerLdap) ValidateHash Uses

func (asl *AuthServerLdap) ValidateHash(salt []byte, user string, authResponse []byte, remoteAddr net.Addr) (mysql.Getter, error)

ValidateHash is unimplemented for AuthServerLdap.

type Client Uses

type Client interface {
    Connect(network string, config *ServerConfig) error
    Close()
    Bind(string, string) error
    Search(*ldap.SearchRequest) (*ldap.SearchResult, error)
}

Client provides an interface we can mock

type ClientImpl Uses

type ClientImpl struct {
    *ldap.Conn
}

ClientImpl is the real implementation of LdapClient

func (*ClientImpl) Connect Uses

func (lci *ClientImpl) Connect(network string, config *ServerConfig) error

Connect calls ldap.Dial and then upgrades the connection to TLS This must be called before any other methods

type LdapUserData Uses

type LdapUserData struct {
    sync.Mutex
    // contains filtered or unexported fields
}

LdapUserData holds username and LDAP groups as well as enough data to intelligently update itself.

func (*LdapUserData) Get Uses

func (lud *LdapUserData) Get() *querypb.VTGateCallerID

Get returns wrapped username and LDAP groups and possibly updates the cache

type ServerConfig Uses

type ServerConfig struct {
    LdapServer string
    LdapCert   string
    LdapKey    string
    LdapCA     string
}

ServerConfig holds the config for and LDAP server * include port in ldapServer, "ldap.example.com:386"

Package ldapauthserver imports 13 packages (graph). Updated 2019-06-13. Refresh now. Tools for package owners.