You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described here - https://developer.hashicorp.com/terraform/cloud-docs/api-docs/policy-checks#list-policy-checks, the output of a policy-check is expected to include the Sentinel hash, while it is understood that the Logs function in the PolicyCheck interface returns the same result, the latter is a data stream (io.Reader) and cannot be marshalled into JSON easily. I wish to understand if this is an intentional decision.
Having go-tfe return the exact output as the Web-API is a reasonable expectation.
Testing plan
curl --header "Authorization: Bearer $TOKEN" https://app.terraform.io/api/v2/runs/<run-ID>/policy-checks
returns a response which includes a "sentinel": hash containing an easily navigable policy-check result schema, however the PolicyCheck.List() function does not return this data, and the PolicyCheck.Logs() function returns an io.Reader which is just a data-stream and makes searching for a specific policy-set result more tedious
Expected Behavior
PolicyCheck.List() returns the data in a similar format to the CURL output , or the PolicyCheck.Logs() function must have an option to return outputs that can be Marshaled into JSON.
Actual Behavior
PolicyCheck.List() does not include data that the CURL output returns and PolicyCheck.Logs() returns a data-stream that can only be Marshaled to string
Additional Context
As an alternative we are using the terrrasnek python Library which provides the output in the format that we need
The text was updated successfully, but these errors were encountered:
The output of PolicyCheck List does not include the
sentinel
hash otherwise returned by the API Endpoint as documented herehttps://developer.hashicorp.com/terraform/cloud-docs/api-docs/policy-checks#list-policy-checks
go-tfe version
Description
As described here - https://developer.hashicorp.com/terraform/cloud-docs/api-docs/policy-checks#list-policy-checks, the output of a policy-check is expected to include the Sentinel hash, while it is understood that the
Logs
function in the PolicyCheck interface returns the same result, the latter is a data stream (io.Reader) and cannot be marshalled into JSON easily. I wish to understand if this is an intentional decision.Having go-tfe return the exact output as the Web-API is a reasonable expectation.
Testing plan
curl --header "Authorization: Bearer $TOKEN" https://app.terraform.io/api/v2/runs/<run-ID>/policy-checks
returns a response which includes a
"sentinel":
hash containing an easily navigable policy-check result schema, however thePolicyCheck.List()
function does not return this data, and thePolicyCheck.Logs()
function returns anio.Reader
which is just a data-stream and makes searching for a specific policy-set result more tediousExpected Behavior
PolicyCheck.List()
returns the data in a similar format to the CURL output , or thePolicyCheck.Logs()
function must have an option to return outputs that can be Marshaled into JSON.Actual Behavior
PolicyCheck.List()
does not include data that the CURL output returns andPolicyCheck.Logs()
returns a data-stream that can only be Marshaled to stringAdditional Context
As an alternative we are using the terrrasnek python Library which provides the output in the format that we need
The text was updated successfully, but these errors were encountered: