airflow-ldap-auth-manager 0.1.0__tar.gz → 0.1.1__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.
Files changed (15) hide show
  1. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/PKG-INFO +10 -4
  2. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/README.md +9 -3
  3. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/pyproject.toml +1 -1
  4. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager/ldap_auth_manager.py +11 -5
  5. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager/templates/ldap_login.html +1 -1
  6. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager.egg-info/PKG-INFO +10 -4
  7. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/LICENSE +0 -0
  8. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/setup.cfg +0 -0
  9. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager/__init__.py +0 -0
  10. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager/static/airflow.svg +0 -0
  11. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager/static/style.css +0 -0
  12. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager.egg-info/SOURCES.txt +0 -0
  13. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager.egg-info/dependency_links.txt +0 -0
  14. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager.egg-info/requires.txt +0 -0
  15. {airflow_ldap_auth_manager-0.1.0 → airflow_ldap_auth_manager-0.1.1}/src/airflow_ldap_auth_manager.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: airflow-ldap-auth-manager
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: LDAP-based AuthManager for Apache Airflow 3.x
5
5
  Author-email: Emre Can <emredjan@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -76,7 +76,7 @@ Changes needed in `airflow.cfg`:
76
76
  ```ini
77
77
  [core]
78
78
  # Fully qualified path to the auth manager class in this repo
79
- auth_manager = airflow_ldap_auth_manager.LDAPAuthManager
79
+ auth_manager = airflow_ldap_auth_manager.LdapAuthManager
80
80
  ```
81
81
 
82
82
 
@@ -140,7 +140,7 @@ Restart the api-server after changes.
140
140
 
141
141
  ``` ini
142
142
  [ldap_auth_manager]
143
- # LDAP authentication/authorization settings for LDAPAuthManager.
143
+ # LDAP authentication/authorization settings for LdapAuthManager.
144
144
  # This section supports multiple redundant servers, secure transport (LDAPS or StartTLS),
145
145
  # and secret indirection for bind credentials via Airflow’s Secrets Backend.
146
146
 
@@ -283,11 +283,17 @@ logout_redirect = /
283
283
  #
284
284
  debug_logging = false
285
285
 
286
- # Optional login hint shown under "Sign in". Leave empty to hide.
286
+ # Optional login hint shown under "Sign in" title. Leave empty to hide.
287
287
  #
288
288
  # Variable: AIRFLOW__LDAP_AUTH_MANAGER__LOGIN_TIP
289
289
  #
290
290
  login_tip = Using your Company credentials
291
+
292
+ # Optional override to the support hint shown under the "Sign in" button.
293
+ #
294
+ # Variable: AIRFLOW__LDAP_AUTH_MANAGER__SUPPORT_TIP
295
+ #
296
+ support_tip = Having issues? Raise a ticket to the helpdesk.
291
297
  ```
292
298
 
293
299
 
@@ -54,7 +54,7 @@ Changes needed in `airflow.cfg`:
54
54
  ```ini
55
55
  [core]
56
56
  # Fully qualified path to the auth manager class in this repo
57
- auth_manager = airflow_ldap_auth_manager.LDAPAuthManager
57
+ auth_manager = airflow_ldap_auth_manager.LdapAuthManager
58
58
  ```
59
59
 
60
60
 
@@ -118,7 +118,7 @@ Restart the api-server after changes.
118
118
 
119
119
  ``` ini
120
120
  [ldap_auth_manager]
121
- # LDAP authentication/authorization settings for LDAPAuthManager.
121
+ # LDAP authentication/authorization settings for LdapAuthManager.
122
122
  # This section supports multiple redundant servers, secure transport (LDAPS or StartTLS),
123
123
  # and secret indirection for bind credentials via Airflow’s Secrets Backend.
124
124
 
@@ -261,11 +261,17 @@ logout_redirect = /
261
261
  #
262
262
  debug_logging = false
263
263
 
264
- # Optional login hint shown under "Sign in". Leave empty to hide.
264
+ # Optional login hint shown under "Sign in" title. Leave empty to hide.
265
265
  #
266
266
  # Variable: AIRFLOW__LDAP_AUTH_MANAGER__LOGIN_TIP
267
267
  #
268
268
  login_tip = Using your Company credentials
269
+
270
+ # Optional override to the support hint shown under the "Sign in" button.
271
+ #
272
+ # Variable: AIRFLOW__LDAP_AUTH_MANAGER__SUPPORT_TIP
273
+ #
274
+ support_tip = Having issues? Raise a ticket to the helpdesk.
269
275
  ```
270
276
 
271
277
 
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "airflow-ldap-auth-manager"
8
- version = "0.1.0"
8
+ version = "0.1.1"
9
9
  description = "LDAP-based AuthManager for Apache Airflow 3.x"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.9"
@@ -1,5 +1,5 @@
1
1
  """
2
- LDAPAuthManager for Apache Airflow 3.1+
2
+ LdapAuthManager for Apache Airflow 3.1+
3
3
 
4
4
  Key notes:
5
5
  * Implements all abstract methods from BaseAuthManager, including
@@ -329,8 +329,8 @@ class LdapAuthManager(BaseAuthManager[LdapUser]):
329
329
  return f"/auth/login?next={next_url}"
330
330
 
331
331
  def get_url_logout(self) -> Optional[str]:
332
- """Return the configured logout redirect target."""
333
- return conf.get("ldap_auth_manager", "logout_redirect", fallback="/")
332
+ """Return the auth manager logout endpoint."""
333
+ return "/auth/logout"
334
334
 
335
335
  @override
336
336
  def serialize_user(self, user: LdapUser) -> dict:
@@ -442,6 +442,9 @@ class LdapAuthManager(BaseAuthManager[LdapUser]):
442
442
  - If write_scope == "dag_run" (or DagAccessEntity.DAG_RUN), Editor+
443
443
  - Else Admin only
444
444
  """
445
+ if not user:
446
+ return False
447
+
445
448
  role = self._policy.role_for(user.groups)
446
449
  if role == Role.NONE:
447
450
  return False # deny outright
@@ -582,8 +585,9 @@ class LdapAuthManager(BaseAuthManager[LdapUser]):
582
585
 
583
586
  instance_name = conf.get("api", "instance_name", fallback="Airflow")
584
587
  login_tip = conf.get("ldap_auth_manager", "login_tip", fallback="")
588
+ support_tip = conf.get("ldap_auth_manager", "support_tip", fallback="Having issues? Contact your admin.")
585
589
 
586
- jinja_env.globals.update(instance_name=instance_name, login_tip=login_tip)
590
+ jinja_env.globals.update(instance_name=instance_name, login_tip=login_tip, support_tip=support_tip)
587
591
 
588
592
  def render(name: str, **ctx) -> HTMLResponse:
589
593
  """Render ``name`` with the provided context."""
@@ -717,7 +721,9 @@ class LdapAuthManager(BaseAuthManager[LdapUser]):
717
721
  target = _sanitize_next(next_param, request) # type: ignore[arg-type]
718
722
  resp = RedirectResponse(url=target or "/", status_code=303)
719
723
  secure = (request.base_url.scheme == "https") or bool(conf.get("api", "ssl_cert", fallback=""))
720
- resp.set_cookie(COOKIE_NAME_JWT_TOKEN, token, secure=secure, httponly=False, samesite="lax", path="/")
724
+ resp.set_cookie(
725
+ COOKIE_NAME_JWT_TOKEN, token, secure=secure, httponly=False, samesite='lax', path='/', max_age=exp_secs
726
+ )
721
727
  return resp
722
728
 
723
729
  @router.get("/logout")
@@ -33,7 +33,7 @@
33
33
  <button type="submit">Sign in</button>
34
34
  </div>
35
35
  </form>
36
- <div class="foot almost-hidden">Having issues? Contact your admin.</div>
36
+ <div class="foot almost-hidden">{{ support_tip }}</div>
37
37
  </div>
38
38
  </div>
39
39
  <script>try{document.getElementById('username').focus()}catch(e){}</script>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: airflow-ldap-auth-manager
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: LDAP-based AuthManager for Apache Airflow 3.x
5
5
  Author-email: Emre Can <emredjan@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -76,7 +76,7 @@ Changes needed in `airflow.cfg`:
76
76
  ```ini
77
77
  [core]
78
78
  # Fully qualified path to the auth manager class in this repo
79
- auth_manager = airflow_ldap_auth_manager.LDAPAuthManager
79
+ auth_manager = airflow_ldap_auth_manager.LdapAuthManager
80
80
  ```
81
81
 
82
82
 
@@ -140,7 +140,7 @@ Restart the api-server after changes.
140
140
 
141
141
  ``` ini
142
142
  [ldap_auth_manager]
143
- # LDAP authentication/authorization settings for LDAPAuthManager.
143
+ # LDAP authentication/authorization settings for LdapAuthManager.
144
144
  # This section supports multiple redundant servers, secure transport (LDAPS or StartTLS),
145
145
  # and secret indirection for bind credentials via Airflow’s Secrets Backend.
146
146
 
@@ -283,11 +283,17 @@ logout_redirect = /
283
283
  #
284
284
  debug_logging = false
285
285
 
286
- # Optional login hint shown under "Sign in". Leave empty to hide.
286
+ # Optional login hint shown under "Sign in" title. Leave empty to hide.
287
287
  #
288
288
  # Variable: AIRFLOW__LDAP_AUTH_MANAGER__LOGIN_TIP
289
289
  #
290
290
  login_tip = Using your Company credentials
291
+
292
+ # Optional override to the support hint shown under the "Sign in" button.
293
+ #
294
+ # Variable: AIRFLOW__LDAP_AUTH_MANAGER__SUPPORT_TIP
295
+ #
296
+ support_tip = Having issues? Raise a ticket to the helpdesk.
291
297
  ```
292
298
 
293
299