This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new e615354e34f Create additional users in breeze for testing (#58126)
e615354e34f is described below
commit e615354e34fff66cdd64e8aa7ab63f3258f4a248
Author: Aaron Wolmutt <[email protected]>
AuthorDate: Tue Nov 11 07:50:12 2025 -0600
Create additional users in breeze for testing (#58126)
* feat: added --create-all-roles flag to breeze. creates test users with
each role by default for SimpleAuthManager
* update command config
* ci: ran prek --all-files
* remove dev modecreate roles error
* remove --dev-mode requirement for breeze start-airflow --create-all-roles
* docs: remove documentation
---
dev/breeze/doc/03_developer_tasks.rst | 38 +++++++++++++++++++-
dev/breeze/doc/images/output_start-airflow.svg | 40 +++++++++++++---------
dev/breeze/doc/images/output_start-airflow.txt | 2 +-
.../airflow_breeze/commands/developer_commands.py | 9 +++++
.../commands/developer_commands_config.py | 4 +--
.../files/simple_auth_manager_passwords.json | 2 +-
.../src/airflow_breeze/params/shell_params.py | 6 +++-
scripts/in_container/check_environment.sh | 12 ++++++-
8 files changed, 89 insertions(+), 24 deletions(-)
diff --git a/dev/breeze/doc/03_developer_tasks.rst
b/dev/breeze/doc/03_developer_tasks.rst
index 5babb592f3c..8a7e3bcd176 100644
--- a/dev/breeze/doc/03_developer_tasks.rst
+++ b/dev/breeze/doc/03_developer_tasks.rst
@@ -132,12 +132,48 @@ You can connect to these ports/databases using:
If you do not use ``start-airflow`` command. You can use ``tmux`` to multiply
terminals.
You may need to create a user prior to running the API server in order to log
in.
-This can be done with the following command:
+
+**Authentication and User Management**
+
+The authentication method depends on which auth manager is configured:
+
+**SimpleAuthManager (Default in Airflow 3.x)**
+
+SimpleAuthManager is the default authentication manager and comes
pre-configured with test username and passwords for development:
+
+.. code-block::
+
+ * admin:admin (Admin role)
+ * viewer:viewer (Viewer role)
+ * user:user (User role)
+ * op:op (Operator role)
+
+These users are automatically available when using SimpleAuthManager and
require no additional setup.
+
+**FabAuthManager**
+
+When using FabAuthManager, you can create users manually:
.. code-block:: bash
airflow users create --role Admin --username admin --password admin
--email [email protected] --firstname foo --lastname bar
+Or use the ``--create-all-roles`` flag with ``start-airflow`` in dev mode to
automatically create test users:
+
+.. code-block:: bash
+
+ breeze start-airflow --dev-mode --create-all-roles --auth-manager
FabAuthManager
+
+This will create the following test users:
+
+.. code-block::
+
+ * admin:admin (Admin role)
+ * viewer:viewer (Viewer role)
+ * user:user (User role)
+ * op:op (Op role)
+ * testadmin:testadmin (Admin role)
+
.. note::
``airflow users`` command is only available when `FAB auth manager
<https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/index.html>`_
is enabled.
diff --git a/dev/breeze/doc/images/output_start-airflow.svg
b/dev/breeze/doc/images/output_start-airflow.svg
index 852322c8133..17551b8bff5 100644
--- a/dev/breeze/doc/images/output_start-airflow.svg
+++ b/dev/breeze/doc/images/output_start-airflow.svg
@@ -1,4 +1,4 @@
-<svg class="rich-terminal" viewBox="0 0 1482 3734.3999999999996"
xmlns="http://www.w3.org/2000/svg">
+<svg class="rich-terminal" viewBox="0 0 1482 3783.2"
xmlns="http://www.w3.org/2000/svg">
<!-- Generated with Rich https://www.textualize.io -->
<style>
@@ -43,7 +43,7 @@
<defs>
<clipPath id="breeze-start-airflow-clip-terminal">
- <rect x="0" y="0" width="1463.0" height="3683.3999999999996" />
+ <rect x="0" y="0" width="1463.0" height="3732.2" />
</clipPath>
<clipPath id="breeze-start-airflow-line-0">
<rect x="0" y="1.5" width="1464" height="24.65"/>
@@ -495,9 +495,15 @@
<clipPath id="breeze-start-airflow-line-149">
<rect x="0" y="3637.1" width="1464" height="24.65"/>
</clipPath>
+<clipPath id="breeze-start-airflow-line-150">
+ <rect x="0" y="3661.5" width="1464" height="24.65"/>
+ </clipPath>
+<clipPath id="breeze-start-airflow-line-151">
+ <rect x="0" y="3685.9" width="1464" height="24.65"/>
+ </clipPath>
</defs>
- <rect fill="#292929" stroke="rgba(255,255,255,0.35)" stroke-width="1"
x="1" y="1" width="1480" height="3732.4" rx="8"/><text
class="breeze-start-airflow-title" fill="#c5c8c6" text-anchor="middle" x="740"
y="27">Command: start-airflow</text>
+ <rect fill="#292929" stroke="rgba(255,255,255,0.35)" stroke-width="1"
x="1" y="1" width="1480" height="3781.2" rx="8"/><text
class="breeze-start-airflow-title" fill="#c5c8c6" text-anchor="middle" x="740"
y="27">Command: start-airflow</text>
<g transform="translate(26,22)">
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
@@ -645,19 +651,21 @@
</text><text class="breeze-start-airflow-r5" x="0" y="3314" textLength="1464"
clip-path="url(#breeze-start-airflow-line-135)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-start-airflow-r1" x="1464" y="3314" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-135)">
</text><text class="breeze-start-airflow-r5" x="0" y="3338.4"
textLength="24.4"
clip-path="url(#breeze-start-airflow-line-136)">╭─</text><text
class="breeze-start-airflow-r5" x="24.4" y="3338.4" textLength="183"
clip-path="url(#breeze-start-airflow-line-136)"> Other options </text><text
class="breeze-start-airflow-r5" x="207.4" y="3338.4" textLength="1232.2"
clip-path="url(#breeze-start-airflow-line-136)">────────────────────────────────────────────────────────────────────
[...]
</text><text class="breeze-start-airflow-r5" x="0" y="3362.8"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-137)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3362.8" textLength="256.2"
clip-path="url(#breeze-start-airflow-line-137)">--forward-credentials</text><text
class="breeze-start-airflow-r6" x="305" y="3362.8" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-137)">-f</text><text
class="breeze-start-airflow-r1" x="353.8" y="3362.8" textLength=" [...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3387.2"
textLength="1464"
clip-path="url(#breeze-start-airflow-line-138)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-start-airflow-r1" x="1464" y="3387.2" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-138)">
-</text><text class="breeze-start-airflow-r5" x="0" y="3411.6"
textLength="24.4"
clip-path="url(#breeze-start-airflow-line-139)">╭─</text><text
class="breeze-start-airflow-r5" x="24.4" y="3411.6" textLength="231.8"
clip-path="url(#breeze-start-airflow-line-139)"> Debugging options </text><text
class="breeze-start-airflow-r5" x="256.2" y="3411.6" textLength="1183.4"
clip-path="url(#breeze-start-airflow-line-139)">──────────────────────────────────────────────────────────────
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3436" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-140)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3436" textLength="85.4"
clip-path="url(#breeze-start-airflow-line-140)">--debug</text><text
class="breeze-start-airflow-r1" x="195.2" y="3436" textLength="1244.4"
clip-path="url(#breeze-start-airflow-line-140)">Enable debugging for specific Airflow components. Can be 
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3460.4"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-141)">│</text><text
class="breeze-start-airflow-r1" x="195.2" y="3460.4" textLength="1244.4"
clip-path="url(#breeze-start-airflow-line-141)">api-server, dag-processor, edge-worker, celery-worker.                          
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3484.8"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-142)">│</text><text
class="breeze-start-airflow-r7" x="195.2" y="3484.8" textLength="1244.4"
clip-path="url(#breeze-start-airflow-line-142)">(scheduler | triggerer | api-server | dag-processor | edge-worker | celery-worker)                &
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3509.2"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-143)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3509.2" textLength="122"
clip-path="url(#breeze-start-airflow-line-143)">--debugger</text><text
class="breeze-start-airflow-r1" x="195.2" y="3509.2" textLength="597.8"
clip-path="url(#breeze-start-airflow-line-143)">Debugger to use for debugging Airflow components.</text><tex
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3533.6"
textLength="1464"
clip-path="url(#breeze-start-airflow-line-144)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-start-airflow-r1" x="1464" y="3533.6" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-144)">
-</text><text class="breeze-start-airflow-r5" x="0" y="3558" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-145)">╭─</text><text
class="breeze-start-airflow-r5" x="24.4" y="3558" textLength="195.2"
clip-path="url(#breeze-start-airflow-line-145)"> Common options </text><text
class="breeze-start-airflow-r5" x="219.6" y="3558" textLength="1220"
clip-path="url(#breeze-start-airflow-line-145)">─────────────────────────────────────────────────────────────────────────
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3582.4"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-146)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3582.4" textLength="97.6"
clip-path="url(#breeze-start-airflow-line-146)">--answer</text><text
class="breeze-start-airflow-r6" x="158.6" y="3582.4" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-146)">-a</text><text
class="breeze-start-airflow-r1" x="207.4" y="3582.4" textLength="317.2" clip-
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3606.8"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-147)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3606.8" textLength="109.8"
clip-path="url(#breeze-start-airflow-line-147)">--dry-run</text><text
class="breeze-start-airflow-r6" x="158.6" y="3606.8" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-147)">-D</text><text
class="breeze-start-airflow-r1" x="207.4" y="3606.8" textLength="719.8" cli
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3631.2"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-148)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3631.2" textLength="109.8"
clip-path="url(#breeze-start-airflow-line-148)">--verbose</text><text
class="breeze-start-airflow-r6" x="158.6" y="3631.2" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-148)">-v</text><text
class="breeze-start-airflow-r1" x="207.4" y="3631.2" textLength="585.6" cli
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3655.6"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-149)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3655.6" textLength="73.2"
clip-path="url(#breeze-start-airflow-line-149)">--help</text><text
class="breeze-start-airflow-r6" x="158.6" y="3655.6" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-149)">-h</text><text
class="breeze-start-airflow-r1" x="207.4" y="3655.6" textLength="329.4" clip-pa
[...]
-</text><text class="breeze-start-airflow-r5" x="0" y="3680" textLength="1464"
clip-path="url(#breeze-start-airflow-line-150)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-start-airflow-r1" x="1464" y="3680" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-150)">
+</text><text class="breeze-start-airflow-r5" x="0" y="3387.2"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-138)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3387.2" textLength="219.6"
clip-path="url(#breeze-start-airflow-line-138)">--create-all-roles</text><text
class="breeze-start-airflow-r1" x="353.8" y="3387.2" textLength="1085.8"
clip-path="url(#breeze-start-airflow-line-138)">Creates all user roles for testing with FabA
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3411.6"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-139)">│</text><text
class="breeze-start-airflow-r1" x="353.8" y="3411.6" textLength="1085.8"
clip-path="url(#breeze-start-airflow-line-139)">SimpleAuthManager always has all roles available.                          
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3436" textLength="1464"
clip-path="url(#breeze-start-airflow-line-140)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-start-airflow-r1" x="1464" y="3436" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-140)">
+</text><text class="breeze-start-airflow-r5" x="0" y="3460.4"
textLength="24.4"
clip-path="url(#breeze-start-airflow-line-141)">╭─</text><text
class="breeze-start-airflow-r5" x="24.4" y="3460.4" textLength="231.8"
clip-path="url(#breeze-start-airflow-line-141)"> Debugging options </text><text
class="breeze-start-airflow-r5" x="256.2" y="3460.4" textLength="1183.4"
clip-path="url(#breeze-start-airflow-line-141)">──────────────────────────────────────────────────────────────
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3484.8"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-142)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3484.8" textLength="85.4"
clip-path="url(#breeze-start-airflow-line-142)">--debug</text><text
class="breeze-start-airflow-r1" x="195.2" y="3484.8" textLength="1244.4"
clip-path="url(#breeze-start-airflow-line-142)">Enable debugging for specific Airflow components. Can be
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3509.2"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-143)">│</text><text
class="breeze-start-airflow-r1" x="195.2" y="3509.2" textLength="1244.4"
clip-path="url(#breeze-start-airflow-line-143)">api-server, dag-processor, edge-worker, celery-worker.                          
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3533.6"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-144)">│</text><text
class="breeze-start-airflow-r7" x="195.2" y="3533.6" textLength="1244.4"
clip-path="url(#breeze-start-airflow-line-144)">(scheduler | triggerer | api-server | dag-processor | edge-worker | celery-worker)                &
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3558" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-145)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3558" textLength="122"
clip-path="url(#breeze-start-airflow-line-145)">--debugger</text><text
class="breeze-start-airflow-r1" x="195.2" y="3558" textLength="597.8"
clip-path="url(#breeze-start-airflow-line-145)">Debugger to use for debugging Airflow components.</text><text
clas [...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3582.4"
textLength="1464"
clip-path="url(#breeze-start-airflow-line-146)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-start-airflow-r1" x="1464" y="3582.4" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-146)">
+</text><text class="breeze-start-airflow-r5" x="0" y="3606.8"
textLength="24.4"
clip-path="url(#breeze-start-airflow-line-147)">╭─</text><text
class="breeze-start-airflow-r5" x="24.4" y="3606.8" textLength="195.2"
clip-path="url(#breeze-start-airflow-line-147)"> Common options </text><text
class="breeze-start-airflow-r5" x="219.6" y="3606.8" textLength="1220"
clip-path="url(#breeze-start-airflow-line-147)">───────────────────────────────────────────────────────────────────
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3631.2"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-148)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3631.2" textLength="97.6"
clip-path="url(#breeze-start-airflow-line-148)">--answer</text><text
class="breeze-start-airflow-r6" x="158.6" y="3631.2" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-148)">-a</text><text
class="breeze-start-airflow-r1" x="207.4" y="3631.2" textLength="317.2" clip-
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3655.6"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-149)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3655.6" textLength="109.8"
clip-path="url(#breeze-start-airflow-line-149)">--dry-run</text><text
class="breeze-start-airflow-r6" x="158.6" y="3655.6" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-149)">-D</text><text
class="breeze-start-airflow-r1" x="207.4" y="3655.6" textLength="719.8" cli
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3680" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-150)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3680" textLength="109.8"
clip-path="url(#breeze-start-airflow-line-150)">--verbose</text><text
class="breeze-start-airflow-r6" x="158.6" y="3680" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-150)">-v</text><text
class="breeze-start-airflow-r1" x="207.4" y="3680" textLength="585.6"
clip-path=" [...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3704.4"
textLength="12.2" clip-path="url(#breeze-start-airflow-line-151)">│</text><text
class="breeze-start-airflow-r4" x="24.4" y="3704.4" textLength="73.2"
clip-path="url(#breeze-start-airflow-line-151)">--help</text><text
class="breeze-start-airflow-r6" x="158.6" y="3704.4" textLength="24.4"
clip-path="url(#breeze-start-airflow-line-151)">-h</text><text
class="breeze-start-airflow-r1" x="207.4" y="3704.4" textLength="329.4" clip-pa
[...]
+</text><text class="breeze-start-airflow-r5" x="0" y="3728.8"
textLength="1464"
clip-path="url(#breeze-start-airflow-line-152)">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</text><text
class="breeze-start-airflow-r1" x="1464" y="3728.8" textLength="12.2"
clip-path="url(#breeze-start-airflow-line-152)">
</text>
</g>
</g>
diff --git a/dev/breeze/doc/images/output_start-airflow.txt
b/dev/breeze/doc/images/output_start-airflow.txt
index 0d9e8ae0427..a9977831b23 100644
--- a/dev/breeze/doc/images/output_start-airflow.txt
+++ b/dev/breeze/doc/images/output_start-airflow.txt
@@ -1 +1 @@
-12f65aa510878652aee52b8524aa59a4
+8c0ffb1a8bf03d918b4184e511ac5c34
diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py
b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
index 596be8d7207..8028f07d8bc 100644
--- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
@@ -503,6 +503,12 @@ option_executor_start_airflow = click.option(
"(mutually exclusive with --skip-assets-compilation).",
is_flag=True,
)
[email protected](
+ "--create-all-roles",
+ help="Creates all user roles for testing with FabAuthManager (viewer,
user, op, admin). "
+ "SimpleAuthManager always has all roles available.",
+ is_flag=True,
+)
@click.argument("extra-args", nargs=-1, type=click.UNPROCESSED)
@option_airflow_constraints_location
@option_airflow_constraints_mode_ci
@@ -565,6 +571,7 @@ def start_airflow(
debug_components: tuple[str, ...],
debugger: str,
dev_mode: bool,
+ create_all_roles: bool,
docker_host: str | None,
executor: str | None,
extra_args: tuple,
@@ -603,6 +610,7 @@ def start_airflow(
"[warning]You cannot skip asset compilation in dev mode! Assets
will be compiled!"
)
skip_assets_compilation = True
+
if use_airflow_version is None and not skip_assets_compilation:
# Now with the /ui project, lets only do a static build of /www and
focus on the /ui
run_compile_ui_assets(dev=dev_mode, run_in_background=True,
force_clean=False)
@@ -637,6 +645,7 @@ def start_airflow(
debugger=debugger,
db_reset=db_reset,
dev_mode=dev_mode,
+ create_all_roles=create_all_roles,
docker_host=docker_host,
executor=executor,
extra_args=extra_args,
diff --git
a/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
b/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
index 67ed4a81504..20696a4a760 100644
--- a/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
+++ b/dev/breeze/src/airflow_breeze/commands/developer_commands_config.py
@@ -285,9 +285,7 @@ DEVELOPER_PARAMETERS: dict[str, list[dict[str, str |
list[str]]]] = {
},
{
"name": "Other options",
- "options": [
- "--forward-credentials",
- ],
+ "options": ["--forward-credentials", "--create-all-roles"],
},
{
"name": "Debugging options",
diff --git
a/dev/breeze/src/airflow_breeze/files/simple_auth_manager_passwords.json
b/dev/breeze/src/airflow_breeze/files/simple_auth_manager_passwords.json
index 8f297bdae3d..1f74a7b6616 100644
--- a/dev/breeze/src/airflow_breeze/files/simple_auth_manager_passwords.json
+++ b/dev/breeze/src/airflow_breeze/files/simple_auth_manager_passwords.json
@@ -1 +1 @@
-{"admin": "admin", "viewer": "viewer"}
+{"admin": "admin", "viewer": "viewer", "user": "user", "op": "op"}
diff --git a/dev/breeze/src/airflow_breeze/params/shell_params.py
b/dev/breeze/src/airflow_breeze/params/shell_params.py
index bce82a35e12..f0bf4115019 100644
--- a/dev/breeze/src/airflow_breeze/params/shell_params.py
+++ b/dev/breeze/src/airflow_breeze/params/shell_params.py
@@ -156,6 +156,7 @@ class ShellParams:
celery_flower: bool = False
clean_airflow_installation: bool = False
collect_only: bool = False
+ create_all_roles: bool = False
debug_components: tuple[str, ...] = ()
debugger: str = "debugpy"
db_reset: bool = False
@@ -543,7 +544,9 @@ class ShellParams:
_set_var(_env, "AIRFLOW__CORE__AUTH_MANAGER", self.auth_manager_path)
_set_var(_env, "AIRFLOW__CORE__EXECUTOR", self.executor)
if self.auth_manager == SIMPLE_AUTH_MANAGER:
- _set_var(_env, "AIRFLOW__CORE__SIMPLE_AUTH_MANAGER_USERS",
"admin:admin,viewer:viewer")
+ _set_var(
+ _env, "AIRFLOW__CORE__SIMPLE_AUTH_MANAGER_USERS",
"admin:admin,viewer:viewer,user:user,op:op"
+ )
_set_var(
_env,
"AIRFLOW__CORE__SIMPLE_AUTH_MANAGER_PASSWORDS_FILE",
@@ -589,6 +592,7 @@ class ShellParams:
_set_var(_env, "CI_TARGET_BRANCH", self.airflow_branch)
_set_var(_env, "CI_TARGET_REPO", self.github_repository)
_set_var(_env, "COLLECT_ONLY", self.collect_only)
+ _set_var(_env, "CREATE_ALL_ROLES", self.create_all_roles)
_set_var(_env, "COMMIT_SHA", None, commit_sha())
_set_var(_env, "COMPOSE_FILE", self.compose_file)
_set_var(_env, "DB_RESET", self.db_reset)
diff --git a/scripts/in_container/check_environment.sh
b/scripts/in_container/check_environment.sh
index 6c385f98173..77dcb636283 100755
--- a/scripts/in_container/check_environment.sh
+++ b/scripts/in_container/check_environment.sh
@@ -114,8 +114,18 @@ function startairflow_if_requested() {
if airflow config get-value core auth_manager | grep -q
"FabAuthManager"; then
airflow users create -u admin -p admin -f Thor -l Adminstra -r
Admin -e [email protected] || true
+
+ # Create all roles for testing if CREATE_ALL_ROLES is set
+ if [[ "${CREATE_ALL_ROLES}" == "true" ]]; then
+ echo "Creating all test roles for FabAuthManager..."
+ airflow users create -u viewer -p viewer -f Test -l Viewer -r
Viewer -e [email protected] || true
+ airflow users create -u user -p user -f Test -l User -r User
-e [email protected] || true
+ airflow users create -u op -p op -f Test -l Op -r Op -e
[email protected] || true
+ airflow users create -u testadmin -p testadmin -f Test -l
TestAdmin -r Admin -e [email protected] || true
+ echo "All test roles created successfully for FabAuthManager."
+ fi
else
- echo "Skipping user creation as auth manager different from Fab is
used"
+ echo "SimpleAuthManager detected. All roles (admin, viewer, user,
op) are always available via configuration in
.dev/breeze/src/airflow_breeze/files/simple_auth_manager_passwords.json"
fi
fi
return $?