apache-airflow-providers-fab 2.4.1__py3-none-any.whl → 2.4.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.
Files changed (32) hide show
  1. airflow/providers/fab/__init__.py +1 -1
  2. airflow/providers/fab/auth_manager/fab_auth_manager.py +45 -40
  3. airflow/providers/fab/auth_manager/models/__init__.py +2 -2
  4. airflow/providers/fab/auth_manager/security_manager/override.py +71 -45
  5. airflow/providers/fab/get_provider_info.py +14 -0
  6. airflow/providers/fab/migrations/versions/0001_1_4_0_create_ab_tables_if_missing.py +220 -0
  7. airflow/providers/fab/www/package-lock.json +117 -106
  8. airflow/providers/fab/www/package.json +8 -8
  9. airflow/providers/fab/www/security/permissions.py +7 -8
  10. airflow/providers/fab/www/static/dist/{743.27a753a06671118f1c5c.js → 743.fc7a7c6ef9d09365976e.js} +1 -1
  11. airflow/providers/fab/www/static/dist/{main.810554d06c3e30f2484e.js → main.3cf3be1a0c5439bb640d.js} +1 -1
  12. airflow/providers/fab/www/static/dist/manifest.json +13 -13
  13. {apache_airflow_providers_fab-2.4.1.dist-info → apache_airflow_providers_fab-2.4.2.dist-info}/METADATA +7 -8
  14. {apache_airflow_providers_fab-2.4.1.dist-info → apache_airflow_providers_fab-2.4.2.dist-info}/RECORD +31 -31
  15. airflow/providers/fab/migrations/versions/0001_1_4_0_placeholder_migration.py +0 -45
  16. /airflow/providers/fab/www/static/dist/{743.27a753a06671118f1c5c.js.LICENSE.txt → 743.fc7a7c6ef9d09365976e.js.LICENSE.txt} +0 -0
  17. /airflow/providers/fab/www/static/dist/{airflowDefaultTheme.56d4475fdae7883d3454.css → airflowDefaultTheme.ff5a35f322070b094aa2.css} +0 -0
  18. /airflow/providers/fab/www/static/dist/{airflowDefaultTheme.56d4475fdae7883d3454.js → airflowDefaultTheme.ff5a35f322070b094aa2.js} +0 -0
  19. /airflow/providers/fab/www/static/dist/{flash.0951d47c62bc8906be65.css → flash.5583a9e0cf11f2be93da.css} +0 -0
  20. /airflow/providers/fab/www/static/dist/{flash.0951d47c62bc8906be65.js → flash.5583a9e0cf11f2be93da.js} +0 -0
  21. /airflow/providers/fab/www/static/dist/{loadingDots.deaad0ce0e7691ed6251.css → loadingDots.2e5f555f0753107b0300.css} +0 -0
  22. /airflow/providers/fab/www/static/dist/{loadingDots.deaad0ce0e7691ed6251.js → loadingDots.2e5f555f0753107b0300.js} +0 -0
  23. /airflow/providers/fab/www/static/dist/{main.810554d06c3e30f2484e.css → main.3cf3be1a0c5439bb640d.css} +0 -0
  24. /airflow/providers/fab/www/static/dist/{main.810554d06c3e30f2484e.js.LICENSE.txt → main.3cf3be1a0c5439bb640d.js.LICENSE.txt} +0 -0
  25. /airflow/providers/fab/www/static/dist/{materialIcons.b0c6cc32cdacff89f7c2.css → materialIcons.3e67dd6fbfcc4f3b5105.css} +0 -0
  26. /airflow/providers/fab/www/static/dist/{materialIcons.b0c6cc32cdacff89f7c2.js → materialIcons.3e67dd6fbfcc4f3b5105.js} +0 -0
  27. /airflow/providers/fab/www/static/dist/{moment.518a43bcfaf149ae2836.js → moment.9baee5ec3d7639a10897.js} +0 -0
  28. /airflow/providers/fab/www/static/dist/{runtime.4a925577de9ab84d8e00.js → runtime.ad800fc1845ad5c6ddeb.js} +0 -0
  29. {apache_airflow_providers_fab-2.4.1.dist-info → apache_airflow_providers_fab-2.4.2.dist-info}/WHEEL +0 -0
  30. {apache_airflow_providers_fab-2.4.1.dist-info → apache_airflow_providers_fab-2.4.2.dist-info}/entry_points.txt +0 -0
  31. {apache_airflow_providers_fab-2.4.1.dist-info → apache_airflow_providers_fab-2.4.2.dist-info}/licenses/3rd-party-licenses/LICENSES-ui.txt +0 -0
  32. {apache_airflow_providers_fab-2.4.1.dist-info → apache_airflow_providers_fab-2.4.2.dist-info}/licenses/NOTICE +0 -0
@@ -0,0 +1,220 @@
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
+
19
+ """
20
+ Create User and Role tables if missing.
21
+
22
+ Revision ID: 6709f7a774b9
23
+ Revises:
24
+ Create Date: 2024-09-03 17:06:38.040510
25
+
26
+ Note: This is a placeholder migration used to stamp the migration
27
+ when we create the migration from the ORM. Otherwise, it will run
28
+ without stamping the migration, leading to subsequent changes to
29
+ the tables not being migrated.
30
+ """
31
+
32
+ from __future__ import annotations
33
+
34
+ import sqlalchemy as sa
35
+ from alembic import op
36
+
37
+ # revision identifiers, used by Alembic.
38
+ revision = "6709f7a774b9"
39
+ down_revision = None
40
+ branch_labels = None
41
+ depends_on = None
42
+ fab_version = "1.4.0"
43
+
44
+
45
+ def upgrade() -> None:
46
+ # ### commands auto generated by Alembic - please adjust! ###
47
+ op.create_table(
48
+ "ab_group",
49
+ sa.Column("id", sa.Integer(), nullable=False),
50
+ sa.Column("name", sa.String(length=100), nullable=False),
51
+ sa.Column("label", sa.String(length=150), nullable=True),
52
+ sa.Column("description", sa.String(length=512), nullable=True),
53
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_group_pkey")),
54
+ sa.UniqueConstraint("name", name=op.f("ab_group_name_uq")),
55
+ if_not_exists=True,
56
+ )
57
+ op.create_table(
58
+ "ab_permission",
59
+ sa.Column("id", sa.Integer(), nullable=False),
60
+ sa.Column("name", sa.String(length=100), nullable=False),
61
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_permission_pkey")),
62
+ sa.UniqueConstraint("name", name=op.f("ab_permission_name_uq")),
63
+ if_not_exists=True,
64
+ )
65
+ op.create_table(
66
+ "ab_register_user",
67
+ sa.Column("id", sa.Integer(), nullable=False),
68
+ sa.Column("first_name", sa.String(length=256), nullable=False),
69
+ sa.Column("last_name", sa.String(length=256), nullable=False),
70
+ sa.Column(
71
+ "username",
72
+ sa.String(length=512).with_variant(sa.String(length=512, collation="NOCASE"), "sqlite"),
73
+ nullable=False,
74
+ ),
75
+ sa.Column("password", sa.String(length=256), nullable=True),
76
+ sa.Column("email", sa.String(length=512), nullable=False),
77
+ sa.Column("registration_date", sa.DateTime(), nullable=True),
78
+ sa.Column("registration_hash", sa.String(length=256), nullable=True),
79
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_register_user_pkey")),
80
+ sa.UniqueConstraint("username", name=op.f("ab_register_user_username_uq")),
81
+ if_not_exists=True,
82
+ )
83
+ op.create_table(
84
+ "ab_role",
85
+ sa.Column("id", sa.Integer(), nullable=False),
86
+ sa.Column("name", sa.String(length=64), nullable=False),
87
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_role_pkey")),
88
+ sa.UniqueConstraint("name", name=op.f("ab_role_name_uq")),
89
+ if_not_exists=True,
90
+ )
91
+ op.create_table(
92
+ "ab_user",
93
+ sa.Column("id", sa.Integer(), nullable=False),
94
+ sa.Column("first_name", sa.String(length=256), nullable=False),
95
+ sa.Column("last_name", sa.String(length=256), nullable=False),
96
+ sa.Column(
97
+ "username",
98
+ sa.String(length=512).with_variant(sa.String(length=512, collation="NOCASE"), "sqlite"),
99
+ nullable=False,
100
+ ),
101
+ sa.Column("password", sa.String(length=256), nullable=True),
102
+ sa.Column("active", sa.Boolean(), nullable=True),
103
+ sa.Column("email", sa.String(length=512), nullable=False),
104
+ sa.Column("last_login", sa.DateTime(), nullable=True),
105
+ sa.Column("login_count", sa.Integer(), nullable=True),
106
+ sa.Column("fail_login_count", sa.Integer(), nullable=True),
107
+ sa.Column("created_on", sa.DateTime(), nullable=True),
108
+ sa.Column("changed_on", sa.DateTime(), nullable=True),
109
+ sa.Column("created_by_fk", sa.Integer(), nullable=True),
110
+ sa.Column("changed_by_fk", sa.Integer(), nullable=True),
111
+ sa.ForeignKeyConstraint(["changed_by_fk"], ["ab_user.id"], name=op.f("ab_user_changed_by_fk_fkey")),
112
+ sa.ForeignKeyConstraint(["created_by_fk"], ["ab_user.id"], name=op.f("ab_user_created_by_fk_fkey")),
113
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_user_pkey")),
114
+ sa.UniqueConstraint("email", name=op.f("ab_user_email_uq")),
115
+ sa.UniqueConstraint("username", name=op.f("ab_user_username_uq")),
116
+ if_not_exists=True,
117
+ )
118
+ op.create_table(
119
+ "ab_view_menu",
120
+ sa.Column("id", sa.Integer(), nullable=False),
121
+ sa.Column("name", sa.String(length=250), nullable=False),
122
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_view_menu_pkey")),
123
+ sa.UniqueConstraint("name", name=op.f("ab_view_menu_name_uq")),
124
+ )
125
+ op.create_table(
126
+ "ab_group_role",
127
+ sa.Column("id", sa.Integer(), nullable=False),
128
+ sa.Column("group_id", sa.Integer(), nullable=True),
129
+ sa.Column("role_id", sa.Integer(), nullable=True),
130
+ sa.ForeignKeyConstraint(
131
+ ["group_id"], ["ab_group.id"], name=op.f("ab_group_role_group_id_fkey"), ondelete="CASCADE"
132
+ ),
133
+ sa.ForeignKeyConstraint(
134
+ ["role_id"], ["ab_role.id"], name=op.f("ab_group_role_role_id_fkey"), ondelete="CASCADE"
135
+ ),
136
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_group_role_pkey")),
137
+ sa.UniqueConstraint("group_id", "role_id", name=op.f("ab_group_role_group_id_role_id_uq")),
138
+ if_not_exists=True,
139
+ )
140
+ with op.batch_alter_table("ab_group_role", schema=None) as batch_op:
141
+ batch_op.create_index("idx_group_id", ["group_id"], unique=False)
142
+ batch_op.create_index("idx_group_role_id", ["role_id"], unique=False)
143
+
144
+ op.create_table(
145
+ "ab_permission_view",
146
+ sa.Column("id", sa.Integer(), nullable=False),
147
+ sa.Column("permission_id", sa.Integer(), nullable=True),
148
+ sa.Column("view_menu_id", sa.Integer(), nullable=True),
149
+ sa.ForeignKeyConstraint(
150
+ ["permission_id"], ["ab_permission.id"], name=op.f("ab_permission_view_permission_id_fkey")
151
+ ),
152
+ sa.ForeignKeyConstraint(
153
+ ["view_menu_id"], ["ab_view_menu.id"], name=op.f("ab_permission_view_view_menu_id_fkey")
154
+ ),
155
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_permission_view_pkey")),
156
+ sa.UniqueConstraint(
157
+ "permission_id", "view_menu_id", name=op.f("ab_permission_view_permission_id_view_menu_id_uq")
158
+ ),
159
+ if_not_exists=True,
160
+ )
161
+ op.create_table(
162
+ "ab_user_group",
163
+ sa.Column("id", sa.Integer(), nullable=False),
164
+ sa.Column("user_id", sa.Integer(), nullable=True),
165
+ sa.Column("group_id", sa.Integer(), nullable=True),
166
+ sa.ForeignKeyConstraint(
167
+ ["group_id"], ["ab_group.id"], name=op.f("ab_user_group_group_id_fkey"), ondelete="CASCADE"
168
+ ),
169
+ sa.ForeignKeyConstraint(
170
+ ["user_id"], ["ab_user.id"], name=op.f("ab_user_group_user_id_fkey"), ondelete="CASCADE"
171
+ ),
172
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_user_group_pkey")),
173
+ sa.UniqueConstraint("user_id", "group_id", name=op.f("ab_user_group_user_id_group_id_uq")),
174
+ if_not_exists=True,
175
+ )
176
+ with op.batch_alter_table("ab_user_group", schema=None) as batch_op:
177
+ batch_op.create_index("idx_user_group_id", ["group_id"], unique=False)
178
+ batch_op.create_index("idx_user_id", ["user_id"], unique=False)
179
+
180
+ op.create_table(
181
+ "ab_user_role",
182
+ sa.Column("id", sa.Integer(), nullable=False),
183
+ sa.Column("user_id", sa.Integer(), nullable=True),
184
+ sa.Column("role_id", sa.Integer(), nullable=True),
185
+ sa.ForeignKeyConstraint(
186
+ ["role_id"], ["ab_role.id"], name=op.f("ab_user_role_role_id_fkey"), ondelete="CASCADE"
187
+ ),
188
+ sa.ForeignKeyConstraint(
189
+ ["user_id"], ["ab_user.id"], name=op.f("ab_user_role_user_id_fkey"), ondelete="CASCADE"
190
+ ),
191
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_user_role_pkey")),
192
+ sa.UniqueConstraint("user_id", "role_id", name=op.f("ab_user_role_user_id_role_id_uq")),
193
+ if_not_exists=True,
194
+ )
195
+ op.create_table(
196
+ "ab_permission_view_role",
197
+ sa.Column("id", sa.Integer(), nullable=False),
198
+ sa.Column("permission_view_id", sa.Integer(), nullable=True),
199
+ sa.Column("role_id", sa.Integer(), nullable=True),
200
+ sa.ForeignKeyConstraint(
201
+ ["permission_view_id"],
202
+ ["ab_permission_view.id"],
203
+ name=op.f("ab_permission_view_role_permission_view_id_fkey"),
204
+ ondelete="CASCADE",
205
+ ),
206
+ sa.ForeignKeyConstraint(
207
+ ["role_id"], ["ab_role.id"], name=op.f("ab_permission_view_role_role_id_fkey"), ondelete="CASCADE"
208
+ ),
209
+ sa.PrimaryKeyConstraint("id", name=op.f("ab_permission_view_role_pkey")),
210
+ sa.UniqueConstraint(
211
+ "permission_view_id",
212
+ "role_id",
213
+ name=op.f("ab_permission_view_role_permission_view_id_role_id_uq"),
214
+ ),
215
+ if_not_exists=True,
216
+ )
217
+ # ### end Alembic commands ###
218
+
219
+
220
+ def downgrade() -> None: ...