diff options
author | MrArmonius <mrarmonius@gmail.com> | 2021-07-07 01:49:33 +0200 |
---|---|---|
committer | MrArmonius <mrarmonius@gmail.com> | 2021-07-19 18:56:47 +0200 |
commit | a98556d5c1241f9150202d72ea096a775d97a582 (patch) | |
tree | 17825f52e0079e7eaa759a28951b9eb6fda6572e /main.go | |
parent | aa912b5ceb24cb8772709171ea9589b0771bbe54 (diff) | |
download | bottin-a98556d5c1241f9150202d72ea096a775d97a582.tar.gz bottin-a98556d5c1241f9150202d72ea096a775d97a582.zip |
Test End-to-end V1.0, testing Bottin's behavior
Tests wrote in golang without framework Testing on the Bottin's behavior
Tests made:
- crated random Users and Group - LDAP ADD
- check the match between Consul's data and Test's data- LDAP
Search
- modify attributes and check them -
LDAP Modify
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -320,12 +320,19 @@ func (server *Server) init() error { return err } - admin_pass := make([]byte, 8) - _, err = rand.Read(admin_pass) - if err != nil { - return err + + admin_pass_str, environnement_variable_exist := os.LookupEnv("BOTTIN_DEFAULT_ADMIN_PW") + if !environnement_variable_exist { + admin_pass := make([]byte, 8) + _, err = rand.Read(admin_pass) + if err != nil { + return err + } + admin_pass_str = base64.RawURLEncoding.EncodeToString(admin_pass) + } else { + server.logger.Printf("It seems that exists a password in environnement variable") } - admin_pass_str := base64.RawURLEncoding.EncodeToString(admin_pass) + admin_pass_hash := SSHAEncode([]byte(admin_pass_str)) admin_dn := "cn=admin," + server.config.Suffix |