Skip to content

[Command] Run Tests Against Last Audit Logs #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gemanor opened this issue Mar 20, 2025 · 1 comment
Closed

[Command] Run Tests Against Last Audit Logs #72

gemanor opened this issue Mar 20, 2025 · 1 comment
Assignees

Comments

@gemanor
Copy link
Collaborator

gemanor commented Mar 20, 2025

The command should read all the audit (decision) logs from Permit API and run them against a running PDP to print the diff log between the check functions

Implementation Details

  • The command is permit test run audit
  • Command should accept the following arguments as filter arguments for the audit logs:
    • --time-frame a number of hours to fetch the audit logs (between 6 to 72) - default to 24
    • --source-pdp is an ID of the PDP to filter the audit logs from. In case not provided, will take from all the PDPs
    • --users comma-separated list of users to filter the logs
    • --resources comma-separated list of users to filter the logs
    • --tenant a tenant to filter the logs
    • --action an action to filter the logs
    • --decision a decision
  • The --pdp-url argument is the URL that the check function will run against. Default is http://localhost:7766
  • The command flow is:
  • In case no arguments are presented, the command should run with default values and show the diff
  • In case there's a PDP error (not running or not available) the command should fail in the first check and not try to run all the checks

Edge Cases (for PR screencast)

  • Happy flow with no arguments and PDP up and running
  • No argument and pdp-url isn't reachable
  • Happy flow with some filter arguments (better all arguments)
  • Failed flow with bad argument values
  • Failed flow with non-existing source-pdp

💡 Before participating in the issue or offering a bounty, please make sure you carefully read the contribution guidelines. PRs that do not adhere to the guidelines will be closed with no further notice.

@daveads
Copy link
Collaborator

daveads commented Mar 23, 2025

On it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants