airflow-file-auth-manager 0.1.1__tar.gz → 0.1.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.
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/PKG-INFO +10 -5
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/README.md +4 -2
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/pyproject.toml +6 -3
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/endpoints.py +3 -3
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/file_auth_manager.py +5 -5
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/policy.py +3 -3
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/templates/login.html +1 -1
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/.gitignore +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/LICENSE +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/examples/users.yaml +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/__init__.py +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/cli.py +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/password.py +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/static/styles.css +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/user.py +0 -0
- {airflow_file_auth_manager-0.1.1 → airflow_file_auth_manager-0.1.3}/src/airflow_file_auth_manager/user_store.py +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: airflow-file-auth-manager
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: YAML file-based lightweight Auth Manager for Apache Airflow 3.x
|
|
5
|
-
Project-URL: Homepage, https://github.com/
|
|
6
|
-
Project-URL: Repository, https://github.com/
|
|
5
|
+
Project-URL: Homepage, https://github.com/choo121600/airflow-file-auth-manager
|
|
6
|
+
Project-URL: Repository, https://github.com/choo121600/airflow-file-auth-manager
|
|
7
|
+
Project-URL: Documentation, https://github.com/choo121600/airflow-file-auth-manager#readme
|
|
8
|
+
Project-URL: Issues, https://github.com/choo121600/airflow-file-auth-manager/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/choo121600/airflow-file-auth-manager/releases
|
|
7
10
|
Author-email: Yeonguk <yeonguk@example.com>
|
|
8
11
|
License-Expression: Apache-2.0
|
|
9
12
|
License-File: LICENSE
|
|
@@ -28,9 +31,11 @@ Description-Content-Type: text/markdown
|
|
|
28
31
|
|
|
29
32
|
A lightweight YAML file-based Auth Manager for Apache Airflow 3.x
|
|
30
33
|
|
|
34
|
+
[](https://pypi.org/project/airflow-file-auth-manager/)
|
|
31
35
|
[](https://www.python.org/downloads/)
|
|
32
36
|
[](https://airflow.apache.org/)
|
|
33
37
|
[](LICENSE)
|
|
38
|
+
[](https://github.com/choo121600/airflow-file-auth-manager/actions/workflows/ci.yml)
|
|
34
39
|
|
|
35
40
|
## Overview
|
|
36
41
|
|
|
@@ -47,7 +52,7 @@ A lightweight YAML file-based Auth Manager for Apache Airflow 3.x
|
|
|
47
52
|
|
|
48
53
|
## Installation
|
|
49
54
|
|
|
50
|
-
### From PyPI
|
|
55
|
+
### From PyPI
|
|
51
56
|
|
|
52
57
|
```bash
|
|
53
58
|
pip install airflow-file-auth-manager
|
|
@@ -56,7 +61,7 @@ pip install airflow-file-auth-manager
|
|
|
56
61
|
### From Source
|
|
57
62
|
|
|
58
63
|
```bash
|
|
59
|
-
git clone https://github.com/
|
|
64
|
+
git clone https://github.com/choo121600/airflow-file-auth-manager.git
|
|
60
65
|
cd airflow-file-auth-manager
|
|
61
66
|
pip install -e .
|
|
62
67
|
```
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
A lightweight YAML file-based Auth Manager for Apache Airflow 3.x
|
|
4
4
|
|
|
5
|
+
[](https://pypi.org/project/airflow-file-auth-manager/)
|
|
5
6
|
[](https://www.python.org/downloads/)
|
|
6
7
|
[](https://airflow.apache.org/)
|
|
7
8
|
[](LICENSE)
|
|
9
|
+
[](https://github.com/choo121600/airflow-file-auth-manager/actions/workflows/ci.yml)
|
|
8
10
|
|
|
9
11
|
## Overview
|
|
10
12
|
|
|
@@ -21,7 +23,7 @@ A lightweight YAML file-based Auth Manager for Apache Airflow 3.x
|
|
|
21
23
|
|
|
22
24
|
## Installation
|
|
23
25
|
|
|
24
|
-
### From PyPI
|
|
26
|
+
### From PyPI
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
29
|
pip install airflow-file-auth-manager
|
|
@@ -30,7 +32,7 @@ pip install airflow-file-auth-manager
|
|
|
30
32
|
### From Source
|
|
31
33
|
|
|
32
34
|
```bash
|
|
33
|
-
git clone https://github.com/
|
|
35
|
+
git clone https://github.com/choo121600/airflow-file-auth-manager.git
|
|
34
36
|
cd airflow-file-auth-manager
|
|
35
37
|
pip install -e .
|
|
36
38
|
```
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "airflow-file-auth-manager"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "YAML file-based lightweight Auth Manager for Apache Airflow 3.x"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -36,8 +36,11 @@ dev = [
|
|
|
36
36
|
]
|
|
37
37
|
|
|
38
38
|
[project.urls]
|
|
39
|
-
Homepage = "https://github.com/
|
|
40
|
-
Repository = "https://github.com/
|
|
39
|
+
Homepage = "https://github.com/choo121600/airflow-file-auth-manager"
|
|
40
|
+
Repository = "https://github.com/choo121600/airflow-file-auth-manager"
|
|
41
|
+
Documentation = "https://github.com/choo121600/airflow-file-auth-manager#readme"
|
|
42
|
+
Issues = "https://github.com/choo121600/airflow-file-auth-manager/issues"
|
|
43
|
+
Changelog = "https://github.com/choo121600/airflow-file-auth-manager/releases"
|
|
41
44
|
|
|
42
45
|
[project.entry-points."airflow.auth.manager"]
|
|
43
46
|
file_auth_manager = "airflow_file_auth_manager:FileAuthManager"
|
|
@@ -97,7 +97,7 @@ def create_auth_app(auth_manager: FileAuthManager) -> FastAPI:
|
|
|
97
97
|
logger.warning("AUDIT: Login attempt with missing credentials")
|
|
98
98
|
if is_form_submission:
|
|
99
99
|
return RedirectResponse(
|
|
100
|
-
url="/auth/
|
|
100
|
+
url="/auth/login?error=Username+and+password+required",
|
|
101
101
|
status_code=303,
|
|
102
102
|
)
|
|
103
103
|
return JSONResponse(
|
|
@@ -112,7 +112,7 @@ def create_auth_app(auth_manager: FileAuthManager) -> FastAPI:
|
|
|
112
112
|
username, request.client.host if request.client else "unknown")
|
|
113
113
|
if is_form_submission:
|
|
114
114
|
return RedirectResponse(
|
|
115
|
-
url="/auth/
|
|
115
|
+
url="/auth/login?error=Invalid+username+or+password",
|
|
116
116
|
status_code=303,
|
|
117
117
|
)
|
|
118
118
|
return JSONResponse(
|
|
@@ -167,7 +167,7 @@ def create_auth_app(auth_manager: FileAuthManager) -> FastAPI:
|
|
|
167
167
|
logger.info("AUDIT: User logged out (IP: %s)",
|
|
168
168
|
request.client.host if request.client else "unknown")
|
|
169
169
|
|
|
170
|
-
redirect_response = RedirectResponse(url="/auth/
|
|
170
|
+
redirect_response = RedirectResponse(url="/auth/login", status_code=303)
|
|
171
171
|
redirect_response.delete_cookie(key="airflow_jwt")
|
|
172
172
|
return redirect_response
|
|
173
173
|
|
|
@@ -7,7 +7,7 @@ from functools import cached_property
|
|
|
7
7
|
from typing import TYPE_CHECKING, Any, Sequence
|
|
8
8
|
from urllib.parse import urlencode
|
|
9
9
|
|
|
10
|
-
from airflow.auth.managers.base_auth_manager import BaseAuthManager, ResourceMethod
|
|
10
|
+
from airflow.api_fastapi.auth.managers.base_auth_manager import BaseAuthManager, ResourceMethod
|
|
11
11
|
from airflow.configuration import conf
|
|
12
12
|
|
|
13
13
|
from airflow_file_auth_manager.policy import FileAuthPolicy, Role
|
|
@@ -17,8 +17,8 @@ from airflow_file_auth_manager.user_store import UserStore
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
18
|
from fastapi import FastAPI
|
|
19
19
|
|
|
20
|
-
from airflow.auth.managers.models.base_user import BaseUser
|
|
21
|
-
from airflow.auth.managers.models.resource_details import (
|
|
20
|
+
from airflow.api_fastapi.auth.managers.models.base_user import BaseUser
|
|
21
|
+
from airflow.api_fastapi.auth.managers.models.resource_details import (
|
|
22
22
|
AccessView,
|
|
23
23
|
AssetAliasDetails,
|
|
24
24
|
AssetDetails,
|
|
@@ -89,14 +89,14 @@ class FileAuthManager(BaseAuthManager[FileUser]):
|
|
|
89
89
|
|
|
90
90
|
def get_url_login(self, *, next_url: str | None = None) -> str:
|
|
91
91
|
"""Get the login page URL."""
|
|
92
|
-
url = "/auth/
|
|
92
|
+
url = "/auth/login"
|
|
93
93
|
if next_url:
|
|
94
94
|
url = f"{url}?{urlencode({'next': next_url})}"
|
|
95
95
|
return url
|
|
96
96
|
|
|
97
97
|
def get_url_logout(self) -> str:
|
|
98
98
|
"""Get the logout URL."""
|
|
99
|
-
return "/auth/
|
|
99
|
+
return "/auth/logout"
|
|
100
100
|
|
|
101
101
|
# =========================================================================
|
|
102
102
|
# Serialization Methods (for JWT)
|
|
@@ -6,13 +6,13 @@ from enum import Enum
|
|
|
6
6
|
from typing import TYPE_CHECKING
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
|
-
from airflow.auth.managers.models.resource_details import (
|
|
9
|
+
from airflow.api_fastapi.auth.managers.models.resource_details import (
|
|
10
10
|
AccessView,
|
|
11
|
+
AssetDetails,
|
|
11
12
|
ConfigurationDetails,
|
|
12
13
|
ConnectionDetails,
|
|
13
14
|
DagAccessEntity,
|
|
14
15
|
DagDetails,
|
|
15
|
-
DatasetDetails,
|
|
16
16
|
PoolDetails,
|
|
17
17
|
VariableDetails,
|
|
18
18
|
)
|
|
@@ -127,7 +127,7 @@ class FileAuthPolicy:
|
|
|
127
127
|
*,
|
|
128
128
|
method: str,
|
|
129
129
|
user_role: str,
|
|
130
|
-
details:
|
|
130
|
+
details: AssetDetails | None = None,
|
|
131
131
|
) -> bool:
|
|
132
132
|
"""Check if user can access datasets."""
|
|
133
133
|
if method in cls.READ_ONLY_METHODS:
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
|
|
196
196
|
<p class="description">Enter your username and password below:</p>
|
|
197
197
|
|
|
198
|
-
<form action="/auth/
|
|
198
|
+
<form action="/auth/token" method="POST">
|
|
199
199
|
<input type="hidden" name="next" value="{{ next_url }}">
|
|
200
200
|
|
|
201
201
|
<div class="form-group">
|
|
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
|