@@ -46,6 +46,7 @@ import {
4646 wellKnownForgeRock ,
4747 wellKnownPing ,
4848 recaptchaEnterpriseCallback ,
49+ MetadataMarketPlaceInitialize ,
4950} from './responses.js' ;
5051import initialRegResponse from './response.registration.js' ;
5152import wait from './wait.js' ;
@@ -87,6 +88,8 @@ export default function (app) {
8788 res . json ( pingProtectInitialize ) ;
8889 } else if ( req . query . authIndexValue === 'IDMSocialLogin' ) {
8990 res . json ( selectIdPCallback ) ;
91+ } else if ( req . query . authIndexValue === 'TEST_MetadataMarketPlace' ) {
92+ res . json ( MetadataMarketPlaceInitialize ) ;
9093 } else if ( req . query . authIndexValue === 'AMSocialLogin' ) {
9194 res . json ( idpChoiceCallback ) ;
9295 } else if ( req . query . authIndexValue === 'RecaptchaEnterprise' ) {
@@ -109,6 +112,7 @@ export default function (app) {
109112 }
110113 } else if ( req . query . authIndexValue === 'LoginWithEmail' ) {
111114 res . json ( emailSuspend ) ;
115+ < << << << HEAD
112116 } else if ( req . query . authIndexValue === 'RecaptchaEnterprise' ) {
113117 console . log ( req . body . callbacks ) ;
114118 if ( req . body . callbacks [ 0 ] . type === 'NameCallback' ) {
@@ -132,6 +136,42 @@ export default function (app) {
132136 res . json ( authSuccess ) ;
133137 }
134138 }
139+ = === ===
140+ } else if ( req . query . authIndexValue === 'TEST_MetadataMarketPlace' ) {
141+ if ( req . body . callbacks . find ( ( cb ) => cb . type === 'MetadataCallback' ) ) {
142+ const metadataCb = req . body . callbacks . find ( ( cb ) => cb . type === 'MetadataCallback' ) ;
143+ const action = metadataCb . output [ 0 ] . value . _action ;
144+ console . log ( 'the action' , action ) ;
145+ if ( action === 'protect_initialize' ) {
146+ if ( req . body . callbacks . find ( ( cb ) => cb . type === 'HiddenValueCallback' ) ) {
147+ const hiddenCb = req . body . callbacks . find ( ( cb ) => cb . type === 'HiddenValueCallback' ) ;
148+ if ( hiddenCb . input [ 0 ] . value === 'we had an error' ) {
149+ return res . json ( authFail ) ;
150+ }
151+ return res . json ( MetadataMarketPlacePingOneEvaluation ) ;
152+ }
153+ }
154+ if ( action === 'protect_risk_evaluation' ) {
155+ if ( req . body . callbacks . find ( ( cb ) => cb . type === 'HiddenValueCallback' ) ) {
156+ const hiddenCb = req . body . callbacks . find ( ( cb ) => cb . type === 'HiddenValueCallback' ) ;
157+ if ( hiddenCb . input [ 0 ] . value === 'we had an error' ) {
158+ return res . json ( authFail ) ;
159+ }
160+ return res . json ( authSuccess ) ;
161+ }
162+ }
163+ } else {
164+ if ( req . body . callbacks . find ( ( cb ) => cb . type === 'PingOneEvaluationCallback' ) ) {
165+ const cb = req . body . callbacks . find ( ( cb ) => cb . type === 'PingOneEvaluationCallback' ) ;
166+ if ( cb . input [ 0 ] . value === 'the value to set' ) {
167+ return res . json ( authSuccess ) ;
168+ } else {
169+ return res . json ( authFail ) ;
170+ }
171+ }
172+ }
173+ return res . json ( MetadataMarketPlacePingOneEvaluation ) ;
174+ > >>> >>> 0 fab975 ( feat : support - metadata - marketplace - protect )
135175 } else if ( req . query . authIndexValue === 'QRCodeTest' ) {
136176 // If QR Code callbacks are being returned, return success
137177 if ( req . body . callbacks . find ( ( cb ) => cb . type === 'HiddenValueCallback' ) ) {
0 commit comments