auth

package
v0.0.0-...-d271c08 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2014 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CRAMMD5MaxRequests = 2

CRAMMD5MaxRequests is the maximum number of requests that an unauthenticated client is allowed to make (this should be enough to perform authentication).

Variables

View Source
var (
	AuthenticationServer        = rpc.NewServer()
	DefaultAuthenticatorCRAMMD5 = NewAuthenticatorCRAMMD5()
)
View Source
var AuthenticationFailed = errors.New("authentication error: authentication failed")

AuthenticationFailed is returned when the client fails to authenticate.

Functions

func Authenticate

func Authenticate(c rpc.ServerCodec, context *proto.Context) (bool, error)

Authenticate returns true if it the client manages to authenticate the codec in at most maxRequest number of requests.

func CRAMMD5GetChallenge

func CRAMMD5GetChallenge() (string, error)

func CRAMMD5GetExpected

func CRAMMD5GetExpected(username, secret, challenge string) string

func LoadCredentials

func LoadCredentials(filename string) error

LoadCredentials loads credentials stored in the JSON file named filename into the default authenticator.

Types

type AuthenticateReply

type AuthenticateReply struct{}

type AuthenticateRequest

type AuthenticateRequest struct {
	Proof string
	// contains filtered or unexported fields
}

type AuthenticatorCRAMMD5

type AuthenticatorCRAMMD5 struct {
	Credentials cramMD5Credentials
}

AuthenticatorCRAMMD5 is an authenticator that uses the SASL CRAM-MD5 authentication mechanism.

func NewAuthenticatorCRAMMD5

func NewAuthenticatorCRAMMD5() *AuthenticatorCRAMMD5

func (*AuthenticatorCRAMMD5) Authenticate

func (a *AuthenticatorCRAMMD5) Authenticate(context *proto.Context, req *AuthenticateRequest, reply *AuthenticateReply) error

Authenticate checks if the client proof is correct.

func (*AuthenticatorCRAMMD5) GetNewChallenge

func (a *AuthenticatorCRAMMD5) GetNewChallenge(_ UnusedArgument, reply *GetNewChallengeReply) error

GetNewChallenge gives the client a new challenge for authentication.

type GetNewChallengeReply

type GetNewChallengeReply struct {
	Challenge string
}

type UnusedArgument

type UnusedArgument string

UnusedArgument is a type used to indicate an argument that is necessary because of net/rpc requirements.

Jump to

Keyboard shortcuts

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