@@ -181,56 +181,5 @@ describe('S3 handler tests', () => {
181181 assert ( result . body . includes ( "bucket not present" ) ) ;
182182 } ) ;
183183 } ) ;
184- it ( 'should obfuscate the object key' , async ( ) => {
185- nock ( 'https://api.scanii.com' )
186- . post ( '/v2.1/files/fetch' )
187- . reply ( 202 , Buffer . from ( "{\"id\":\"12356789\"}" ) , { "Location" : "https://api.scanii.com/v2.1/files/1234" } ) ;
188-
189- const spy = sinon . spy ( scanii . ScaniiClient . prototype , 'fetch' ) ;
190-
191- await handler ( {
192- "Records" : [
193- {
194- "eventVersion" : "2.0" ,
195- "eventSource" : "aws:s3" ,
196- "awsRegion" : "us-west-2" ,
197- "eventTime" : "2015-10-01T23:28:54.280Z" ,
198- "eventName" : "ObjectCreated:Put" ,
199- "userIdentity" : {
200- "principalId" : "AWS:principal"
201- } ,
202- "requestParameters" : {
203- "sourceIPAddress" : "98.167.155.191"
204- } ,
205- "responseElements" : {
206- "x-amz-request-id" : "EEC943B096DE3DF9" ,
207- "x-amz-id-2" : "W/myEjyXFBsOA6N0byxW0tOxMA4m1fmv9KAVcovvG0nD9W1s5aX5+Wx61tlCop8LbZAw1Nz0mnc="
208- } ,
209- "s3" : {
210- "s3SchemaVersion" : "1.0" ,
211- "configurationId" : "948c2c1a-a028-4564-93fc-76cea7622633" ,
212- "bucket" : {
213- "name" : "scanii-mu" ,
214- "ownerIdentity" : {
215- "principalId" : "principal"
216- } ,
217- "arn" : "arn:aws:s3:::scanii-mu"
218- } ,
219- "object" : {
220- "key" : "Screen+Shot+2016-01-19+at+7.24.37+PM.png" ,
221- "size" : 519 ,
222- "eTag" : "aa1e5c8a6a07217c25f55aa8e96ea37a" ,
223- "sequencer" : "00560DC1B62F962FCD"
224- }
225- }
226- }
227- ]
228- } , { } , ( ) => {
229- "use strict" ;
230- assert ( spy . calledOnce )
231- assert ( ( spy . getCall ( 0 ) . args [ 2 ] [ 'key-sha1' ] === '8fd1943cbc9bf22f0b7f64aef9015f6494b81846' ) )
232- assert ( ( spy . getCall ( 0 ) . args [ 2 ] [ 'key' ] === undefined ) )
233- } ) ;
234- } ) ;
235184} ) ;
236185
0 commit comments