forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
providers/aws: Refactor + Fix 2x Authorization header append issue. (o…
…pen-policy-agent#5475) This commit refactors the shared AWS Sig v4 signing code, specifically to prevent the issue behind open-policy-agent#5472. The underlying problem for was that the `"Authorization"` header was being appended *twice* to the request, but only for the AWS REST plugin, because the value was pulled twice from the signed headers map. This was not caught by the unit tests, because the REST plugin's unit tests all assumed the header was single-valued and canonicalized. We now explicitly test for that condition in the unit tests, and the signing code now returns the AWS headers map separately from the value for the `"Authorization"` header, reducing the potential for this mistake to happen in the future. Fixes: open-policy-agent#5472 Signed-off-by: Philip Conrad <[email protected]>
- Loading branch information
1 parent
d1c61e3
commit 1d1cb35
Showing
4 changed files
with
24 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters