Skip to content
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
35 changes: 18 additions & 17 deletions airflow/opa-auth-manager/opa_auth_manager/opa_fab_auth_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from airflow.stats import Stats
from airflow.utils.log.logging_mixin import LoggingMixin
from cachetools import TTLCache, cachedmethod
from typing import override
from typing import Optional, Union
from overrides import override
import json
import requests

Expand Down Expand Up @@ -132,8 +133,8 @@ def is_authorized_configuration(
self,
*,
method: ResourceMethod,
details: ConfigurationDetails | None = None,
user: BaseUser | None = None,
details: Optional[ConfigurationDetails] = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to perform a given action on
Expand Down Expand Up @@ -178,8 +179,8 @@ def is_authorized_connection(
self,
*,
method: ResourceMethod,
details: ConnectionDetails | None = None,
user: BaseUser | None = None,
details: Optional[ConnectionDetails] = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to perform a given action on a connection.
Expand Down Expand Up @@ -223,9 +224,9 @@ def is_authorized_dag(
self,
*,
method: ResourceMethod,
access_entity: DagAccessEntity | None = None,
details: DagDetails | None = None,
user: BaseUser | None = None,
access_entity: Optional[DagAccessEntity] = None,
details: Optional[DagDetails] = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to perform a given action on a DAG.
Expand Down Expand Up @@ -277,8 +278,8 @@ def is_authorized_dataset(
self,
*,
method: ResourceMethod,
details: DatasetDetails | None = None,
user: BaseUser | None = None,
details: Optional[DatasetDetails] = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to perform a given action on a dataset.
Expand Down Expand Up @@ -322,8 +323,8 @@ def is_authorized_pool(
self,
*,
method: ResourceMethod,
details: PoolDetails | None = None,
user: BaseUser | None = None,
details: Optional[PoolDetails] = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to perform a given action on a pool.
Expand Down Expand Up @@ -367,8 +368,8 @@ def is_authorized_variable(
self,
*,
method: ResourceMethod,
details: VariableDetails | None = None,
user: BaseUser | None = None,
details: Optional[VariableDetails] = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to perform a given action on a variable.
Expand Down Expand Up @@ -412,7 +413,7 @@ def is_authorized_view(
self,
*,
access_view: AccessView,
user: BaseUser | None = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to access a read-only state of the installation.
Expand Down Expand Up @@ -446,9 +447,9 @@ def is_authorized_view(
def is_authorized_custom_view(
self,
*,
method: ResourceMethod | str,
method: Union[ResourceMethod, str],
resource_name: str,
user: BaseUser | None = None,
user: Optional[BaseUser] = None,
) -> bool:
"""
Return whether the user is authorized to perform a given action on a custom view.
Expand Down
Loading