[v3-2-test] Apply requires_access_event_log to GET /eventLogs list endpoint (#67185)#67211
Merged
Conversation
…dpoint (#67185) * Apply requires_access_event_log to GET /eventLogs list endpoint * Fail closed on non-integer event_log_id; fix list-endpoint test mock requires_access_event_log silently swallowed ValueError on non-integer event_log_id and fell through to the generic AUDIT_LOG check. Raise HTTPException(400) instead — matches the fail-closed pattern used by requires_access_backfill. Also fix test_requires_access_event_log_no_path_param_uses_generic_check: the test mocked request.path_params = {} but left request.query_params as an auto-created Mock attribute, whose .get("dag_id") returned a Mock (truthy non-None). requires_access_dag then resolved dag_id to that Mock and called is_authorized_dag with the wrong DagDetails. Mock both path_params and query_params as empty dicts. --------- (cherry picked from commit b28681f) Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com> Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com> Co-authored-by: vatsrahul1001 <rah.sharma11@gmail.com>
1 task
vatsrahul1001
added a commit
that referenced
this pull request
May 20, 2026
…dpoint (#67185) (#67211) * Apply requires_access_event_log to GET /eventLogs list endpoint * Fail closed on non-integer event_log_id; fix list-endpoint test mock requires_access_event_log silently swallowed ValueError on non-integer event_log_id and fell through to the generic AUDIT_LOG check. Raise HTTPException(400) instead — matches the fail-closed pattern used by requires_access_backfill. Also fix test_requires_access_event_log_no_path_param_uses_generic_check: the test mocked request.path_params = {} but left request.query_params as an auto-created Mock attribute, whose .get("dag_id") returned a Mock (truthy non-None). requires_access_dag then resolved dag_id to that Mock and called is_authorized_dag with the wrong DagDetails. Mock both path_params and query_params as empty dicts. --------- (cherry picked from commit b28681f) Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com> Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com> Co-authored-by: vatsrahul1001 <rah.sharma11@gmail.com>
vatsrahul1001
added a commit
that referenced
this pull request
May 20, 2026
…dpoint (#67185) (#67211) * Apply requires_access_event_log to GET /eventLogs list endpoint * Fail closed on non-integer event_log_id; fix list-endpoint test mock requires_access_event_log silently swallowed ValueError on non-integer event_log_id and fell through to the generic AUDIT_LOG check. Raise HTTPException(400) instead — matches the fail-closed pattern used by requires_access_backfill. Also fix test_requires_access_event_log_no_path_param_uses_generic_check: the test mocked request.path_params = {} but left request.query_params as an auto-created Mock attribute, whose .get("dag_id") returned a Mock (truthy non-None). requires_access_dag then resolved dag_id to that Mock and called is_authorized_dag with the wrong DagDetails. Mock both path_params and query_params as empty dicts. --------- (cherry picked from commit b28681f) Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com> Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com> Co-authored-by: vatsrahul1001 <rah.sharma11@gmail.com>
vatsrahul1001
added a commit
that referenced
this pull request
May 21, 2026
…dpoint (#67185) (#67211) * Apply requires_access_event_log to GET /eventLogs list endpoint * Fail closed on non-integer event_log_id; fix list-endpoint test mock requires_access_event_log silently swallowed ValueError on non-integer event_log_id and fell through to the generic AUDIT_LOG check. Raise HTTPException(400) instead — matches the fail-closed pattern used by requires_access_backfill. Also fix test_requires_access_event_log_no_path_param_uses_generic_check: the test mocked request.path_params = {} but left request.query_params as an auto-created Mock attribute, whose .get("dag_id") returned a Mock (truthy non-None). requires_access_dag then resolved dag_id to that Mock and called is_authorized_dag with the wrong DagDetails. Mock both path_params and query_params as empty dicts. --------- (cherry picked from commit b28681f) Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com> Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com> Co-authored-by: vatsrahul1001 <rah.sharma11@gmail.com>
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.
Apply requires_access_event_log to GET /eventLogs list endpoint
Fail closed on non-integer event_log_id; fix list-endpoint test mock
requires_access_event_log silently swallowed ValueError on non-integer
event_log_id and fell through to the generic AUDIT_LOG check. Raise
HTTPException(400) instead — matches the fail-closed pattern used by
requires_access_backfill.
Also fix test_requires_access_event_log_no_path_param_uses_generic_check:
the test mocked request.path_params = {} but left request.query_params
as an auto-created Mock attribute, whose .get("dag_id") returned a Mock
(truthy non-None). requires_access_dag then resolved dag_id to that
Mock and called is_authorized_dag with the wrong DagDetails. Mock both
path_params and query_params as empty dicts.
(cherry picked from commit b28681f)
Co-authored-by: Pierre Jeambrun pierrejbrun@gmail.com
Co-authored-by: Rahul Vats 43964496+vatsrahul1001@users.noreply.github.com
Co-authored-by: vatsrahul1001 rah.sharma11@gmail.com