Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pygitlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
fsl
pygitlab
Commits
e6822987
Commit
e6822987
authored
7 years ago
by
Jakob Berger
Committed by
jakob
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ldap fixes
parent
efd7efde
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ldap.py
+3
-2
3 additions, 2 deletions
ldap.py
with
3 additions
and
2 deletions
ldap.py
+
3
−
2
View file @
e6822987
...
...
@@ -26,8 +26,8 @@ class LdapHandler:
return
self
.
connection
.
entries
def
get_ldap_users
(
self
,
usernames
:
List
[
str
],
attributes
:
dict
=
{
'
username
'
:
'
uid
'
,
'
name
'
:
'
cn
'
,
'
mail
'
:
'
mail
'
},
default_vars
:
dict
=
{
'
provider
'
:
'
ldapmain
'
,
'
project_limit
'
:
'
0
'
,
'
confirm
'
:
'
false
'
},
attributes
:
dict
=
{
'
username
'
:
'
uid
'
,
'
name
'
:
'
cn
'
,
'
e
mail
'
:
'
mail
'
},
default_vars
:
dict
=
{
'
provider
'
:
'
ldapmain
'
,
'
project_limit
'
:
'
0
'
,
'
confirm
'
:
'
false
'
,
'
password
'
:
'
oobahbah7ya5b@ohshai-1iex9kuDo$h3Faef5saeng
'
},
filters
:
dict
=
{})
->
List
[
Dict
]:
"""
Queries the ldap and prefills the user object for you.
The attributes dictionary maps the names of the user object attributes to the names of the ldap fields
...
...
@@ -40,6 +40,7 @@ class LdapHandler:
users
=
[]
for
entry
in
results
:
user
=
default_vars
.
copy
()
user
[
'
extern_uid
'
]
=
entry
.
entry_dn
for
user_field
,
ldap_name
in
attributes
.
items
():
user
[
user_field
]
=
entry
.
entry_attributes_as_dict
[
ldap_name
][
0
]
users
.
append
(
user
)
...
...
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