apache-airflow-providers-fab 1.5.3__py3-none-any.whl → 2.0.0b1__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.
Files changed (101) hide show
  1. airflow/providers/fab/LICENSE +0 -52
  2. airflow/providers/fab/__init__.py +3 -3
  3. airflow/providers/fab/auth_manager/api/auth/backend/basic_auth.py +3 -3
  4. airflow/providers/fab/auth_manager/api/auth/backend/kerberos_auth.py +4 -4
  5. airflow/providers/fab/auth_manager/api/auth/backend/session.py +1 -1
  6. airflow/providers/fab/auth_manager/api_endpoints/role_and_permission_endpoint.py +14 -13
  7. airflow/providers/fab/auth_manager/api_endpoints/user_endpoint.py +12 -12
  8. airflow/providers/fab/auth_manager/api_fastapi/__init__.py +16 -0
  9. airflow/providers/fab/auth_manager/api_fastapi/datamodels/__init__.py +16 -0
  10. airflow/providers/fab/auth_manager/api_fastapi/datamodels/login.py +32 -0
  11. airflow/providers/fab/auth_manager/api_fastapi/openapi/__init__.py +16 -0
  12. airflow/providers/fab/auth_manager/api_fastapi/openapi/v1-generated.yaml +152 -0
  13. airflow/providers/fab/auth_manager/api_fastapi/routes/__init__.py +16 -0
  14. airflow/providers/fab/auth_manager/api_fastapi/routes/login.py +51 -0
  15. airflow/providers/fab/auth_manager/api_fastapi/services/__init__.py +16 -0
  16. airflow/providers/fab/auth_manager/api_fastapi/services/login.py +58 -0
  17. airflow/providers/fab/auth_manager/cli_commands/db_command.py +2 -4
  18. airflow/providers/fab/auth_manager/cli_commands/user_command.py +2 -2
  19. airflow/providers/fab/auth_manager/cli_commands/utils.py +10 -9
  20. airflow/providers/fab/auth_manager/fab_auth_manager.py +231 -126
  21. airflow/providers/fab/auth_manager/models/__init__.py +1 -1
  22. airflow/providers/fab/auth_manager/models/anonymous_user.py +1 -1
  23. airflow/providers/fab/auth_manager/models/db.py +22 -5
  24. airflow/providers/fab/auth_manager/schemas/user_schema.py +1 -1
  25. airflow/providers/fab/auth_manager/security_manager/override.py +71 -632
  26. airflow/providers/fab/auth_manager/views/permissions.py +1 -1
  27. airflow/providers/fab/auth_manager/views/roles_list.py +1 -1
  28. airflow/providers/fab/auth_manager/views/user.py +1 -1
  29. airflow/providers/fab/auth_manager/views/user_edit.py +1 -1
  30. airflow/providers/fab/auth_manager/views/user_stats.py +1 -1
  31. airflow/providers/fab/get_provider_info.py +22 -16
  32. airflow/providers/fab/www/airflow_flask_app.py +31 -0
  33. airflow/providers/fab/www/api_connexion/__init__.py +17 -0
  34. airflow/providers/fab/www/api_connexion/exceptions.py +197 -0
  35. airflow/providers/fab/www/api_connexion/parameters.py +131 -0
  36. airflow/providers/fab/www/api_connexion/security.py +84 -0
  37. airflow/providers/fab/www/api_connexion/types.py +30 -0
  38. airflow/providers/fab/www/app.py +112 -0
  39. airflow/providers/fab/www/auth.py +350 -0
  40. airflow/providers/fab/www/constants.py +28 -0
  41. airflow/providers/fab/www/extensions/__init__.py +16 -0
  42. airflow/providers/fab/www/extensions/init_appbuilder.py +602 -0
  43. airflow/providers/fab/www/extensions/init_jinja_globals.py +82 -0
  44. airflow/providers/fab/www/extensions/init_manifest_files.py +61 -0
  45. airflow/providers/fab/www/extensions/init_security.py +61 -0
  46. airflow/providers/fab/www/extensions/init_session.py +64 -0
  47. airflow/providers/fab/www/extensions/init_views.py +177 -0
  48. airflow/providers/fab/www/package-lock.json +10127 -0
  49. airflow/providers/fab/www/package.json +81 -0
  50. airflow/providers/fab/www/security/__init__.py +17 -0
  51. airflow/providers/fab/www/security/permissions.py +126 -0
  52. airflow/providers/fab/www/security_appless.py +44 -0
  53. airflow/providers/fab/www/security_manager.py +122 -0
  54. airflow/providers/fab/www/session.py +41 -0
  55. airflow/providers/fab/www/static/css/bootstrap-theme.css +6215 -0
  56. airflow/providers/fab/www/static/css/flash.css +57 -0
  57. airflow/providers/fab/www/static/css/loading-dots.css +60 -0
  58. airflow/providers/fab/www/static/css/main.css +676 -0
  59. airflow/providers/fab/www/static/css/material-icons.css +84 -0
  60. airflow/providers/fab/www/static/dist/airflowDefaultTheme.feec4a4075c2f3d6ae01.css +33 -0
  61. airflow/providers/fab/www/static/dist/airflowDefaultTheme.feec4a4075c2f3d6ae01.js +1 -0
  62. airflow/providers/fab/www/static/dist/flash.137b30cff85b5588e661.css +18 -0
  63. airflow/providers/fab/www/static/dist/flash.137b30cff85b5588e661.js +1 -0
  64. airflow/providers/fab/www/static/dist/jquery-ui.min.css +5 -0
  65. airflow/providers/fab/www/static/dist/jquery-ui.min.js +2 -0
  66. airflow/providers/fab/www/static/dist/jquery-ui.min.js.LICENSE.txt +4 -0
  67. airflow/providers/fab/www/static/dist/loadingDots.48ab7d5b04e66f2686b0.css +18 -0
  68. airflow/providers/fab/www/static/dist/loadingDots.48ab7d5b04e66f2686b0.js +1 -0
  69. airflow/providers/fab/www/static/dist/main.ec1d38d994d72bb083cd.css +18 -0
  70. airflow/providers/fab/www/static/dist/main.ec1d38d994d72bb083cd.js +2 -0
  71. airflow/providers/fab/www/static/dist/main.ec1d38d994d72bb083cd.js.LICENSE.txt +18 -0
  72. airflow/providers/fab/www/static/dist/manifest.json +17 -0
  73. airflow/providers/fab/www/static/dist/materialIcons.57390fa60d8f61175334.css +18 -0
  74. airflow/providers/fab/www/static/dist/materialIcons.57390fa60d8f61175334.js +1 -0
  75. airflow/providers/fab/www/static/dist/moment.4d28b37c229bdfc54575.js +2 -0
  76. airflow/providers/fab/www/static/dist/moment.4d28b37c229bdfc54575.js.LICENSE.txt +11 -0
  77. airflow/providers/fab/www/static/dist/oss-licenses.json +29 -0
  78. airflow/providers/fab/www/static/js/datetime_utils.js +134 -0
  79. airflow/providers/fab/www/static/js/main.js +324 -0
  80. airflow/providers/fab/www/static/sort_asc.png +0 -0
  81. airflow/providers/fab/www/static/sort_both.png +0 -0
  82. airflow/providers/fab/www/static/sort_desc.png +0 -0
  83. airflow/providers/fab/www/templates/airflow/_messages.html +30 -0
  84. airflow/providers/fab/www/templates/airflow/error.html +35 -0
  85. airflow/providers/fab/www/templates/airflow/main.html +78 -0
  86. airflow/providers/fab/www/templates/airflow/traceback.html +53 -0
  87. airflow/providers/fab/www/templates/appbuilder/flash.html +34 -0
  88. airflow/providers/fab/www/templates/appbuilder/index.html +20 -0
  89. airflow/providers/fab/www/templates/appbuilder/navbar.html +60 -0
  90. airflow/providers/fab/www/templates/appbuilder/navbar_menu.html +60 -0
  91. airflow/providers/fab/www/templates/appbuilder/navbar_right.html +64 -0
  92. airflow/providers/fab/www/utils.py +272 -0
  93. airflow/providers/fab/www/views.py +129 -0
  94. airflow/providers/fab/www/webpack.config.js +213 -0
  95. {apache_airflow_providers_fab-1.5.3.dist-info → apache_airflow_providers_fab-2.0.0b1.dist-info}/METADATA +17 -35
  96. apache_airflow_providers_fab-2.0.0b1.dist-info/RECORD +122 -0
  97. {apache_airflow_providers_fab-1.5.3.dist-info → apache_airflow_providers_fab-2.0.0b1.dist-info}/WHEEL +1 -1
  98. airflow/providers/fab/auth_manager/decorators/auth.py +0 -126
  99. apache_airflow_providers_fab-1.5.3.dist-info/RECORD +0 -51
  100. /airflow/providers/fab/{auth_manager/decorators → www}/__init__.py +0 -0
  101. {apache_airflow_providers_fab-1.5.3.dist-info → apache_airflow_providers_fab-2.0.0b1.dist-info}/entry_points.txt +0 -0
