committed by
Ralf Haferkamp
parent
e270cdbfd2
commit
b5b15f29de
+1
-1
@@ -115,7 +115,7 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)
|
||||
}
|
||||
|
||||
// Bind as the user to verify their password
|
||||
la, err := utils.GetLDAPClientForAuth(&am.c.LDAPConn)
|
||||
la, err := utils.GetLDAPClientForAuth(ctx, &am.c.LDAPConn)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
+1
-1
@@ -727,7 +727,7 @@ func (t *Tree) isIndex(path string) bool {
|
||||
}
|
||||
|
||||
func (t *Tree) isTemporary(path string) bool {
|
||||
return path == blobstore.TMPDir
|
||||
return path == blobstore.TMPDir || filepath.Dir(path) == blobstore.TMPDir
|
||||
}
|
||||
|
||||
func (t *Tree) isRootPath(path string) bool {
|
||||
|
||||
+4
-2
@@ -19,11 +19,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"os"
|
||||
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/appctx"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/logger"
|
||||
ldapReconnect "github.com/opencloud-eu/reva/v2/pkg/utils/ldap"
|
||||
"github.com/pkg/errors"
|
||||
@@ -77,10 +79,10 @@ func GetLDAPClientWithReconnect(c *LDAPConn) (ldap.Client, error) {
|
||||
// GetLDAPClientForAuth initializes an LDAP connection. The connection is not authenticated
|
||||
// when returned. The main purpose for GetLDAPClientForAuth is to get and LDAP connection that
|
||||
// can be used to issue a single bind request to authenticate a user.
|
||||
func GetLDAPClientForAuth(c *LDAPConn) (ldap.Client, error) {
|
||||
func GetLDAPClientForAuth(ctx context.Context, c *LDAPConn) (ldap.Client, error) {
|
||||
var tlsConf *tls.Config
|
||||
if c.Insecure {
|
||||
logger.New().Warn().Msg("SSL Certificate verification is disabled. Is is strongly discouraged for production environments.")
|
||||
appctx.GetLogger(ctx).Warn().Msg("SSL Certificate verification is disabled. Is is strongly discouraged for production environments.")
|
||||
tlsConf = &tls.Config{
|
||||
//nolint:gosec // We need the ability to run with "insecure" (dev/testing)
|
||||
InsecureSkipVerify: true,
|
||||
|
||||
Reference in New Issue
Block a user