authenticater

package
v0.0.0-...-1e2c71d Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package authenticater contains all currently implemented Authenticater.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BcryptFile

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

PlainFile is a simple Authenticater which takes a file cpontaining a two dimensional JSON Array as a configuration. [

["user1", "bcrypthash_password1"],
["user2", "bcrypthash_password2"]

] A username can only be specified once. All entries must be in plain text. The hash must be a base64 encoded password. Can be generated using tools like bcrypt_password_hash (https://github.com/Top-Ranger/bcrypt_password_hash).

func (*BcryptFile) Authenticate

func (bf *BcryptFile) Authenticate(user, password string) (bool, error)

Authenticate validates a user/password configuration. It is safe for parallel usage.

func (*BcryptFile) LoadConfig

func (bf *BcryptFile) LoadConfig(b []byte) error

LoadConfig loads the configuration. It is assumed that this is only called once before Authenticate is called.

type PlainFile

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

PlainFile is a simple Authenticater which takes a file cpontaining a two dimensional JSON Array as a configuration. [

["user1", "password1"],
["user2", "password2"]

] A username can only be specified once. All entries must be in plain text

func (*PlainFile) Authenticate

func (p *PlainFile) Authenticate(user, password string) (bool, error)

Authenticate validates a user/password configuration. It is safe for parallel usage.

func (*PlainFile) LoadConfig

func (p *PlainFile) LoadConfig(b []byte) error

LoadConfig loads the configuration. It is assumed that this is only called once before Authenticate is called.

Jump to

Keyboard shortcuts

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