Skip to content

Added Print for Policy Outcome#1287

Open
straubt1 wants to merge 1 commit intohashicorp:mainfrom
straubt1:add-outcome-output-field
Open

Added Print for Policy Outcome#1287
straubt1 wants to merge 1 commit intohashicorp:mainfrom
straubt1:add-outcome-output-field

Conversation

@straubt1
Copy link
Contributor

@straubt1 straubt1 commented Mar 6, 2026

Description

The policy-set-outcomes API response includes an output array on each outcome object containing print entries emitted by Sentinel policies. The Outcome struct does not expose this field.

There are additional fields that can be added, but "print" is the output of the the policy logs.

Changes

  • Added OutcomeOutput struct with a Print string field (jsonapi:"attr,print")
  • Added Output []OutcomeOutput field to Outcome struct (jsonapi:"attr,output,omitempty")
  • Added unit tests in policy_evaluation_test.go covering field present and field absent cases
  • Updated policy_evaluation_beta_test.go with an assertion and comment for the Output field
  • Added CHANGELOG entry under Enhancements

Testing

  • go build ./... passes
  • go vet ./... passes (pre-existing warning in examples/backing_data/main.go unrelated to this change)
  • Unit tests TestPolicySetOutcomes_OutcomeOutputDeserialization and TestPolicySetOutcomes_OutcomeOutputEmpty pass

@straubt1 straubt1 requested a review from a team as a code owner March 6, 2026 02:16
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

Successfully merging this pull request may close these issues.

1 participant