Documentation ¶
Overview ¶
Package scramsha1 implements the client and server portions of RFC5802 (https://tools.ietf.org/html/rfc5802).
Index ¶
Constants ¶
const MechName = "SCRAM-SHA-1"
ScramSha1 mechanism name.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthzVerifier ¶
AuthzVerifier verifies the client's authorization identity.
type ClientMech ¶
type ClientMech struct {
// contains filtered or unexported fields
}
ClientMech implements the client side portion of SCRAM-SHA-1.
func NewClientMech ¶
func NewClientMech(authz, username, password string, nonceLen uint16, nonceSource io.Reader) *ClientMech
NewClientMech creates a new ClientMech.
func (*ClientMech) Completed ¶
func (m *ClientMech) Completed() bool
Completed indicates if the authentication exchange is complete from the client's perspective.
type ServerMech ¶
ServerMech implements the server side portion of SCRAM-SHA-1.
func NewServerMech ¶
func NewServerMech(storedUserProvider StoredUserProvider, verifier AuthzVerifier, nonceLen uint16, nonceSource io.Reader) *ServerMech
NewServerMech creates a new ServerMech.
func (*ServerMech) Completed ¶
func (m *ServerMech) Completed() bool
Completed indicates if the authentication exchange is complete from the server's perspective.
type StoredUser ¶
StoredUser holds the information needed to validate a user.
type StoredUserProvider ¶
type StoredUserProvider func(ctx context.Context, username string) (*StoredUser, error)
StoredUserProvider returns the salt and iteration count for a given user.