Expose owner_display_name in event log API and Audit Log UI#69095
Closed
gingeekrishna wants to merge 2 commits into
Closed
Expose owner_display_name in event log API and Audit Log UI#69095gingeekrishna wants to merge 2 commits into
gingeekrishna wants to merge 2 commits into
Conversation
owner_display_name is stored in the Log table and populated by action_logging from the auth manager user display value since 2.8.0, but was never returned by the /api/v2/eventLogs endpoint. Auth managers use owner for a stable principal identifier while owner_display_name provides the human-readable display name. Without this field exposed, API consumers and the Audit Log UI cannot show the more readable value even though it is already stored. This adds owner_display_name to EventLogResponse alongside the existing owner field, adds exact-match, ILIKE-pattern, and prefix-pattern filters (owner_display_name, owner_display_name_pattern, owner_display_name_prefix_pattern) to match the existing owner filter family, adds owner_display_name to the allowed sort attributes, and updates the Audit Log UI User column to prefer owner_display_name when present and fall back to owner when it is null. The storage and write path are unchanged; this is purely additive to the read path. closes: apache#68334
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Log.owner_display_nameis stored in the database and populated byaction_loggingfrom the auth manager user display value since Airflow 2.8.0 (via AIP-56), but was never returned by the/api/v2/eventLogsendpoint or shown in the Audit Log UI.Auth managers use
owneras a stable principal identifier (e.g.jsmith, an email, or an opaque ID) whileowner_display_nameholds the human-readable display name (e.g.John Smith). Omittingowner_display_namefrom the API forces API consumers and the Audit Log UI to show the raw identifier even when a more readable name has already been stored.Changes
API (additive —
ownerfield unchanged):owner_display_name: str | NonetoEventLogResponseowner_display_nameexact-match filterowner_display_name_pattern(ILIKE substring) filterowner_display_name_prefix_pattern(index-friendly prefix) filterowner_display_nameto the allowed sort attributesUI:
owner_display_name ?? owner— shows the human-readable name when present, falls back toownerwhennullOpenAPI / TypeScript:
EventLogResponseschema updated withowner_display_namepropertyGetEventLogsDataupdated with the new filter parameters and updatedorderBydescriptionReview comment responses
owner_display_nameis already being set —action_logginginairflow-core/src/airflow/api_fastapi/logging/decorators.py(line 159) writesowner_display_name=user_displayon every logged request. TheLog.__init__column has existed since the 2.8.0 migration (0005_2_8_0_add_owner_display_name_to_audit_log_table.py). This PR only exposes it through the read path.owner_display_name_prefix_patternandowner_display_name_pattern"): Both are added in this PR alongside the existingowner_pattern/owner_prefix_patternpair.ownerwhile the display showsowner_display_name"): The new filter/sort parameters operate onLog.owner_display_namedirectly, so search and sort are consistent with the displayed value.Data flow
Security
Same access control as
owner(gated byrequires_access_event_log("GET")plus per-DAG audit log permission). Same trust boundary — both fields are populated by the auth manager. Same rendering path — React escapes the cell content. Follows the existingdag_display_name/task_display_nameprecedent in the same response model.closes: #68334
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (claude-sonnet-4-6) following the guidelines