diff --git a/app/controllers/secrets_controller.rb b/app/controllers/secrets_controller.rb index c61eb5fe05..0030c5d1e9 100644 --- a/app/controllers/secrets_controller.rb +++ b/app/controllers/secrets_controller.rb @@ -72,6 +72,8 @@ def batch end render(json: result) + rescue JSON::GeneratorError + raise Errors::Conjur::BadSecretEncoding, result rescue Encoding::UndefinedConversionError raise Errors::Conjur::BadSecretEncoding, result rescue Exceptions::RecordNotFound => e diff --git a/cucumber/api/features/secrets_batch.feature b/cucumber/api/features/secrets_batch.feature index 1f156c5014..20ff61b6e2 100644 --- a/cucumber/api/features/secrets_batch.feature +++ b/cucumber/api/features/secrets_batch.feature @@ -136,7 +136,7 @@ Feature: Batch retrieval of secrets When I GET "/secrets?variable_ids=cucumber:variable:secret3" Then the HTTP response status code is 406 - @negative @acceptance + @negative @smoke Scenario: Fails with 406 on retrieval of multiple secrets with improper header Given I create a binary secret value for resource "cucumber:variable:secret3" And I add the secret value "v2" to the resource "cucumber:variable:secret2"