Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
dex
Commits
c14b2fd5
Unverified
Commit
c14b2fd5
authored
6 years ago
by
Stephan Renatus
Browse files
Options
Downloads
Patches
Plain Diff
connector/ldap: slightly improve error output
Signed-off-by:
Stephan Renatus
<
srenatus@chef.io
>
parent
32950842
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
connector/ldap/ldap.go
+4
-1
4 additions, 1 deletion
connector/ldap/ldap.go
with
4 additions
and
1 deletion
connector/ldap/ldap.go
+
4
−
1
View file @
c14b2fd5
...
@@ -293,6 +293,9 @@ func (c *ldapConnector) do(ctx context.Context, f func(c *ldap.Conn) error) erro
...
@@ -293,6 +293,9 @@ func (c *ldapConnector) do(ctx context.Context, f func(c *ldap.Conn) error) erro
// If bindDN and bindPW are empty this will default to an anonymous bind.
// If bindDN and bindPW are empty this will default to an anonymous bind.
if
err
:=
conn
.
Bind
(
c
.
BindDN
,
c
.
BindPW
);
err
!=
nil
{
if
err
:=
conn
.
Bind
(
c
.
BindDN
,
c
.
BindPW
);
err
!=
nil
{
if
c
.
BindDN
==
""
&&
c
.
BindPW
==
""
{
return
fmt
.
Errorf
(
"ldap: initial anonymous bind failed: %v"
,
err
)
}
return
fmt
.
Errorf
(
"ldap: initial bind for user %q failed: %v"
,
c
.
BindDN
,
err
)
return
fmt
.
Errorf
(
"ldap: initial bind for user %q failed: %v"
,
c
.
BindDN
,
err
)
}
}
...
@@ -472,7 +475,7 @@ func (c *ldapConnector) Login(ctx context.Context, s connector.Scopes, username,
...
@@ -472,7 +475,7 @@ func (c *ldapConnector) Login(ctx context.Context, s connector.Scopes, username,
func
(
c
*
ldapConnector
)
Refresh
(
ctx
context
.
Context
,
s
connector
.
Scopes
,
ident
connector
.
Identity
)
(
connector
.
Identity
,
error
)
{
func
(
c
*
ldapConnector
)
Refresh
(
ctx
context
.
Context
,
s
connector
.
Scopes
,
ident
connector
.
Identity
)
(
connector
.
Identity
,
error
)
{
var
data
refreshData
var
data
refreshData
if
err
:=
json
.
Unmarshal
(
ident
.
ConnectorData
,
&
data
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
ident
.
ConnectorData
,
&
data
);
err
!=
nil
{
return
ident
,
fmt
.
Errorf
(
"ldap: failed to un
a
mrshal internal data: %v"
,
err
)
return
ident
,
fmt
.
Errorf
(
"ldap: failed to unm
a
rshal internal data: %v"
,
err
)
}
}
var
user
ldap
.
Entry
var
user
ldap
.
Entry
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment