-
Notifications
You must be signed in to change notification settings - Fork 55
fix(rt): import signing test suite #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
A new generated diff is ready to view: __generated-main...__generated-fix-signing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
| @Test | ||
| fun testSigv4TestSuiteHeaders() { | ||
| assertTrue(testSuiteDir.isDirectory) | ||
|
|
||
| val tests = testDirs.map { dir -> | ||
| try { | ||
| val req = getRequest(dir) | ||
| val sreq = getSignedRequest(dir) | ||
| val config = getSigningConfig(dir) ?: DefaultTestSigningConfig | ||
| Sigv4TestSuiteTest(dir, req, sreq, config.build()) | ||
| } catch (ex: Exception) { | ||
| println("failed to get request from $dir: ${ex.message}") | ||
| throw ex | ||
| } | ||
| } | ||
|
|
||
| testSigv4Middleware(tests) | ||
| } | ||
|
|
||
| @Test | ||
| fun testSigv4TestSuiteQuery() { | ||
| assertTrue(testSuiteDir.isDirectory) | ||
|
|
||
| val tests = testDirs.map { dir -> | ||
| try { | ||
| val req = getRequest(dir) | ||
| val sreq = getQuerySignedRequest(dir) | ||
| val config = getSigningConfig(dir) ?: DefaultTestSigningConfig | ||
| config.signatureType = AwsSignatureType.HTTP_REQUEST_VIA_QUERY_PARAMS | ||
| Sigv4TestSuiteTest(dir, req, sreq, config.build()) | ||
| } catch (ex: Exception) { | ||
| println("failed to get request from $dir: ${ex.message}") | ||
| throw ex | ||
| } | ||
| } | ||
|
|
||
| testSigv4Middleware(tests) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Duplicated code
|
A new generated diff is ready to view: __generated-main...__generated-fix-signing |
| .walkTopDown() | ||
| .filter { !it.isDirectory && it.name == "request.txt" } | ||
| .filterNot { it.parentFile.name in disabledTests } | ||
| // .filter{ it.parentFile.name == "get-vanilla-query-order-key-case" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
seems like dead code
| // re-enable after https://github.com/awslabs/aws-crt-java/pull/419 is merged | ||
| "get-vanilla-utf8-query", | ||
|
|
||
| // fixme - revisit why this fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question
does this need more context if someone else digs into it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no I don't think so. I think it will be fixed after the other utf8 issue is fixed but if not it's just a matter of diving into the results.
| */ | ||
| private fun testSigv4Middleware(tests: Sequence<Sigv4TestSuiteTest>): Unit = runBlocking { | ||
| tests.forEach { test -> | ||
| // println("running sigv4 middleware test for: ${test.path}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
dead code
|
Kudos, SonarCloud Quality Gate passed!
|
|
A new generated diff is ready to view: __generated-main...__generated-fix-signing |
1 similar comment
|
A new generated diff is ready to view: __generated-main...__generated-fix-signing |








Issue #
fixes #448
Description of changes
aws-c-authsigning test suite. This at least gives us some confidence that what comes out of the signing process is a valid signed request. Any signing issues after this point should theoretically be limited to issues with a particular HTTP engine implementation and their ability to serialize the request on the wire in the expected format.HttpRequestBuilder -> CrtRequest -> HttpRequestBuilderto only append new/missing keys for headers and query params rather than overwrite. Previously (as described in the ticket) we would just overwrite all the headers and query params from the signed request. CRT request uses the encoded representation of a request which causes (e.g.) any url encoded parameters to get encoded twice when finally going out on the wire.There are a lot of new files here, most of the relevant changes are in these files:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.