auth

package
v0.0.0-...-7a6e8ff Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapUserKey

func BootstrapUserKey(userKeyPath, userKeyDirectory string) error

Ensures a validated UserKey exists

func CalculateSHA256Hash

func CalculateSHA256Hash(key string) string

Calculate user hash from key

func CalculateSHA256HashInBytes

func CalculateSHA256HashInBytes(key string) [32]byte

similar to CalculateSHA256Hash, but does not convert byte array to string we noticed unwanted type conversions when, converting back to []byte from string created another for simplicity and to avoid unnecessary complications

func GenerateUserKey

func GenerateUserKey() string

Returns a string UUID

func GenerateUserKeyFromString

func GenerateUserKeyFromString(msg string) string

the fn hashes the supplied string first and uses first 16 bytes of the generated hash to be converted to UUID. As each bit of SHA hash is effectively random, we get a unique-uuid for each distinct string, even when they have minimal differences

func GetUserHash

func GetUserHash(userKeyPath string) string

Gets the user key and returns the calculated hash for it

func GetUserKey

func GetUserKey(userKeyPath string) string

Get the user key

func VerifyUserKeyFile

func VerifyUserKeyFile(pathToFile string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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