scram

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package scram provides an implementation of SCRAM-SHA-256 subset.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conv

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

Conv represents a server SCRAM conversation.

Conversation is not restartable. A new instance should be created for each conversation.

func NewConv

func NewConv(l *slog.Logger) *Conv

NewConv creates a server SCRAM conversation.

func (*Conv) ClientFinal

func (c *Conv) ClientFinal(payload string) (string, string, error)

ClientFinal processes the client-final message and returns the auth message and the client proof.

func (*Conv) ClientFirst

func (c *Conv) ClientFirst(payload string) (string, error)

ClientFirst processes the client-first message and returns the username.

func (*Conv) ServerFinal

func (c *Conv) ServerFinal(res wirebson.RawDocument) (string, error)

ServerFinal processes the AuthenticateWithScramSha256's result and returns the server-final message.

func (*Conv) ServerFirst

func (c *Conv) ServerFirst(res wirebson.RawDocument) (string, error)

ServerFirst processes the ScramSha256GetSaltAndIterations's result and returns the server-first message.

func (*Conv) Succeed

func (c *Conv) Succeed() bool

Succeed returns true if conversation was done successfully.

func (*Conv) Username

func (c *Conv) Username() string

Username returns client's identification. It might not be authenticated.

Jump to

Keyboard shortcuts

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