Skip to content

Commit 3da1019

Browse files
Fixed config issues and fixed LDAP code. Also created docker-compose.yaml for testing purposes
1 parent ee83ee1 commit 3da1019

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
app:
55
name: laclm-dev
66
version: v1.1
7-
debug_mode: false
7+
debug_mode: false
88

99
# backend server deployment configs
1010
server:
@@ -13,7 +13,7 @@ server:
1313

1414
# databases for operations
1515
database:
16-
transaction_logs_redis:
16+
transaction_log_redis:
1717
address: localhost
1818
password: ${LACLM_TRANS_REDIS_PASSWORD}
1919
db: 1

config/backend_security.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type BackendSecurity struct {
1616
func (b *BackendSecurity) Normalize() error {
1717
if b.JWTTokenSecret == "" {
1818
return errors.New(heredoc.Doc(`
19-
Transaction Log Redis Address is not specified in the configuration file.
19+
JWT Token Security is not specified in the configuration file.
2020
2121
Please check the docs for more information:
2222
`))

config/database.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import (
99

1010
/* database parameters */
1111
type Database struct {
12-
TransactionLogRedis TransactionLogRedis `yaml:"transaction_logs_redis"`
12+
TransactionLogRedis TransactionLogRedis `yaml:"transaction_log_redis"`
1313
}
1414

1515
/* transaction log redis parameters */
1616
type TransactionLogRedis struct {
1717
Address string `yaml:"address"`
1818
Password string `yaml:"password"`
19-
DB string `yaml:"db"`
19+
DB int `yaml:"db"`
2020
}
2121

2222
/* normalization function */
@@ -36,12 +36,10 @@ func (r *TransactionLogRedis) Normalize() error {
3636
/* password can be empty */
3737
if r.Password == "" {
3838
/* just warn users to use password protected redis */
39-
fmt.Println("Prefer using password for redis for security purposes")
39+
fmt.Println("Prefer using password for redis for security purposes\n")
4040
}
4141

42-
if r.DB == "" {
43-
r.DB = "0"
44-
}
42+
/* r.DB default value can be 0 */
4543

4644
return nil
4745
}

docker-compose.yaml

Whitespace-only changes.

internal/ldap/ldap.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ func AuthenticateUser(username, password, searchbase string) bool {
3535
l, err = ldap.DialURL(ldapAddress)
3636
}
3737

38-
/* dial to the ldap server */
39-
l, err = ldap.DialURL("")
4038
if err != nil {
4139
zap.L().Error("Failed to connect to LDAP Server",
4240
zap.Error(err),

0 commit comments

Comments
 (0)