Skip to content

Move access_denied_message webserver config to fab #50208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions airflow-core/src/airflow/cli/commands/config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ def message(self) -> str | None:
config=ConfigParameter("webserver", "session_lifetime_minutes"),
renamed_to=ConfigParameter("fab", "session_lifetime_minutes"),
),
ConfigChange(
config=ConfigParameter("webserver", "access_denied_message"),
renamed_to=ConfigParameter("fab", "access_denied_message"),
),
ConfigChange(
config=ConfigParameter("webserver", "base_url"),
renamed_to=ConfigParameter("api", "base_url"),
Expand Down
7 changes: 0 additions & 7 deletions airflow-core/src/airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1693,13 +1693,6 @@ operators:
webserver:
description: ~
options:
access_denied_message:
description: |
The message displayed when a user attempts to execute actions beyond their authorised privileges.
version_added: 2.7.0
type: string
example: ~
default: "Access is Denied"
secret_key:
description: |
Secret key used to run your api server. It should be as random as possible. However, when running
Expand Down
1 change: 1 addition & 0 deletions airflow-core/src/airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]:
("api", "access_logfile"): ("webserver", "access_logfile", "3.0"),
("triggerer", "capacity"): ("triggerer", "default_capacity", "3.0"),
("api", "expose_config"): ("webserver", "expose_config", "3.0.1"),
("fab", "access_denied_message"): ("webserver", "access_denied_message", "3.0.2"),
}

# A mapping of new section -> (old section, since_version).
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_validate_provider_info_with_schema():
"provider_id, min_version",
[
("amazon", "2.10.0"),
("fab", "3.0.0"),
("fab", "3.0.2"),
],
)
def test_get_min_airflow_version(provider_id: str, min_version: str):
Expand Down
8 changes: 8 additions & 0 deletions providers/fab/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ source-date-epoch: 1745478857
# In such case adding >= NEW_VERSION and bumping to NEW_VERSION in a provider have
# to be done in the same PR
versions:
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
Expand All @@ -59,6 +60,13 @@ config:
fab:
description: This section contains configs specific to FAB provider.
options:
access_denied_message:
description: |
The message displayed when a user attempts to execute actions beyond their authorised privileges.
version_added: 2.0.2
type: string
example: ~
default: "Access is Denied"
auth_rate_limited:
description: |
Boolean for enabling rate limiting on authentication endpoints.
Expand Down
8 changes: 4 additions & 4 deletions providers/fab/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "apache-airflow-providers-fab"
version = "2.0.2"
version = "2.0.3"
description = "Provider package apache-airflow-providers-fab for Apache Airflow"
readme = "README.rst"
authors = [
Expand Down Expand Up @@ -57,7 +57,7 @@ license-files = ["NOTICE", "*/LICENSE*"]
# Make sure to run ``breeze static-checks --type update-providers-dependencies --all-files``
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
dependencies = [
"apache-airflow>=3.0.0",
"apache-airflow>=3.0.2",
"apache-airflow-providers-common-compat>=1.2.1",
# Blinker use for signals in Flask, this is an optional dependency in Flask 2.2 and lower.
# In Flask 2.3 it becomes a mandatory dependency, and flask signals are always available.
Expand Down Expand Up @@ -127,8 +127,8 @@ apache-airflow-providers-common-sql = {workspace = true}
apache-airflow-providers-standard = {workspace = true}

[project.urls]
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.2"
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.2/changelog.html"
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.3"
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.3/changelog.html"
"Bug Tracker" = "https://github.com/apache/airflow/issues"
"Source Code" = "https://github.com/apache/airflow"
"Slack Chat" = "https://s.apache.org/airflow-slack"
Expand Down
6 changes: 3 additions & 3 deletions providers/fab/src/airflow/providers/fab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

__all__ = ["__version__"]

__version__ = "2.0.2"
__version__ = "2.0.3"

if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
"3.0.0"
"3.0.2"
):
raise RuntimeError(
f"The package `apache-airflow-providers-fab:{__version__}` needs Apache Airflow 3.0.0+"
f"The package `apache-airflow-providers-fab:{__version__}` needs Apache Airflow 3.0.2+"
)
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ def get_provider_info():
"fab": {
"description": "This section contains configs specific to FAB provider.",
"options": {
"access_denied_message": {
"description": "The message displayed when a user attempts to execute actions beyond their authorised privileges.\n",
"version_added": "2.0.2",
"type": "string",
"example": None,
"default": "Access is Denied",
},
"auth_rate_limited": {
"description": "Boolean for enabling rate limiting on authentication endpoints.\n",
"version_added": "1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion providers/fab/src/airflow/providers/fab/www/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@


def get_access_denied_message():
return conf.get("webserver", "access_denied_message")
return conf.get("fab", "access_denied_message")


def has_access_with_pk(f):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ packages = []
"apache-airflow-providers-exasol>=4.6.1"
]
"fab" = [
"apache-airflow-providers-fab>=2.0.2" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
"apache-airflow-providers-fab>=2.0.3" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
]
"facebook" = [
"apache-airflow-providers-facebook>=3.7.0"
Expand Down Expand Up @@ -422,7 +422,7 @@ packages = []
"apache-airflow-providers-edge3>=1.0.0",
"apache-airflow-providers-elasticsearch>=5.5.2",
"apache-airflow-providers-exasol>=4.6.1",
"apache-airflow-providers-fab>=2.0.2", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
"apache-airflow-providers-fab>=2.0.3", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
"apache-airflow-providers-facebook>=3.7.0",
"apache-airflow-providers-ftp>=3.12.0",
"apache-airflow-providers-git>=0.0.2", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/pre_commit/update_airflow_pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# minimum versions for compatibility with Airflow 3
MIN_VERSION_OVERRIDE: dict[str, Version] = {
"amazon": parse_version("2.1.3"),
"fab": parse_version("2.0.2"),
"fab": parse_version("2.0.3"),
"openlineage": parse_version("2.3.0"),
"git": parse_version("0.0.2"),
"common.messaging": parse_version("1.0.1"),
Expand Down