This repository was archived by the owner on Mar 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
feat: support sigv4 signing #169
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
258ed30
feat: support sigv4 signing
obanby 5f2f038
Set signuture date on every request instead of at construction
obanby 4ac35b2
- Ported code from aws-sdk-go for buildingCanonicalHeaders
obanby c25240c
fix consistent naming for sigV4
obanby 7e10b47
- Added attributions for ported code
obanby 1647ce4
rewrite stripExcessSpaces
obanby 967bc1d
rewrite getURIPath
obanby 4d32570
rewrite escapePath
obanby 1a1e5ee
rewrite buildCanonicalHeaders
obanby eb79f3c
improve testability
obanby ecb96cc
reduce types scope, to private
obanby 72c8512
Added validation to avoid partial configuration for sigv4
obanby efcf534
Addressed CI lint comments
obanby 33c2245
Addressed formating and linter suggestions
obanby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package sigv4 | ||
|
||
const ( | ||
// Amazon Managed Service for Prometheus | ||
awsServiceName = "aps" | ||
|
||
signingAlgorithm = "AWS4-HMAC-SHA256" | ||
|
||
authorizationHeaderKey = "Authorization" | ||
amzDateKey = "X-Amz-Date" | ||
|
||
// emptyStringSHA256 is the hex encoded sha256 value of an empty string | ||
emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` | ||
|
||
// timeFormat is the time format to be used in the X-Amz-Date header or query parameter | ||
timeFormat = "20060102T150405Z" | ||
|
||
// shortTimeFormat is the shorten time format used in the credential scope | ||
shortTimeFormat = "20060102" | ||
|
||
// contentSHAKey is the SHA256 of request body | ||
contentSHAKey = "X-Amz-Content-Sha256" | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.