Skip to content

Commit

Permalink
Merge pull request #2481 from cyberark/fix-batch-retrieval
Browse files Browse the repository at this point in the history
Fix binary secrets values behavior in batch secrets retrieval api after ruby upgrade
  • Loading branch information
sashaCher authored Feb 9, 2022
2 parents 16ff37e + d04d7f7 commit c31f2c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/secrets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cucumber/api/features/secrets_batch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c31f2c8

Please sign in to comment.