Skip to content

feat(cli): --journey flag for campus audit traces search #63

Closed

Description

@ngjunsiang

Summary

campus audit traces search deliberately shipped without the
server's login-journey filter: PR #55 omitted --journey because
campus-api-python's Traces.search() did not carry it, so the
--dry-run snippets would not have been faithful to what the
library supported. The command help still documents the gap
(campus_cli/audit/traces.py):

The server's login-journey filter is not exposed here yet —
campus-api-python's search() does not carry it.

The blocker is now resolved: campus-api-python#110 added the
keyword-only journey_id filter to Traces.search() (merged in
campus-api-python#111), matching the server's /audit/v1/traces/search?journey_id=…
route (campus#803, shipped in campus#812 on weekly).

Proposed change

In campus_cli/audit/traces.py traces_search:

  • Add journey: Optional[str] = typer.Option(None, "--journey", help="Filter by login-journey ID") alongside --user/--client/--api-key-id.
  • Pass journey_id=journey through to api.traces.search(...).
  • Include "journey_id": journey in the --dry-run kwargs dict (None values are already dropped by _query_operation).
  • Drop the "not exposed here yet" paragraph from the docstring.
  • Test: kwarg passthrough mirrors the existing search tests in tests/unit/test_audit.py.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions