@@ -318,6 +318,35 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" {
318318 expect ( result .results [ 1 ].statusCode ).toBe ( 429 );
319319 } );
320320
321+ it ( " sanitizes request credentials from operation result response mementos" , function () {
322+ var credentialedHyper = new Hyper .models .HyperBuilder (
323+ defaults = new Hyper .models .HyperRequest ()
324+ .setUsername ( " secret-api-key" )
325+ .setPassword ( " secret-password" )
326+ ).fake ( {
327+ " */v2/contacts" : function ( newFakeResponse , req ) {
328+ return newFakeResponse ( 429 , " Too Many Requests" , " {}" );
329+ }
330+ } )
331+ .preventStrayRequests ();
332+
333+ variables .client .setHyperClient ( credentialedHyper );
334+
335+ var result = variables .client .create ( listKey = " myList" , subscribers = [ " person@example.com" ] );
336+ var requestMemento = result .results [ 1 ].response .request ;
337+
338+ expect ( requestMemento .method ).toBe ( " POST" );
339+ expect ( requestMemento .url ).toBe ( " /v2/contacts" );
340+ expect ( requestMemento ).notToHaveKey ( " authType" );
341+ expect ( requestMemento ).notToHaveKey ( " clientCert" );
342+ expect ( requestMemento ).notToHaveKey ( " clientCertPassword" );
343+ expect ( requestMemento ).notToHaveKey ( " domain" );
344+ expect ( requestMemento ).notToHaveKey ( " headers" );
345+ expect ( requestMemento ).notToHaveKey ( " password" );
346+ expect ( requestMemento ).notToHaveKey ( " username" );
347+ expect ( requestMemento ).notToHaveKey ( " workstation" );
348+ } );
349+
321350 it ( " marks cancel results as failed when Cordial returns non-2xx" , function () {
322351 variables .hyper
323352 .fake ( {
0 commit comments