@@ -1,126 +0,0 @@
1
- #
2
- # Licensed to the Apache Software Foundation (ASF) under one
3
- # or more contributor license agreements. See the NOTICE file
4
- # distributed with this work for additional information
5
- # regarding copyright ownership. The ASF licenses this file
6
- # to you under the Apache License, Version 2.0 (the
7
- # "License"); you may not use this file except in compliance
8
- # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing,
13
- # software distributed under the License is distributed on an
14
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- # KIND, either express or implied. See the License for the
16
- # specific language governing permissions and limitations
17
- # under the License.
18
- from __future__ import annotations
19
-
20
- import logging
21
- from functools import wraps
22
- from typing import Callable, Sequence, TypeVar, cast
23
-
24
- from flask import current_app, render_template, request
25
-
26
- from airflow.api_connexion.exceptions import PermissionDenied
27
- from airflow.api_connexion.security import check_authentication
28
- from airflow.configuration import conf
29
- from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride
30
- from airflow.utils.airflow_flask_app import AirflowApp
31
- from airflow.utils.net import get_hostname
32
- from airflow.www.auth import _has_access
33
- from airflow.www.extensions.init_auth_manager import get_auth_manager
34
-
35
- T = TypeVar("T", bound=Callable)
36
-
37
- log = logging.getLogger(__name__)
38
-
39
-
40
- def _requires_access_fab(permissions: Sequence[tuple[str, str]] | None = None) -> Callable[[T], T]:
41
- """
42
- Check current user's permissions against required permissions.
43
-
44
- This decorator is only kept for backward compatible reasons. The decorator
45
- ``airflow.api_connexion.security.requires_access``, which redirects to this decorator, might be used in
46
- user plugins. Thus, we need to keep it.
47
-
48
- :meta private:
49
- """
50
- appbuilder = cast(AirflowApp, current_app).appbuilder
51
- security_manager = cast(FabAirflowSecurityManagerOverride, get_auth_manager().security_manager)
52
- if appbuilder.update_perms:
53
- security_manager.sync_resource_permissions(permissions)
54
-
55
- def requires_access_decorator(func: T):
56
- @wraps(func)
57
- def decorated(*args, **kwargs):
58
- check_authentication()
59
- if security_manager.check_authorization(permissions, kwargs.get("dag_id")):
60
- return func(*args, **kwargs)
61
- raise PermissionDenied()
62
-
63
- return cast(T, decorated)
64
-
65
- return requires_access_decorator
66
-
67
-
68
- def _has_access_fab(permissions: Sequence[tuple[str, str]] | None = None) -> Callable[[T], T]:
69
- """
70
- Check current user's permissions against required permissions.
71
-
72
- This decorator is only kept for backward compatible reasons. The decorator
73
- ``airflow.www.auth.has_access``, which redirects to this decorator, is widely used in user plugins.
74
- Thus, we need to keep it.
75
- See https://github.com/apache/airflow/pull/33213#discussion_r1346287224
76
-
77
- :meta private:
78
- """
79
-
80
- def requires_access_decorator(func: T):
81
- @wraps(func)
82
- def decorated(*args, **kwargs):
83
- __tracebackhide__ = True # Hide from pytest traceback.
84
-
85
- appbuilder = current_app.appbuilder
86
-
87
- dag_id_kwargs = kwargs.get("dag_id")
88
- dag_id_args = request.args.get("dag_id")
89
- dag_id_form = request.form.get("dag_id")
90
- dag_id_json = request.json.get("dag_id") if request.is_json else None
91
- all_dag_ids = [dag_id_kwargs, dag_id_args, dag_id_form, dag_id_json]
92
- unique_dag_ids = set(dag_id for dag_id in all_dag_ids if dag_id is not None)
93
-
94
- if len(unique_dag_ids) > 1:
95
- log.warning(
96
- "There are different dag_ids passed in the request: %s. Returning 403.", unique_dag_ids
97
- )
98
- log.warning(
99
- "kwargs: %s, args: %s, form: %s, json: %s",
100
- dag_id_kwargs,
101
- dag_id_args,
102
- dag_id_form,
103
- dag_id_json,
104
- )
105
- return (
106
- render_template(
107
- "airflow/no_roles_permissions.html",
108
- hostname=get_hostname()
109
- if conf.getboolean("webserver", "EXPOSE_HOSTNAME")
110
- else "redact",
111
- logout_url=get_auth_manager().get_url_logout(),
112
- ),
113
- 403,
114
- )
115
- dag_id = unique_dag_ids.pop() if unique_dag_ids else None
116
-
117
- return _has_access(
118
- is_authorized=appbuilder.sm.check_authorization(permissions, dag_id),
119
- func=func,
120
- args=args,
121
- kwargs=kwargs,
122
- )
123
-
124
- return cast(T, decorated)
125
-
126
- return requires_access_decorator
@@ -1,51 +0,0 @@
1
- airflow/providers/fab/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
2
- airflow/providers/fab/__init__.py,sha256=QhdfehBnScmei_SfBb1hwjm0jeqou4zh6WZFty9rgNE,1490
3
- airflow/providers/fab/alembic.ini,sha256=_1SvObfjMAkuD7DN5VR2S6Rd7_F81pORZT-w7GJldIA,4461
4
- airflow/providers/fab/get_provider_info.py,sha256=Evx2DZC-hHqcnrztDIBF_09qS51OSRMAHrLc8y4asE8,3517
5
- airflow/providers/fab/auth_manager/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
6
- airflow/providers/fab/auth_manager/fab_auth_manager.py,sha256=nPjgvvCnXfV0W5qzUXy6XqdCaJYsQpdoPzaYqnQuwWw,23164
7
- airflow/providers/fab/auth_manager/api/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
8
- airflow/providers/fab/auth_manager/api/auth/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
9
- airflow/providers/fab/auth_manager/api/auth/backend/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
10
- airflow/providers/fab/auth_manager/api/auth/backend/basic_auth.py,sha256=KhOVO7mzmwr6Ee42Qg9RZ5qP6CfRC0F0u9CMk30npNY,2567
11
- airflow/providers/fab/auth_manager/api/auth/backend/kerberos_auth.py,sha256=y8hHABP-UVBpg9RPy_I7_nLSWDYU14wqie1HYrmubpc,5049
12
- airflow/providers/fab/auth_manager/api/auth/backend/session.py,sha256=f4Dzi_1jn8sq2YrfYwlh3cruiUZZFsQcAhF8Tgr2f40,1519
13
- airflow/providers/fab/auth_manager/api_endpoints/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
14
- airflow/providers/fab/auth_manager/api_endpoints/role_and_permission_endpoint.py,sha256=13qbfXXEx3nu28408izJcZ2-GFz6aM8NmeekAi3_Kgc,7565
15
- airflow/providers/fab/auth_manager/api_endpoints/user_endpoint.py,sha256=T0EMTStny2NHVWbmX72SP_VAohgHRRM6Yk7kdfESmbQ,8497
16
- airflow/providers/fab/auth_manager/cli_commands/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
17
- airflow/providers/fab/auth_manager/cli_commands/db_command.py,sha256=h0yRnHMKs1Dndujt5FKyWOv3yEZnX0L41rUadbyuP98,2189
18
- airflow/providers/fab/auth_manager/cli_commands/definition.py,sha256=XIAPqoHwkFHshfbj6yGIs7xUrR-uSE1F7V71n44PttA,11483
19
- airflow/providers/fab/auth_manager/cli_commands/role_command.py,sha256=4w1tHTR5gBbsymeqGIJ4Rs8CmGdw0l49y58pfI0DB_s,9098
20
- airflow/providers/fab/auth_manager/cli_commands/sync_perm_command.py,sha256=VpW-rWhgHAL_ReU66D_BrsxlXQN4okfxzj6dyE5IfwA,1663
21
- airflow/providers/fab/auth_manager/cli_commands/user_command.py,sha256=DMsGccMSs2u0cn1dQgRYkJoG37JhEE-m9dtn-sWEOXw,10275
22
- airflow/providers/fab/auth_manager/cli_commands/utils.py,sha256=cn9rlhb1NKSjgQN8ARviYWmoQINLr9jLMQM8Sf_Jf9k,2842
23
- airflow/providers/fab/auth_manager/decorators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
24
- airflow/providers/fab/auth_manager/decorators/auth.py,sha256=Z4_xiS1N1E0MqDP9OxHx_YJvKe0sH15afP0tn5LP3Ss,4948
25
- airflow/providers/fab/auth_manager/models/__init__.py,sha256=KZl07tphFlZ8kTnsV8k7eTMilaWtd6rV-RjtWOkb13E,9243
26
- airflow/providers/fab/auth_manager/models/anonymous_user.py,sha256=gE2E7NQgNBqSJe44pq_RKeZNe7KMVrACL43akF5ucag,1874
27
- airflow/providers/fab/auth_manager/models/db.py,sha256=bPWvMiee6vDP4iJNWVCE7PTuLDjOSn_IvA9b9cbQJek,4339
28
- airflow/providers/fab/auth_manager/openapi/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
29
- airflow/providers/fab/auth_manager/openapi/v1.yaml,sha256=xFlQMccLoGarx8SnQvGJ1DRfHo4jQ3p9DzoPqQINcCw,19380
30
- airflow/providers/fab/auth_manager/schemas/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
31
- airflow/providers/fab/auth_manager/schemas/role_and_permission_schema.py,sha256=aDB0naczyEsGYaF3U3djF-Ui6lxPdgWHvgcwjyJn_X8,2526
32
- airflow/providers/fab/auth_manager/schemas/user_schema.py,sha256=ap0A09dYmzAbSHI88_5j0Ysx0Z1G0rKSNau5lEi_CFc,2383
33
- airflow/providers/fab/auth_manager/security_manager/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
34
- airflow/providers/fab/auth_manager/security_manager/constants.py,sha256=x1Sjl_Mu3wmaSy3NFZlHxK2z-juzWmMs1SrzJ0aiBBQ,907
35
- airflow/providers/fab/auth_manager/security_manager/override.py,sha256=q8Zcg3mocJIuwcfgrbt2kA7T9L5TK2jM0CkfUVTwOZU,116741
36
- airflow/providers/fab/auth_manager/views/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
37
- airflow/providers/fab/auth_manager/views/permissions.py,sha256=k5APUTqqKZqMxCWlKrUEgqdDVrGa9719HJ3UmFpiSLc,2886
38
- airflow/providers/fab/auth_manager/views/roles_list.py,sha256=o_VqnLbQa4sisKxLwyx6VCl3HmvjKcjkrJG23R81FMQ,1494
39
- airflow/providers/fab/auth_manager/views/user.py,sha256=KaBWeBMy5j8o9qwe0RDHhtToO4aC6pH_m7N9IcIj1xM,5995
40
- airflow/providers/fab/auth_manager/views/user_edit.py,sha256=d8wQ_8Rk8Ce95sCElZIXN7ATwbXrT2Tauqn5uTwuo2E,2140
41
- airflow/providers/fab/auth_manager/views/user_stats.py,sha256=zP2eX6e40rpEohJcvnvri4Khu3Q4ULLxjz1zOWvOr8A,1300
42
- airflow/providers/fab/migrations/README,sha256=heMzebYwlGhnE8_4CWJ4LS74WoEZjBy-S-mIJRxAEKI,39
43
- airflow/providers/fab/migrations/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
44
- airflow/providers/fab/migrations/env.py,sha256=wbgFowVIf-wY1L-DqD2f8wiuTeXNDKeAUw1oM15Fd0U,3998
45
- airflow/providers/fab/migrations/script.py.mako,sha256=_krfPtzv1Unme2b9MCHPgXo0g73HcN2_zDgz3co2N4M,1353
46
- airflow/providers/fab/migrations/versions/0001_1_4_0_placeholder_migration.py,sha256=wLZiBiWjfSofXZ4jXMjpEKkIc3jI0a6hpJ73xEYAzss,1370
47
- airflow/providers/fab/migrations/versions/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
48
- apache_airflow_providers_fab-1.5.3.dist-info/entry_points.txt,sha256=m05kASp7vFi0ZmQ--CFp7GeJpPL7UT2RQF8EEP5XRX8,99
49
- apache_airflow_providers_fab-1.5.3.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
50
- apache_airflow_providers_fab-1.5.3.dist-info/METADATA,sha256=zBzMwuJKAkJoY2PQ5PyLai1UvLqWSRaDDUD2pHh2LLc,6441
51
- apache_airflow_providers_fab-1.5.3.dist-info/RECORD,,