Documentation ¶
Index ¶
- Constants
- func Check_credential(db *gorm.DB, config_file string, auth Auth) bool
- func Create_read_pepper(fname string) string
- func Get_input(prompt string) string
- func Hash_SaltPepper_Password(password string, salt string, pepper string) []byte
- func Log_if_fatal(e error)
- func Pretty_print(obj any)
- func Str_random(n int) string
- type Auth
- type Credential
- type CredentialSQL
Constants ¶
View Source
const BCRYPT_DEFAULT_COST = bcrypt.DefaultCost + 4
Variables ¶
This section is empty.
Functions ¶
func Log_if_fatal ¶
func Log_if_fatal(e error)
func Pretty_print ¶
func Pretty_print(obj any)
Function for printing Objects
prints any object (as JSON) as long as it can be serialized to JSON
Types ¶
type Auth ¶
Credential type
with raw input
func Get_auth_from_term ¶
func Get_auth_from_term() Auth
Function to retrieve name/password from terminal
- will prompt for user input and - will hide password input in terminal
type Credential ¶
Credential type
with hashed password after adding salt and pepper
func Make_credential ¶
func Make_credential(username string, password string, pepper string) Credential
MakeCredential
generates a credential from username, password and pepper
type CredentialSQL ¶
Credential type
with hashed password after adding salt and pepper ready to be put in DB
func Make_credential_sql ¶
func Make_credential_sql(username string, password string, pepper string) CredentialSQL
MakeCredentialSQL
generates a credential from username, password and pepper
func Upsert_auth_as_credential_to_db ¶
func Upsert_auth_as_credential_to_db(db *gorm.DB, config_file string, auth Auth) CredentialSQL
Click to show internal directories.
Click to hide internal directories.