ldap-ui 0.9.1__py3-none-any.whl → 0.9.2__py3-none-any.whl
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.
- ldap_ui/__init__.py +1 -14
- ldap_ui/__main__.py +67 -2
- ldap_ui/app.py +6 -1
- ldap_ui/settings.py +1 -1
- {ldap_ui-0.9.1.dist-info → ldap_ui-0.9.2.dist-info}/METADATA +2 -2
- {ldap_ui-0.9.1.dist-info → ldap_ui-0.9.2.dist-info}/RECORD +10 -10
- ldap_ui-0.9.2.dist-info/entry_points.txt +2 -0
- ldap_ui-0.9.1.dist-info/entry_points.txt +0 -2
- {ldap_ui-0.9.1.dist-info → ldap_ui-0.9.2.dist-info}/LICENSE.txt +0 -0
- {ldap_ui-0.9.1.dist-info → ldap_ui-0.9.2.dist-info}/WHEEL +0 -0
- {ldap_ui-0.9.1.dist-info → ldap_ui-0.9.2.dist-info}/top_level.txt +0 -0
ldap_ui/__init__.py
CHANGED
ldap_ui/__main__.py
CHANGED
|
@@ -1,4 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
import click
|
|
2
|
+
import uvicorn
|
|
3
|
+
from uvicorn.main import LEVEL_CHOICES
|
|
4
|
+
|
|
5
|
+
import ldap_ui
|
|
6
|
+
|
|
7
|
+
from . import settings
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> None:
|
|
11
|
+
if value:
|
|
12
|
+
click.echo(ldap_ui.__version__)
|
|
13
|
+
ctx.exit()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@click.command()
|
|
17
|
+
@click.option(
|
|
18
|
+
"-h",
|
|
19
|
+
"--host",
|
|
20
|
+
type=str,
|
|
21
|
+
default="127.0.0.1",
|
|
22
|
+
help="Bind socket to this host.",
|
|
23
|
+
show_default=True,
|
|
24
|
+
)
|
|
25
|
+
@click.option(
|
|
26
|
+
"-b",
|
|
27
|
+
"--base-dn",
|
|
28
|
+
type=str,
|
|
29
|
+
default=settings.BASE_DN,
|
|
30
|
+
help="LDAP base DN. Required unless the BASE_DN environment variable is set.",
|
|
31
|
+
)
|
|
32
|
+
@click.option(
|
|
33
|
+
"-p",
|
|
34
|
+
"--port",
|
|
35
|
+
type=int,
|
|
36
|
+
default=5000,
|
|
37
|
+
help="Bind socket to this port. If 0, an available port will be picked.",
|
|
38
|
+
show_default=True,
|
|
39
|
+
)
|
|
40
|
+
@click.option(
|
|
41
|
+
"-l",
|
|
42
|
+
"--log-level",
|
|
43
|
+
type=LEVEL_CHOICES,
|
|
44
|
+
default=None,
|
|
45
|
+
help="Log level. [default: info]",
|
|
46
|
+
show_default=True,
|
|
47
|
+
)
|
|
48
|
+
@click.option(
|
|
49
|
+
"--version",
|
|
50
|
+
is_flag=True,
|
|
51
|
+
callback=print_version,
|
|
52
|
+
expose_value=False,
|
|
53
|
+
is_eager=True,
|
|
54
|
+
help="Display the current version and exit.",
|
|
55
|
+
)
|
|
56
|
+
def main(base_dn, host, port, log_level):
|
|
57
|
+
if base_dn:
|
|
58
|
+
settings.BASE_DN = base_dn
|
|
59
|
+
|
|
60
|
+
uvicorn.run(
|
|
61
|
+
"ldap_ui.app:app",
|
|
62
|
+
log_level=log_level,
|
|
63
|
+
host=host,
|
|
64
|
+
port=port,
|
|
65
|
+
)
|
|
66
|
+
|
|
2
67
|
|
|
3
68
|
if __name__ == "__main__":
|
|
4
|
-
|
|
69
|
+
main()
|
ldap_ui/app.py
CHANGED
|
@@ -11,10 +11,11 @@ No sessions, no cookies, nothing else.
|
|
|
11
11
|
import base64
|
|
12
12
|
import binascii
|
|
13
13
|
import contextlib
|
|
14
|
+
import logging
|
|
15
|
+
import sys
|
|
14
16
|
from typing import AsyncGenerator
|
|
15
17
|
|
|
16
18
|
import ldap
|
|
17
|
-
import uvicorn
|
|
18
19
|
from ldap.schema import SubSchema
|
|
19
20
|
from starlette.applications import Starlette
|
|
20
21
|
from starlette.authentication import (
|
|
@@ -37,6 +38,10 @@ from . import settings
|
|
|
37
38
|
from .ldap_api import api
|
|
38
39
|
from .ldap_helpers import WITH_OPERATIONAL_ATTRS, empty, ldap_connect, unique
|
|
39
40
|
|
|
41
|
+
if settings.BASE_DN is None:
|
|
42
|
+
logging.getLogger("ldap-ui").critical("An LDAP base DN is required!")
|
|
43
|
+
sys.exit(1)
|
|
44
|
+
|
|
40
45
|
# Force authentication
|
|
41
46
|
UNAUTHORIZED = Response(
|
|
42
47
|
"Invalid credentials",
|
ldap_ui/settings.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ldap-ui
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: A fast and versatile LDAP editor
|
|
5
5
|
Author: dnknth
|
|
6
6
|
License: MIT License
|
|
@@ -12,7 +12,7 @@ Classifier: Development Status :: 4 - Beta
|
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
14
|
Classifier: Topic :: Software Development :: Libraries
|
|
15
|
-
Requires-Python: >=3.
|
|
15
|
+
Requires-Python: >=3.7
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE.txt
|
|
18
18
|
Requires-Dist: python-ldap
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
ldap_ui/__init__.py,sha256=
|
|
2
|
-
ldap_ui/__main__.py,sha256=
|
|
3
|
-
ldap_ui/app.py,sha256=
|
|
1
|
+
ldap_ui/__init__.py,sha256=gqT-BGoeEItda9fICQDvLbxEjWRIBhFJxPxxKvmHLUo,22
|
|
2
|
+
ldap_ui/__main__.py,sha256=XEW0IGh-BZ0MUnzHmLRgnqSee8r0o_oRgcQ_8WSNC0g,1345
|
|
3
|
+
ldap_ui/app.py,sha256=8iYzv92zl6XeqeF8JjaYT-68wgYSrcsq9CQK0O0bsCE,6443
|
|
4
4
|
ldap_ui/ldap_api.py,sha256=ecK8K-7-tkoA2df2dbQT8y61I70r7NukE3BQFNN1BsE,12776
|
|
5
5
|
ldap_ui/ldap_helpers.py,sha256=DRpKtqEX_OvYJBuvzTNi0CcZAu446wwUiOezlkBAxrQ,3045
|
|
6
6
|
ldap_ui/schema.py,sha256=apbdLK_WpED0IzmrdktWTu4ESz8GfdOoJuRicFC84YY,3327
|
|
7
|
-
ldap_ui/settings.py,sha256=
|
|
7
|
+
ldap_ui/settings.py,sha256=PmugPMAmFmNa3bM4XKsur89ELORZ103DxrP7ZbsuopY,2260
|
|
8
8
|
ldap_ui/statics/favicon.ico,sha256=_PMMM_C1ER5cpJTXZcRgISR4igj44kA4u8Trl-Ko3L0,4286
|
|
9
9
|
ldap_ui/statics/index.html,sha256=twUC90MNTfNFpQLiLIwUuU3H6RRDiPY92BnMRgIGRWU,827
|
|
10
10
|
ldap_ui/statics/assets/fontawesome-webfont-B-jkhYfk.woff2,sha256=Kt78vAQefRj88tQXh53FoJmXqmTWdbejxLbOM9oT8_4,77160
|
|
@@ -16,9 +16,9 @@ ldap_ui/statics/assets/index-CA45Sb-q.js,sha256=qejoldzV9wbUVar1ljURYwyTb2DYn3HQ
|
|
|
16
16
|
ldap_ui/statics/assets/index-CA45Sb-q.js.gz,sha256=1yJTHdcLZLU2d6DkPKbmNEFiOlPo7vIWXYyg_fidSdE,43710
|
|
17
17
|
ldap_ui/statics/assets/index-DlTKbnmq.css,sha256=Rpthz_HvUybqmodfPCnOXFsSwGd7v8hhh-p-duAzf1E,48119
|
|
18
18
|
ldap_ui/statics/assets/index-DlTKbnmq.css.gz,sha256=Ctq3hMh_BBVt9zsh9CYlHpVtDDHanicyGPAdcGXIFXw,11532
|
|
19
|
-
ldap_ui-0.9.
|
|
20
|
-
ldap_ui-0.9.
|
|
21
|
-
ldap_ui-0.9.
|
|
22
|
-
ldap_ui-0.9.
|
|
23
|
-
ldap_ui-0.9.
|
|
24
|
-
ldap_ui-0.9.
|
|
19
|
+
ldap_ui-0.9.2.dist-info/LICENSE.txt,sha256=UpJ0sDIqHxbOtzy1EG4bCHs9R_99ODxxPDK4NZ0g3I0,1042
|
|
20
|
+
ldap_ui-0.9.2.dist-info/METADATA,sha256=7NuYPD10C_50VRimJO-besonFetFEETpZmdFm13MSEg,6824
|
|
21
|
+
ldap_ui-0.9.2.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
22
|
+
ldap_ui-0.9.2.dist-info/entry_points.txt,sha256=TGxMkXYeZP5m5NjZxWmgzITYWhSdj2mR_GGUYmHhGws,50
|
|
23
|
+
ldap_ui-0.9.2.dist-info/top_level.txt,sha256=t9Agyig1nDdJuQvx_UVuk1n28pgswc1BIYw8E6pWado,8
|
|
24
|
+
ldap_ui-0.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|