@@ -119,6 +119,29 @@ describe("middleware-sdk-rds", () => {
119
119
expect ( presignedUrl ) . toMatch ( / X - A m z - S i g n a t u r e = 0 0 0 0 0 0 / ) ;
120
120
} ) ;
121
121
122
+ it ( "should build StartDBInstanceAutomatedBackupsReplication cross origin presigned url correctly " , async ( ) => {
123
+ const params = {
124
+ SourceDBInstanceArn : arn ,
125
+ KmsKeyId : "000-111" ,
126
+ } ;
127
+ await handler ( { input : params } ) ;
128
+ expect ( nextHandler . mock . calls . length ) . toBe ( 1 ) ;
129
+ const middlewareOutput = nextHandler . mock . calls [ 0 ] [ 0 ] ;
130
+ expect ( middlewareOutput . input . SourceDBInstanceArn ) . toEqual ( params . SourceDBInstanceArn ) ;
131
+ expect ( middlewareOutput . input . KmsKeyId ) . toEqual ( params . KmsKeyId ) ;
132
+ const presignedUrl = middlewareOutput . input . PreSignedUrl ;
133
+ expect ( presignedUrl ) . toMatch ( / h t t p s \: \/ \/ r d s \. s r c \- r e g i o n \. a m a z o n a w s \. c o m \/ \? / ) ;
134
+ expect ( presignedUrl ) . toMatch ( / A c t i o n \= S t a r t D B I n s t a n c e A u t o m a t e d B a c k u p s R e p l i c a t i o n / ) ;
135
+ expect ( presignedUrl ) . toMatch ( / V e r s i o n \= 2 0 1 4 \- 1 0 \- 3 1 / ) ;
136
+ expect ( presignedUrl ) . toMatch ( / X \- A m z \- S e c u r i t y \- T o k e n \= s e s s i o n / ) ;
137
+ expect ( presignedUrl ) . toMatch ( / X \- A m z \- A l g o r i t h m \= A W S 4 \- H M A C \- S H A 2 5 6 / ) ;
138
+ expect ( presignedUrl ) . toMatch ( / X \- A m z \- S i g n e d H e a d e r s \= h o s t / ) ;
139
+ expect ( presignedUrl ) . toMatch ( / X \- A m z \- C r e d e n t i a l \= / ) ;
140
+ expect ( presignedUrl ) . toMatch ( / X \- A m z \- D a t e \= / ) ;
141
+ expect ( presignedUrl ) . toMatch ( / X - A m z - E x p i r e s = ( [ \d ] + ) / ) ;
142
+ expect ( presignedUrl ) . toMatch ( / X - A m z - S i g n a t u r e = 0 0 0 0 0 0 / ) ;
143
+ } ) ;
144
+
122
145
it ( "should not generate PreSignedUrl if source identifier is not ARN" , async ( ) => {
123
146
const params = {
124
147
SourceDBClusterSnapshotIdentifier : sourceIdentifier ,
0 commit comments