Skip to content

Support --output-rule with --server-side #1215

Description

@jbpros

kosli evaluate trail|trails --output-rule works locally, but not with --server-side, so the CLI refuses the combination for now.

Why

The server-side path only returns allow and violations:

  • opa-lambda filters them: evaluator/evaluator.go only queries those two rules.
  • server passes result through as-is.
  • CLI only reads allow and violations back (internal/evaluations/client.go).

What it takes

  1. opa-lambda: query the extra rules too.
  2. server: accept the rule list in POST /evaluations and pass it to the lambda.
  3. CLI: send --output-rule, read the extra keys, drop the refusal.

Bonus

kosli evaluate policy already stores the whole result in the decision attestation. So once the lambda returns extra rules, a policy's report gets recorded as evidence for free.

To keep in mind

  • Match the local behaviour: a missing rule fails, an undefined one gives null.
  • The lambda has a 6 MB payload limit, and big reports add up.

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