public void PassTestSuite(params string[] scenarioName) { // Arrange var scenario = context.LoadScenario(scenarioName); // Add header 'X-Amz-Date' since the algorithm at this point expects it on the request scenario.Request.AddHeader(HeaderKeys.XAmzDateHeader, context.UtcNow.ToIso8601BasicDateTime()); // Act var authorizationHeader = AuthorizationHeader.Build( context.UtcNow, context.RegionName, context.ServiceName, context.Credentials, scenario.ExpectedSignedHeaders, scenario.ExpectedCredentialScope, scenario.ExpectedStringToSign); // Assert authorizationHeader.ShouldBe(scenario.ExpectedAuthorizationHeader); }
public string ASV4() { // Build the canonical request (string canonicalRequest, string signedHeaders) = CanonicalRequest.Build("s3", _request2, null, null); // Build the string to sign (string stringToSign, string credentialScope) = StringToSign.Build( DateTime.UtcNow, "eu-west-1", "S3", canonicalRequest); // Build the authorization header string authorizationHeader = AuthorizationHeader.Build( DateTime.UtcNow, "eu-west-1", "S3", _credentials, signedHeaders, credentialScope, stringToSign); return(authorizationHeader); }
public string AWS4() { // Build the canonical request (string canonicalRequest, string signedHeaders) = CanonicalRequest.Build("s3", _request2, new Dictionary <string, IEnumerable <string> >(), string.Empty); // Build the string to sign (string stringToSign, string credentialScope) = StringToSign.Build( DateTime.UtcNow, "eu-west-1", "S3", canonicalRequest); // Build the authorization header string authorizationHeader = AuthorizationHeader.Build( DateTime.UtcNow, "eu-west-1", "S3", _credentials, signedHeaders, credentialScope, stringToSign); return(authorizationHeader); }