ldap-ui 0.9.10__py3-none-any.whl → 0.9.12__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.9.10"
1
+ __version__ = "0.9.12"
ldap_ui/__main__.py CHANGED
@@ -23,14 +23,14 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
23
23
  "--base-dn",
24
24
  type=str,
25
25
  default=settings.BASE_DN,
26
- help="LDAP base DN (required). [default: BASE_DN environment variable]",
26
+ help="LDAP base DN. [default: Detect from root DSE]",
27
27
  )
28
28
  @click.option(
29
29
  "-h",
30
30
  "--host",
31
31
  type=str,
32
32
  default="127.0.0.1",
33
- help="Bind socket to this host.",
33
+ help="Bind socket to this IP.",
34
34
  show_default=True,
35
35
  )
36
36
  @click.option(
@@ -38,21 +38,23 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
38
38
  "--port",
39
39
  type=int,
40
40
  default=5000,
41
- help="Bind socket to this port. If 0, an available port will be picked.",
41
+ help="Bind socket to this port (or 0 for any available port).",
42
42
  show_default=True,
43
43
  )
44
44
  @click.option(
45
45
  "-u",
46
46
  "--ldap-url",
47
47
  type=str,
48
- help="LDAP directory connection URL. [default: LDAP_URL environment variable or 'ldap:///']",
48
+ default=settings.LDAP_URL,
49
+ help="LDAP directory connection URL.",
50
+ show_default=True,
49
51
  )
50
52
  @click.option(
51
53
  "-l",
52
54
  "--log-level",
53
55
  type=LEVEL_CHOICES,
54
56
  default="info",
55
- help="Log level. [default: info]",
57
+ help="Log level.",
56
58
  show_default=True,
57
59
  )
