myldapsync 1.0.2__tar.gz → 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of myldapsync might be problematic. Click here for more details.
- {myldapsync-1.0.2 → myldapsync-1.0.3}/LICENSE +1 -1
- {myldapsync-1.0.2/myldapsync.egg-info → myldapsync-1.0.3}/PKG-INFO +4 -5
- {myldapsync-1.0.2 → myldapsync-1.0.3}/README.md +1 -1
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/__init__.py +23 -25
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/ldaputils/connection.py +13 -12
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/myutils/users.py +1 -2
- {myldapsync-1.0.2 → myldapsync-1.0.3/myldapsync.egg-info}/PKG-INFO +4 -5
- {myldapsync-1.0.2 → myldapsync-1.0.3}/setup.py +3 -4
- {myldapsync-1.0.2 → myldapsync-1.0.3}/MANIFEST.in +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/config.ini.example +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/config_default.ini +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/ldaputils/__init__.py +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/ldaputils/users.py +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync/myutils/__init__.py +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync.egg-info/SOURCES.txt +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync.egg-info/dependency_links.txt +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync.egg-info/entry_points.txt +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync.egg-info/requires.txt +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/myldapsync.egg-info/top_level.txt +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/requirements.txt +0 -0
- {myldapsync-1.0.2 → myldapsync-1.0.3}/setup.cfg +0 -0
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: myldapsync
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: Synchronise LDAP users to MySQL
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: Synchronise LDAP users to MySQL and MariaDB
|
|
5
5
|
Home-page: https://github.com/6eh01der/myldapsync
|
|
6
6
|
Author: Artur Lebedev
|
|
7
7
|
Author-email: ras_atari@mail.ru
|
|
8
8
|
License: MySQL
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.8
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
|
|
16
15
|
Classifier: Operating System :: OS Independent
|
|
17
|
-
Requires-Python: >=3.
|
|
16
|
+
Requires-Python: >=3.8
|
|
18
17
|
Description-Content-Type: text/markdown
|
|
19
18
|
License-File: LICENSE
|
|
20
19
|
Requires-Dist: ldap3>=2.9.1
|
|
@@ -44,7 +43,7 @@ MariaDB:
|
|
|
44
43
|
|
|
45
44
|
https://mariadb.com/kb/en/authentication-plugin-pam/
|
|
46
45
|
|
|
47
|
-
*myldapsync is supported on Python 3.
|
|
46
|
+
*myldapsync is supported on Python 3.8 or later.*
|
|
48
47
|
|
|
49
48
|
In order to use it, you will need to create a _config.ini_
|
|
50
49
|
file containing the site-specific configuration you require.
|
|
@@ -21,7 +21,7 @@ MariaDB:
|
|
|
21
21
|
|
|
22
22
|
https://mariadb.com/kb/en/authentication-plugin-pam/
|
|
23
23
|
|
|
24
|
-
*myldapsync is supported on Python 3.
|
|
24
|
+
*myldapsync is supported on Python 3.8 or later.*
|
|
25
25
|
|
|
26
26
|
In order to use it, you will need to create a _config.ini_
|
|
27
27
|
file containing the site-specific configuration you require.
|
|
@@ -87,42 +87,40 @@ def main():
|
|
|
87
87
|
# MySQL connection dictionary
|
|
88
88
|
connection_string_params = {}
|
|
89
89
|
|
|
90
|
-
if config.get('mysql', 'host') != '':
|
|
91
|
-
connection_string_params = dict(connection_string_params, host=
|
|
90
|
+
if (host := config.get('mysql', 'host')) != '':
|
|
91
|
+
connection_string_params = dict(connection_string_params, host=host)
|
|
92
92
|
|
|
93
|
-
if config.get('mysql', 'user') != '':
|
|
94
|
-
connection_string_params = dict(connection_string_params, user=
|
|
93
|
+
if (user := config.get('mysql', 'user')) != '':
|
|
94
|
+
connection_string_params = dict(connection_string_params, user=user)
|
|
95
95
|
|
|
96
|
-
if config.get('mysql', 'password') != '':
|
|
97
|
-
connection_string_params = dict(connection_string_params, password=
|
|
96
|
+
if (password := config.get('mysql', 'password')) != '':
|
|
97
|
+
connection_string_params = dict(connection_string_params, password=password)
|
|
98
98
|
|
|
99
|
-
if config.get('mysql', 'db') != '':
|
|
100
|
-
connection_string_params = dict(connection_string_params, db=
|
|
99
|
+
if (db := config.get('mysql', 'db')) != '':
|
|
100
|
+
connection_string_params = dict(connection_string_params, db=db)
|
|
101
101
|
|
|
102
|
-
if config.get('mysql', 'auth_plugin') != '':
|
|
103
|
-
connection_string_params = dict(connection_string_params, auth_plugin=
|
|
102
|
+
if (auth_plugin := config.get('mysql', 'auth_plugin')) != '':
|
|
103
|
+
connection_string_params = dict(connection_string_params, auth_plugin=auth_plugin)
|
|
104
104
|
|
|
105
|
-
if config.get('mysql', 'ssl_ca') != '':
|
|
106
|
-
connection_string_params = dict(connection_string_params, ssl_ca=
|
|
105
|
+
if (ssl_ca := config.get('mysql', 'ssl_ca')) != '':
|
|
106
|
+
connection_string_params = dict(connection_string_params, ssl_ca=ssl_ca)
|
|
107
107
|
|
|
108
|
-
if config.get('mysql', 'ssl_cert') != '':
|
|
109
|
-
connection_string_params = dict(connection_string_params, ssl_cert=
|
|
108
|
+
if (ssl_cert := config.get('mysql', 'ssl_cert')) != '':
|
|
109
|
+
connection_string_params = dict(connection_string_params, ssl_cert=ssl_cert)
|
|
110
110
|
|
|
111
|
-
if config.get('mysql', 'ssl_key') != '':
|
|
112
|
-
connection_string_params = dict(connection_string_params, ssl_key=
|
|
111
|
+
if (ssl_key := config.get('mysql', 'ssl_key')) != '':
|
|
112
|
+
connection_string_params = dict(connection_string_params, ssl_key=ssl_key)
|
|
113
113
|
|
|
114
|
-
if config.get('mysql', 'ssl_verify_identity') != '':
|
|
115
|
-
connection_string_params = dict(connection_string_params, ssl_verify_identity=
|
|
114
|
+
if (ssl_verify_identity := config.get('mysql', 'ssl_verify_identity')) != '':
|
|
115
|
+
connection_string_params = dict(connection_string_params, ssl_verify_identity=ssl_verify_identity)
|
|
116
116
|
|
|
117
|
-
if config.get('mysql', 'ssl_verify_cert') != '':
|
|
118
|
-
connection_string_params = dict(connection_string_params, ssl_verify_cert=
|
|
117
|
+
if (ssl_verify_cert := config.get('mysql', 'ssl_verify_cert')) != '':
|
|
118
|
+
connection_string_params = dict(connection_string_params, ssl_verify_cert=ssl_verify_cert)
|
|
119
119
|
|
|
120
|
-
if config.get('mysql', 'use_pure') != '':
|
|
121
|
-
connection_string_params = dict(connection_string_params, use_pure=
|
|
120
|
+
if (use_pure := config.get('mysql', 'use_pure')) != '':
|
|
121
|
+
connection_string_params = dict(connection_string_params, use_pure=use_pure)
|
|
122
122
|
|
|
123
|
-
if config.get('mysql', 'SERVICE_NAME') and config.get('mysql', 'LDAP_SERVER_IP') != '':
|
|
124
|
-
SERVICE_NAME = config.get('mysql', 'SERVICE_NAME')
|
|
125
|
-
LDAP_SERVER_IP = config.get('mysql', 'LDAP_SERVER_IP')
|
|
123
|
+
if (SERVICE_NAME := config.get('mysql', 'SERVICE_NAME')) and (LDAP_SERVER_IP := config.get('mysql', 'LDAP_SERVER_IP')) != '':
|
|
126
124
|
connection_string_params = dict(connection_string_params, krb_service_principal=f"{SERVICE_NAME}/{LDAP_SERVER_IP}")
|
|
127
125
|
|
|
128
126
|
# Connect to LDAP and get the users we care about
|
|
@@ -43,17 +43,20 @@ def connect_ldap_server(config):
|
|
|
43
43
|
|
|
44
44
|
if uri.scheme == 'ldaps' or config.getboolean('ldap', 'use_starttls'):
|
|
45
45
|
|
|
46
|
-
ca_cert_file
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
if (ca_cert_file := config.get('ldap', 'ca_cert_file')) != '':
|
|
47
|
+
pass
|
|
48
|
+
else:
|
|
49
|
+
ca_cert_file = None
|
|
49
50
|
|
|
50
|
-
cert_file
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
if (cert_file := config.get('ldap', 'cert_file')) != '':
|
|
52
|
+
pass
|
|
53
|
+
else:
|
|
54
|
+
cert_file = None
|
|
53
55
|
|
|
54
|
-
key_file
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
if (key_file := config.get('ldap', 'key_file')) != '':
|
|
57
|
+
pass
|
|
58
|
+
else:
|
|
59
|
+
key_file = None
|
|
57
60
|
|
|
58
61
|
tls = Tls(
|
|
59
62
|
local_private_key_file=key_file,
|
|
@@ -81,9 +84,7 @@ def connect_ldap_server(config):
|
|
|
81
84
|
if config.get('ldap', 'bind_username') == '' and config.get('ldap', 'use_krb') == '':
|
|
82
85
|
conn = Connection(server, auto_bind=True)
|
|
83
86
|
elif config.get('ldap', 'use_krb') != '':
|
|
84
|
-
if config.get('ldap', 'SERVICE_NAME')
|
|
85
|
-
SERVICE_NAME = config.get('ldap', 'SERVICE_NAME')
|
|
86
|
-
LDAP_SERVER_IP = config.get('ldap', 'LDAP_SERVER_IP')
|
|
87
|
+
if (SERVICE_NAME := config.get('ldap', 'SERVICE_NAME')) and (LDAP_SERVER_IP := config.get('ldap', 'LDAP_SERVER_IP')) != '':
|
|
87
88
|
SPN = f"{SERVICE_NAME}/{LDAP_SERVER_IP}"
|
|
88
89
|
conn = Connection(server, user=SPN, authentication=SASL, sasl_mechanism=KERBEROS)
|
|
89
90
|
else:
|
|
@@ -83,8 +83,7 @@ def get_user_privileges(config, user, with_admin=False):
|
|
|
83
83
|
privilege_list = ''
|
|
84
84
|
sql = ''
|
|
85
85
|
|
|
86
|
-
if config.get('general', 'database') != '':
|
|
87
|
-
database = config.get('general', 'database')
|
|
86
|
+
if (database := config.get('general', 'database')) != '':
|
|
88
87
|
database = '`' + database + '`'
|
|
89
88
|
else:
|
|
90
89
|
database = '*'
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: myldapsync
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: Synchronise LDAP users to MySQL
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: Synchronise LDAP users to MySQL and MariaDB
|
|
5
5
|
Home-page: https://github.com/6eh01der/myldapsync
|
|
6
6
|
Author: Artur Lebedev
|
|
7
7
|
Author-email: ras_atari@mail.ru
|
|
8
8
|
License: MySQL
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.8
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
|
|
16
15
|
Classifier: Operating System :: OS Independent
|
|
17
|
-
Requires-Python: >=3.
|
|
16
|
+
Requires-Python: >=3.8
|
|
18
17
|
Description-Content-Type: text/markdown
|
|
19
18
|
License-File: LICENSE
|
|
20
19
|
Requires-Dist: ldap3>=2.9.1
|
|
@@ -44,7 +43,7 @@ MariaDB:
|
|
|
44
43
|
|
|
45
44
|
https://mariadb.com/kb/en/authentication-plugin-pam/
|
|
46
45
|
|
|
47
|
-
*myldapsync is supported on Python 3.
|
|
46
|
+
*myldapsync is supported on Python 3.8 or later.*
|
|
48
47
|
|
|
49
48
|
In order to use it, you will need to create a _config.ini_
|
|
50
49
|
file containing the site-specific configuration you require.
|
|
@@ -19,20 +19,19 @@ with open('README.md', 'r', encoding='utf-8') as fh:
|
|
|
19
19
|
|
|
20
20
|
setuptools.setup(
|
|
21
21
|
name="myldapsync",
|
|
22
|
-
version="1.0.
|
|
22
|
+
version="1.0.3",
|
|
23
23
|
author="Artur Lebedev",
|
|
24
24
|
author_email="ras_atari@mail.ru",
|
|
25
|
-
description="Synchronise LDAP users to MySQL",
|
|
25
|
+
description="Synchronise LDAP users to MySQL and MariaDB",
|
|
26
26
|
license='MySQL',
|
|
27
27
|
long_description=long_description,
|
|
28
28
|
long_description_content_type="text/markdown",
|
|
29
29
|
url="https://github.com/6eh01der/myldapsync",
|
|
30
30
|
packages=setuptools.find_packages(),
|
|
31
31
|
install_requires=required,
|
|
32
|
-
python_requires='>=3.
|
|
32
|
+
python_requires='>=3.8',
|
|
33
33
|
classifiers=[
|
|
34
34
|
'Programming Language :: Python :: 3',
|
|
35
|
-
'Programming Language :: Python :: 3.7',
|
|
36
35
|
'Programming Language :: Python :: 3.8',
|
|
37
36
|
'Programming Language :: Python :: 3.9',
|
|
38
37
|
'Programming Language :: Python :: 3.10',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|