diff --git a/atc/api/policychecker/handler_test.go b/atc/api/policychecker/handler_test.go index 2fd1ca95f..76a0903f2 100644 --- a/atc/api/policychecker/handler_test.go +++ b/atc/api/policychecker/handler_test.go @@ -2,7 +2,6 @@ package policychecker_test import ( "errors" - "github.com/concourse/concourse/atc/policy/policyfakes" "io/ioutil" "net/http" "net/http/httptest" @@ -12,6 +11,7 @@ import ( "github.com/concourse/concourse/atc/api/policychecker" "github.com/concourse/concourse/atc/api/policychecker/policycheckerfakes" "github.com/concourse/concourse/atc/policy" + "github.com/concourse/concourse/atc/policy/policyfakes" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/atc/policy/opa/opa.go b/atc/policy/opa/opa.go index b24e63142..1c6207eb5 100644 --- a/atc/policy/opa/opa.go +++ b/atc/policy/opa/opa.go @@ -17,7 +17,7 @@ type OpaConfig struct { URL string `long:"opa-url" description:"OPA policy check endpoint."` Timeout time.Duration `long:"opa-timeout" default:"5s" description:"OPA request timeout."` ResultAllowedKey string `long:"opa-result-allowed-key" description:"Key name of if pass policy check in OPA returned result. Expects a boolean value." default:"result.allowed"` - ResultShouldBlockKey string `long:"opa-result-should-block-key" description:"Key name of if should block current action in OPA returned result. Expects a boolean value."` + ResultShouldBlockKey string `long:"opa-result-should-block-key" description:"Key name of if should block current action in OPA returned result. Expects a boolean value." default:"result.block"` ResultMessagesKey string `long:"opa-result-messages-key" description:"Key name of messages in OPA returned result." default:"result.reasons"` } diff --git a/hack/overrides/opa.yml b/hack/overrides/opa.yml index f89dc9a09..92595d2ab 100644 --- a/hack/overrides/opa.yml +++ b/hack/overrides/opa.yml @@ -12,6 +12,9 @@ services: CONCOURSE_POLICY_CHECK_FILTER_HTTP_METHODS: PUT,POST # uncomment to configure + # CONCOURSE_OPA_RESULT_ALLOW_KEY: result.allowed + # CONCOURSE_OPA_RESULT_SHOULD_BLOCK_KEY: result.block + # CONCOURSE_OPA_RESULT_MESSAGES_KEY: result.reasons # CONCOURSE_POLICY_CHECK_FILTER_ACTION: ListWorkers,ListContainers,UseImage,SaveConfig # CONCOURSE_POLICY_CHECK_FILTER_ACTION_SKIP: PausePipeline,UnpausePipeline