Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(c rpc.ServerCodec, context *proto.Context) (bool, error)
- func CRAMMD5GetChallenge() (string, error)
- func CRAMMD5GetExpected(username, secret, challenge string) string
- func LoadCredentials(filename string) error
- type AuthenticateReply
- type AuthenticateRequest
- type AuthenticatorCRAMMD5
- type GetNewChallengeReply
- type UnusedArgument
Constants ¶
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 ¶
var ( AuthenticationServer = rpc.NewServer() DefaultAuthenticatorCRAMMD5 = NewAuthenticatorCRAMMD5() )
var AuthenticationFailed = errors.New("authentication error: authentication failed")
AuthenticationFailed is returned when the client fails to authenticate.
Functions ¶
func Authenticate ¶
Authenticate returns true if it the client manages to authenticate the codec in at most maxRequest number of requests.
func CRAMMD5GetChallenge ¶
func CRAMMD5GetExpected ¶
func LoadCredentials ¶
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.