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
8 changes: 7 additions & 1 deletion airflow-core/src/airflow/jobs/triggerer_job_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
GetTICount,
GetVariable,
GetXCom,
MaskSecret,
OKResponse,
PutVariable,
SetXCom,
Expand Down Expand Up @@ -269,7 +270,8 @@ def from_api_response(cls, response: HITLDetailResponse) -> HITLDetailResponseRe
| GetDagRunState
| GetDRCount
| GetHITLDetailResponse
| UpdateHITLDetail,
| UpdateHITLDetail
| MaskSecret,
Field(discriminator="type"),
]
"""
Expand Down Expand Up @@ -501,6 +503,10 @@ def _handle_request(self, msg: ToTriggerSupervisor, log: FilteringBoundLogger, r
elif isinstance(msg, GetHITLDetailResponse):
api_resp = self.client.hitl.get_detail_response(ti_id=msg.ti_id)
resp = HITLDetailResponseResult.from_api_response(response=api_resp)
elif isinstance(msg, MaskSecret):
from airflow.sdk.execution_time.secrets_masker import mask_secret

mask_secret(msg.value, msg.name)
else:
raise ValueError(f"Unknown message type {type(msg)}")

Expand Down
2 changes: 2 additions & 0 deletions airflow-core/tests/unit/jobs/test_triggerer_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,13 @@ async def run(self, **args) -> AsyncIterator[TriggerEvent]:

from airflow.sdk import Variable
from airflow.sdk.execution_time.xcom import XCom
from airflow.sdk.log import mask_secret

conn = await sync_to_async(BaseHook.get_connection)("test_connection")
self.log.info("Loaded conn %s", conn.conn_id)

get_variable_value = await sync_to_async(Variable.get)("test_get_variable")
await sync_to_async(mask_secret)(get_variable_value)
self.log.info("Loaded variable %s", get_variable_value)

get_xcom_value = await sync_to_async(XCom.get_one)(
Expand Down
Loading