58
60
  @click.option(
ldap_ui/settings.py CHANGED
@@ -14,7 +14,20 @@ SECRET_KEY = os.urandom(16)
14
14
  # LDAP settings
15
15
  #
16
16
  LDAP_URL = config("LDAP_URL", default="ldap:///")
17
- BASE_DN = config("BASE_DN", default=None) # Required
17
+
18
+ # Directory base DN.
19
+ # If unset, auto-detection from the root DSE is attempted.
20
+ # This works under the following conditions:
21
+ # - The root DSE is readable with anonymous binding
22
+ # - `namingContexts` contains exactly one entry
23
+ # Otherwise, manual configuration is required.
24
+ BASE_DN = config("BASE_DN", default=None)
25
+
26
+ # DN to obtain the directory schema.
27
+ # If unset, auto-detection from the root DSE is attempted.
28
+ # This works if root DSE is readable with anonymous binding.
29
+ # Otherwise, manual configuration is required.
30
+ SCHEMA_DN = config("SCHEMA_DN", default=None)
18
31
 
19
32
  USE_TLS = config(
20
33
  "USE_TLS",
@@ -29,11 +42,6 @@ INSECURE_TLS = config(
29
42
  default=False,
30
43
  )
31
44
 
32
- # OpenLdap default DN to obtain the schema.
33
- # Change as needed for other directories.
34
- SCHEMA_DN = config("SCHEMA_DN", default=None)
35
-
36
-
37
45
  #
38
46
  # Binding
39
47
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ldap-ui
3
- Version: 0.9.10
3
+ Version: 0.9.12
4
4
  Summary: A fast and versatile LDAP editor
5
5
  Author: dnknth
6
6
  License: MIT License
@@ -44,14 +44,22 @@ The app always requires authentication, even if the directory permits anonymous
44
44
 
45
45
  ### Environment variables
46
46
 
47
- LDAP access is controlled by these environment variables, possibly from a `.env` file:
47
+ LDAP access is controlled by the following optional environment variables, possibly from a `.env` file:
48
48
 
49
- * `LDAP_URL` (optional): Connection URL, defaults to `ldap:///`.
50
- * `BASE_DN` (required): Search base, e.g. `dc=example,dc=org`.
51
- * `LOGIN_ATTR` (optional): User name attribute, defaults to `uid`.
49
+ * `LDAP_URL`: Connection URL, defaults to `ldap:///`.
50
+ * `BASE_DN`: Search base, e.g. `dc=example,dc=org`.
51
+ * `SCHEMA_DN`: # DN to obtain the directory schema, e.g. `cn=subSchema`.
52
+ * `LOGIN_ATTR`: User name attribute, defaults to `uid`.
52
53
 
53
- * `USE_TLS` (optional): Enable TLS, defaults to true for `ldaps` connections. Set it to a non-empty string to force `STARTTLS` on `ldap` connections.
54
- * `INSECURE_TLS` (optional): Do not require a valid server TLS certificate, defaults to false, implies `USE_TLS`.
54
+ * `USE_TLS`: Enable TLS, defaults to true for `ldaps` connections. Set it to a non-empty string to force `STARTTLS` on `ldap` connections.
55
+ * `INSECURE_TLS`: Do not require a valid server TLS certificate, defaults to false, implies `USE_TLS`.
56
+
57
+ if `BASE_DN` or `SCHEMA_DN` are not provided explicitly, auto-detection from the root DSE is attempted.
58
+ For this to work, the root DSE must be readable anonymously, e.g. with the following ACL line for OpenLDAP:
59
+
60
+ ```text
61
+ access to dn.base="" by * read
62
+ ```
55
63
 
56
64
  For finer-grained control, see [settings.py](settings.py).
57
65
 
@@ -61,8 +69,7 @@ For the impatient: Run it with
61
69
 
62
70
  ```shell
63
71
  docker run -p 127.0.0.1:5000:5000 \
64
- -e LDAP_URL=ldap://your.ldap.server/ \
65
- -e BASE_DN=dc=example,dc=org dnknth/ldap-ui
72
+ -e LDAP_URL=ldap://your.openldap.server/
66
73
  ```
67
74
 
68
75
  For the even more impatient: Start a demo with
@@ -143,7 +150,8 @@ Additionally, arbitrary attributes can be searched with an LDAP filter specifica
143
150
 
144
151
  ### Caveats
145
152
 
146
- * The software works with [OpenLdap](http://www.openldap.org) using simple bind. Other directories have not been tested, and SASL authentication schemes are presently not supported.
153
+ * The software works with [OpenLdap](http://www.openldap.org) using simple bind. Other directories have not been tested much, although [389 DS](https://www.port389.org) works to some extent.
154
+ * SASL authentication schemes are presently not supported.
147
155
  * Passwords are transmitted as plain text. The LDAP server is expected to hash them (OpenLdap 2.4 does). I strongly recommend to expose the app through a TLS-enabled web server.
148
156
  * HTTP *Basic Authentication* is triggered unless the `AUTHORIZATION` request variable is already set by some upstream HTTP server.
149
157
 
@@ -1,10 +1,10 @@
1
- ldap_ui/__init__.py,sha256=5nY2lKMmQwtU8FXTQ2Qpv9EUNfy2UJF9cHFr82n7ARw,23
2
- ldap_ui/__main__.py,sha256=s2jFbC2y2LpvcTY8yXOFVisKXSFG079hc9IVgrJ49vY,1849
1
+ ldap_ui/__init__.py,sha256=XR5b9xrEQYlPbzUgeAtHjn10uKetzrpCdRIvgcGJkoI,23
2
+ ldap_ui/__main__.py,sha256=SfpNGw1tlunqLobN8T-7GT47BQBw_c9gO2ANgXkNO9U,1802
3
3
  ldap_ui/app.py,sha256=eLRed3iVyrE56CeYBmE0nW09LKh_3Ztc1_ZON37dv8Q,8161
4
4
  ldap_ui/ldap_api.py,sha256=j8llIyXkd51g-MDHtN-9XyUvVS8Z_wvQb9Z7uTMyoNU,15897
5
5
  ldap_ui/ldap_helpers.py,sha256=1Sq2hwndwzETb3cPpCoHBF8r-JmAaWh87-Pl2inZRy8,3675
6
6
  ldap_ui/schema.py,sha256=LNIHTlkcJYPdtZ0RZ9a_-KejVGWCGuMwtDDD8tSaprY,4515
7
- ldap_ui/settings.py,sha256=fN5QtB9Sv3UYF3tJX6M1yKClMSxvA332z2FckAonM14,2466
7
+ ldap_ui/settings.py,sha256=UjCB24epLLUF0ECLb5MulfHPNGjEG57ZS2HXVFJ_k3Y,2844
8
8
  ldap_ui/statics/favicon.ico,sha256=_PMMM_C1ER5cpJTXZcRgISR4igj44kA4u8Trl-Ko3L0,4286
9
9
  ldap_ui/statics/index.html,sha256=_QF-25WH6wEK2MfhAmccRRlzpbk8btozMhhct9ro-do,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-BOlMrt1N.js,sha256=GpM_tl2FLHwau7eFtlh82sN3x_YhjemR
16
16
  ldap_ui/statics/assets/index-BOlMrt1N.js.gz,sha256=8LOcgG-YTp4c0kCIw9QzQzM59a_PlRy7eBOhTnHsmvY,43711
17
17
  ldap_ui/statics/assets/index-Cw9TEv0d.css,sha256=sa0JhzpsjJhP3Bi2nJpG6Shn3yKI9hl_7I9kVY5E3Zs,48119
18
18
  ldap_ui/statics/assets/index-Cw9TEv0d.css.gz,sha256=qE_XQEa7HH54vGvQR78l5eeTcXVWmiqU_d7Go80X_S0,11533
19
- ldap_ui-0.9.10.dist-info/LICENSE.txt,sha256=UpJ0sDIqHxbOtzy1EG4bCHs9R_99ODxxPDK4NZ0g3I0,1042
20
- ldap_ui-0.9.10.dist-info/METADATA,sha256=4A3XwREZ64eKsx7Vnlrlj37i0FobwDWmDkKl8coTawE,7558
21
- ldap_ui-0.9.10.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
22
- ldap_ui-0.9.10.dist-info/entry_points.txt,sha256=TGxMkXYeZP5m5NjZxWmgzITYWhSdj2mR_GGUYmHhGws,50
23
- ldap_ui-0.9.10.dist-info/top_level.txt,sha256=t9Agyig1nDdJuQvx_UVuk1n28pgswc1BIYw8E6pWado,8
24
- ldap_ui-0.9.10.dist-info/RECORD,,
19
+ ldap_ui-0.9.12.dist-info/LICENSE.txt,sha256=UpJ0sDIqHxbOtzy1EG4bCHs9R_99ODxxPDK4NZ0g3I0,1042
20
+ ldap_ui-0.9.12.dist-info/METADATA,sha256=eoyA_Dg-5C0p8ljotFliDeeWSnzLDzbVnzbzqQab8xU,7872
21
+ ldap_ui-0.9.12.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
22
+ ldap_ui-0.9.12.dist-info/entry_points.txt,sha256=TGxMkXYeZP5m5NjZxWmgzITYWhSdj2mR_GGUYmHhGws,50
23
+ ldap_ui-0.9.12.dist-info/top_level.txt,sha256=t9Agyig1nDdJuQvx_UVuk1n28pgswc1BIYw8E6pWado,8
24
+ ldap_ui-0.9.12.dist-info/RECORD,,