mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 10:22:19 +00:00
Reduce bcrypt rounds for demo password to 10 to displaying the bcrypt process in the CPU profiling
This commit is contained in:
parent
e1bdae5380
commit
fc3c0f606c
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
func TestBasicLogin(t *testing.T) {
|
func TestBasicLogin(t *testing.T) {
|
||||||
basicCredentials := make(map[string]string)
|
basicCredentials := make(map[string]string)
|
||||||
basicCredentials["demo"] = "$2b$15$LRnG3eIHFlYIguTxZOLH7eHwbQC/vqjnLq6nDFiHSUDKIU.f5/1H6"
|
basicCredentials["demo"] = "$2b$10$xuU7XFwmRX2CMgdSaA8rM.4Y8.BtRNzhUedwN0G8tCegDRNUERTCS"
|
||||||
|
|
||||||
// Test good credentials
|
// Test good credentials
|
||||||
backend, _ := New(&Options{Credentials: basicCredentials})
|
backend, _ := New(&Options{Credentials: basicCredentials})
|
||||||
|
@ -22,12 +22,12 @@ auth:
|
|||||||
|
|
||||||
# Basic backend configuration
|
# Basic backend configuration
|
||||||
# To generate bcrypt hashed password from Python, use:
|
# To generate bcrypt hashed password from Python, use:
|
||||||
# python3 -c 'import bcrypt; print(bcrypt.hashpw(b"PASSWORD", bcrypt.gensalt(rounds=15)).decode("ascii"))'
|
# python3 -c 'import bcrypt; print(bcrypt.hashpw(b"PASSWORD", bcrypt.gensalt(rounds=12)).decode("ascii"))'
|
||||||
#
|
#
|
||||||
#basic:
|
#basic:
|
||||||
# credentials:
|
# credentials:
|
||||||
# # Demo user with password "demo"
|
# # Demo user with password "demo"
|
||||||
# demo: $2b$15$LRnG3eIHFlYIguTxZOLH7eHwbQC/vqjnLq6nDFiHSUDKIU.f5/1H6
|
# demo: $2b$10$xuU7XFwmRX2CMgdSaA8rM.4Y8.BtRNzhUedwN0G8tCegDRNUERTCS
|
||||||
|
|
||||||
# LDAP backend configuration
|
# LDAP backend configuration
|
||||||
#
|
#
|
||||||
|
@ -117,7 +117,7 @@ func Load() (*Config, error) {
|
|||||||
|
|
||||||
// If no credentials register, add demo account with password "demo"
|
// If no credentials register, add demo account with password "demo"
|
||||||
if len(cfg.Auth.Basic.Credentials) < 1 {
|
if len(cfg.Auth.Basic.Credentials) < 1 {
|
||||||
cfg.Auth.Basic.Credentials["demo"] = "$2b$15$LRnG3eIHFlYIguTxZOLH7eHwbQC/vqjnLq6nDFiHSUDKIU.f5/1H6"
|
cfg.Auth.Basic.Credentials["demo"] = "$2b$10$xuU7XFwmRX2CMgdSaA8rM.4Y8.BtRNzhUedwN0G8tCegDRNUERTCS"
|
||||||
}
|
}
|
||||||
|
|
||||||
return cfg, nil
|
return cfg, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user