11import { AWSSignerV4 } from "./mod.ts" ;
22import {
33 assertEquals ,
4- assertStringContains ,
5- } from "https://deno.land/std@0.71 .0/testing/asserts.ts" ;
4+ assertStringIncludes ,
5+ } from "https://deno.land/std@0.79 .0/testing/asserts.ts" ;
66
77Deno . test ( "construct from env vars" , async ( ) => {
88 Deno . env . set ( "AWS_ACCESS_KEY_ID" , "examplekey" ) ;
@@ -26,14 +26,14 @@ Deno.test("construct from env vars", async () => {
2626 const today = `${ now . getFullYear ( ) } ${
2727 ( now . getMonth ( ) + 1 ) . toString ( ) . padStart ( 2 , "0" )
2828 } ${ now . getDate ( ) . toString ( ) . padStart ( 2 , "0" ) } `;
29- assertStringContains ( req . headers . get ( "x-amz-date" ) ! , `${ today } T` ) ;
29+ assertStringIncludes ( req . headers . get ( "x-amz-date" ) ! , `${ today } T` ) ;
3030 assertEquals ( req . headers . get ( "x-amz-security-token" ) , "sessiontoken" ) ;
3131 assertEquals ( req . headers . get ( "x-hello" ) , "world" ) ;
3232 assertEquals (
3333 req . headers . get ( "host" ) ,
3434 "test.dynamodb.us-east-1.amazonaws.com" ,
3535 ) ;
36- assertStringContains (
36+ assertStringIncludes (
3737 req . headers . get ( "Authorization" ) ! ,
3838 `AWS4-HMAC-SHA256 Credential=examplekey/${ today } /us-east-1/dynamodb/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token;x-hello, Signature=` ,
3939 ) ;
@@ -60,14 +60,14 @@ Deno.test("construct manually", async () => {
6060 const today = `${ now . getFullYear ( ) } ${
6161 ( now . getMonth ( ) + 1 ) . toString ( ) . padStart ( 2 , "0" )
6262 } ${ now . getDate ( ) . toString ( ) . padStart ( 2 , "0" ) } `;
63- assertStringContains ( req . headers . get ( "x-amz-date" ) ! , `${ today } T` ) ;
63+ assertStringIncludes ( req . headers . get ( "x-amz-date" ) ! , `${ today } T` ) ;
6464 assertEquals ( req . headers . get ( "x-amz-security-token" ) , "session_token" ) ;
6565 assertEquals ( req . headers . get ( "x-hello" ) , "world" ) ;
6666 assertEquals (
6767 req . headers . get ( "host" ) ,
6868 "test.dynamodb.us-east-1.amazonaws.com" ,
6969 ) ;
70- assertStringContains (
70+ assertStringIncludes (
7171 req . headers . get ( "Authorization" ) ! ,
7272 `AWS4-HMAC-SHA256 Credential=example_key/${ today } /us-east-2/dynamodb/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token;x-hello, Signature=` ,
7373 ) ;
0 commit comments