auth

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 3 Imported by: 0

README

auth

Authentication Package

Documentation

Overview

Package auth is a authentication helper that supports multiple types of applications.

Index

Constants

View Source
const MethodPasswordHashHS256 = "Password Hash using HMAC-SHA256"

MethodPasswordHashHS256 defines password hash generation using HMAC-SHA256

Variables

View Source
var ErrNotImplemented = fmt.Errorf("error functionality not implemented yet")

ErrNotImplemented occurs when an Un-implemented feature is called on

View Source
var ErrNotInitialized = fmt.Errorf("error this construct is not initialized")

ErrNotInitialized occurs when an Authentication process or function tries to access an un-initialized data parameter or construct.

View Source
var ErrParameter = fmt.Errorf("error in supplied parameters")

ErrParameter occurs when there are issues with the supplied parameter in any function.

Functions

This section is empty.

Types

type Auth

type Auth interface {

	// Create function generates the Authentication Entity by processing
	// incoming data and the specific 'bias'.
	Create(data []byte, bias interface{}) ([]byte, error)

	// Verify function checks the Authentication Entity by processing
	// it with the optional incoming 'bias'. It also recovers the original
	// 'data' and 'bias' used to create the Authentication Entity.
	Verify(value []byte, bias interface{}) ([]byte, interface{}, error)

	// Set function configures the Authentication Entity creation and
	// verification process. It also accepts the static "Key" that needs
	// to be employed while processing the Authentication Entity.
	Set(method string, key interface{}) error
}

Auth is the generic interface that would be implemented by the various authentication algorithms and classifications.

The term "Authentication Entity" refers to a token, pass, or a Unique piece of information that provides Identity, and Authorization status of the bearer.

func NewPasswordHash added in v0.0.2

func NewPasswordHash(method string, key interface{}) (Auth, error)

NewPasswordHash Configures the respective password Hashing algorithm and returns the instance which implements the Auth Interface

type PasswordHash added in v0.0.2

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

PasswordHash is used to generated cryptographically secure digest from the supplied password and also verify the digest.

Jump to

Keyboard shortcuts

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