Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rixx
uffd
Commits
a721ff1b
Commit
a721ff1b
authored
4 years ago
by
Julian
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into ldap-orm
parents
24389d21
7bd585ca
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
deps/ldapalchemy
+1
-1
1 addition, 1 deletion
deps/ldapalchemy
uffd/default_config.cfg
+12
-0
12 additions, 0 deletions
uffd/default_config.cfg
uffd/mail/models.py
+1
-1
1 addition, 1 deletion
uffd/mail/models.py
uffd/user/models.py
+5
-5
5 additions, 5 deletions
uffd/user/models.py
with
19 additions
and
7 deletions
ldapalchemy
@
6a0b85f2
Compare
e223f161
...
6a0b85f2
Subproject commit
e223f1617e3452d66d20b9368a74d2bdf6cc1ba
4
Subproject commit
6a0b85f2c6a11951d99d4b4e84b1df992580d96
4
This diff is collapsed.
Click to expand it.
uffd/default_config.cfg
+
12
−
0
View file @
a721ff1b
...
@@ -2,11 +2,23 @@ LDAP_BASE_USER="ou=users,dc=example,dc=com"
...
@@ -2,11 +2,23 @@ LDAP_BASE_USER="ou=users,dc=example,dc=com"
LDAP_BASE_GROUPS
=
"ou=groups,dc=example,dc=com"
LDAP_BASE_GROUPS
=
"ou=groups,dc=example,dc=com"
LDAP_BASE_MAIL
=
"ou=postfix,dc=example,dc=com"
LDAP_BASE_MAIL
=
"ou=postfix,dc=example,dc=com"
LDAP_FILTER_USER
=
[("objectClass","person")]
LDAP_FILTER_GROUP
=
[("objectClass","groupOfUniqueNames")]
LDAP_FILTER_MAIL
=
[("objectClass","postfixVirtual")]
LDAP_SERVICE_BIND_DN
=
""
LDAP_SERVICE_BIND_DN
=
""
LDAP_SERVICE_BIND_PASSWORD
=
""
LDAP_SERVICE_BIND_PASSWORD
=
""
LDAP_SERVICE_URL
=
"ldapi:///"
LDAP_SERVICE_URL
=
"ldapi:///"
LDAP_SERVICE_USE_STARTTLS
=
True
LDAP_USER_OBJECTCLASSES
=
["top", "inetOrgPerson", "organizationalPerson", "person", "posixAccount"]
LDAP_USER_OBJECTCLASSES
=
["top", "inetOrgPerson", "organizationalPerson", "person", "posixAccount"]
LDAP_USER_ATTRIBUTE_UID
=
"uidNumber"
LDAP_USER_ATTRIBUTE_DISPLAYNAME
=
"cn"
LDAP_USER_ATTRIBUTE_MAIL
=
"mail"
# The User class gets filled by which LDAP attribute and to type (single/list)
LDAP_USER_ATTRIBUTE_EXTRA
=
{
#"phone": {"type": "single", "name": "mobile"},
}
LDAP_USER_GID
=
20001
LDAP_USER_GID
=
20001
LDAP_USER_MIN_UID
=
10000
LDAP_USER_MIN_UID
=
10000
LDAP_USER_MAX_UID
=
18999
LDAP_USER_MAX_UID
=
18999
...
...
This diff is collapsed.
Click to expand it.
uffd/mail/models.py
+
1
−
1
View file @
a721ff1b
...
@@ -3,7 +3,7 @@ from uffd.lazyconfig import lazyconfig_str, lazyconfig_list
...
@@ -3,7 +3,7 @@ from uffd.lazyconfig import lazyconfig_str, lazyconfig_list
class
Mail
(
ldap
.
Model
):
class
Mail
(
ldap
.
Model
):
ldap_search_base
=
lazyconfig_str
(
'
LDAP_BASE_MAIL
'
)
ldap_search_base
=
lazyconfig_str
(
'
LDAP_BASE_MAIL
'
)
ldap_filter_params
=
((
'
objectClass
'
,
'
postfixVirtual
'
),
)
ldap_filter_params
=
lazyconfig_list
(
'
LDAP_FILTER_MAIL
'
)
ldap_object_classes
=
lazyconfig_list
(
'
MAIL_LDAP_OBJECTCLASSES
'
)
ldap_object_classes
=
lazyconfig_list
(
'
MAIL_LDAP_OBJECTCLASSES
'
)
ldap_dn_attribute
=
'
uid
'
ldap_dn_attribute
=
'
uid
'
ldap_dn_base
=
lazyconfig_str
(
'
LDAP_BASE_MAIL
'
)
ldap_dn_base
=
lazyconfig_str
(
'
LDAP_BASE_MAIL
'
)
...
...
This diff is collapsed.
Click to expand it.
uffd/user/models.py
+
5
−
5
View file @
a721ff1b
...
@@ -19,15 +19,15 @@ def get_next_uid():
...
@@ -19,15 +19,15 @@ def get_next_uid():
class
User
(
ldap
.
Model
):
class
User
(
ldap
.
Model
):
ldap_search_base
=
lazyconfig_str
(
'
LDAP_BASE_USER
'
)
ldap_search_base
=
lazyconfig_str
(
'
LDAP_BASE_USER
'
)
ldap_filter_params
=
((
'
objectClass
'
,
'
person
'
),
)
ldap_filter_params
=
lazyconfig_list
(
'
LDAP_FILTER_USER
'
)
ldap_object_classes
=
lazyconfig_list
(
'
LDAP_USER_OBJECTCLASSES
'
)
ldap_object_classes
=
lazyconfig_list
(
'
LDAP_USER_OBJECTCLASSES
'
)
ldap_dn_base
=
lazyconfig_str
(
'
LDAP_BASE_USER
'
)
ldap_dn_base
=
lazyconfig_str
(
'
LDAP_BASE_USER
'
)
ldap_dn_attribute
=
'
uid
'
ldap_dn_attribute
=
'
uid
'
uid
=
ldap
.
Attribute
(
'
uidNumber
'
,
default
=
get_next_uid
)
uid
=
ldap
.
Attribute
(
lazyconfig_str
(
'
LDAP_USER_ATTRIBUTE_UID
'
)
,
default
=
get_next_uid
)
loginname
=
ldap
.
Attribute
(
'
uid
'
)
loginname
=
ldap
.
Attribute
(
'
uid
'
)
displayname
=
ldap
.
Attribute
(
'
cn
'
,
aliases
=
[
'
givenName
'
,
'
displayName
'
])
displayname
=
ldap
.
Attribute
(
lazyconfig_str
(
'
LDAP_USER_ATTRIBUTE_DISPLAYNAME
'
)
,
aliases
=
[
'
givenName
'
,
'
displayName
'
])
mail
=
ldap
.
Attribute
(
'
mail
'
)
mail
=
ldap
.
Attribute
(
lazyconfig_str
(
'
LDAP_USER_ATTRIBUTE_MAIL
'
)
)
pwhash
=
ldap
.
Attribute
(
'
userPassword
'
,
default
=
lambda
:
hashed
(
HASHED_SALTED_SHA512
,
secrets
.
token_hex
(
128
)))
pwhash
=
ldap
.
Attribute
(
'
userPassword
'
,
default
=
lambda
:
hashed
(
HASHED_SALTED_SHA512
,
secrets
.
token_hex
(
128
)))
groups
=
[]
# Shuts up pylint, overwritten by back-reference
groups
=
[]
# Shuts up pylint, overwritten by back-reference
...
@@ -103,7 +103,7 @@ class User(ldap.Model):
...
@@ -103,7 +103,7 @@ class User(ldap.Model):
class
Group
(
ldap
.
Model
):
class
Group
(
ldap
.
Model
):
ldap_search_base
=
lazyconfig_str
(
'
LDAP_BASE_GROUPS
'
)
ldap_search_base
=
lazyconfig_str
(
'
LDAP_BASE_GROUPS
'
)
ldap_filter_params
=
((
'
objectClass
'
,
'
groupOfUniqueNames
'
),
)
ldap_filter_params
=
lazyconfig_list
(
'
LDAP_FILTER_GROUP
'
)
gid
=
ldap
.
Attribute
(
'
gidNumber
'
)
gid
=
ldap
.
Attribute
(
'
gidNumber
'
)
name
=
ldap
.
Attribute
(
'
cn
'
)
name
=
ldap
.
Attribute
(
'
cn
'
)
...
...
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