Merge branch 'master' into ocis-init
This commit is contained in:
@@ -27,7 +27,8 @@ type Config struct {
|
||||
|
||||
// Ldap defines the available LDAP configuration.
|
||||
type Ldap struct {
|
||||
URI string `yaml:"uri" env:"LDAP_URI;IDP_LDAP_URI"`
|
||||
URI string `yaml:"uri" env:"LDAP_URI;IDP_LDAP_URI"`
|
||||
TLSCACert string `yaml:"cacert" env:"LDAP_CACERT;IDP_LDAP_TLS_CACERT"`
|
||||
|
||||
BindDN string `yaml:"bind_dn" env:"LDAP_BIND_DN;IDP_LDAP_BIND_DN"`
|
||||
BindPassword string `yaml:"bind_password" env:"LDAP_BIND_PASSWORD;IDP_LDAP_BIND_PASSWORD"`
|
||||
|
||||
@@ -68,18 +68,19 @@ func DefaultConfig() *config.Config {
|
||||
DyamicClientSecretDurationSeconds: 0,
|
||||
},
|
||||
Ldap: config.Ldap{
|
||||
URI: "ldap://localhost:9125",
|
||||
BindDN: "cn=idp,ou=sysusers,dc=ocis,dc=test",
|
||||
URI: "ldaps://localhost:9235",
|
||||
TLSCACert: path.Join(defaults.BaseDataPath(), "idm", "ldap.crt"),
|
||||
BindDN: "uid=idp,ou=sysusers,o=libregraph-idm",
|
||||
BindPassword: "idp",
|
||||
BaseDN: "ou=users,dc=ocis,dc=test",
|
||||
BaseDN: "ou=users,o=libregraph-idm",
|
||||
Scope: "sub",
|
||||
LoginAttribute: "cn",
|
||||
LoginAttribute: "uid",
|
||||
EmailAttribute: "mail",
|
||||
NameAttribute: "displayName",
|
||||
UUIDAttribute: "uid",
|
||||
UUIDAttributeType: "text",
|
||||
Filter: "",
|
||||
ObjectClass: "posixAccount",
|
||||
ObjectClass: "inetOrgPerson",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +142,10 @@ func initLicoInternalEnvVars(ldap *config.Ldap) error {
|
||||
"LDAP_FILTER": filter,
|
||||
}
|
||||
|
||||
if ldap.TLSCACert != "" {
|
||||
defaults["LDAP_TLS_CACERT"] = ldap.TLSCACert
|
||||
}
|
||||
|
||||
for k, v := range defaults {
|
||||
if err := os.Setenv(k, v); err != nil {
|
||||
return fmt.Errorf("could not set env var %s=%s", k, v)
|
||||
|
||||
Reference in New Issue
Block a user