- Added AltchaService class for managing ALTCHA captcha challenges and solutions. - Created CaptchaController to handle API requests for generating challenges. - Introduced CaptchaGuard for validating captcha solutions on public endpoints. - Developed unit tests for AltchaService to ensure challenge creation and solution verification functionality. - Implemented integration tests for the Captcha API endpoint and captcha bypass behavior when disabled. - Added documentation for the Captcha API in the corresponding markdown file.
1 line
19 KiB
JSON
1 line
19 KiB
JSON
{"nodes": [{"id": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_captcha_altchaservicetest_php", "label": "AltchaServiceTest.php", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L1"}, {"id": "captcha_altchaservicetest_altchaservicetest", "label": "AltchaServiceTest", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L14"}, {"id": "testcase", "label": "TestCase", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "captcha_altchaservicetest_altchaservicetest_service", "label": ".service()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L18"}, {"id": "altchaservice", "label": "AltchaService", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L18"}, {"id": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "label": ".solvedPayload()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L27"}, {"id": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "label": ".testCreateChallengeShape()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L47"}, {"id": "captcha_altchaservicetest_altchaservicetest_testvalidsolutionverifies", "label": ".testValidSolutionVerifies()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L57"}, {"id": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "label": ".testReplayIsRejected()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L64"}, {"id": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "label": ".testTamperedSignatureRejected()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L72"}, {"id": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "label": ".testEmptyAndGarbagePayloadsRejected()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L80"}, {"id": "captcha_altchaservicetest_altchaservicetest_testenabledflag", "label": ".testEnabledFlag()", "file_type": "code", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L88"}], "edges": [{"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_captcha_altchaservicetest_php", "target": "altcha", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L5", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_captcha_altchaservicetest_php", "target": "algorithm", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L6", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_captcha_altchaservicetest_php", "target": "altchaservice", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L7", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_captcha_altchaservicetest_php", "target": "testcase", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L8", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_captcha_altchaservicetest_php", "target": "arrayadapter", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L9", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_shared_captcha_altchaservicetest_php", "target": "captcha_altchaservicetest_altchaservicetest", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L14", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "testcase", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L14", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_service", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L18", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_service", "target": "altchaservice", "relation": "references", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L18", "weight": 1.0, "context": "return_type"}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L27", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L47", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_testvalidsolutionverifies", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L57", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L64", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L72", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L80", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest", "target": "captcha_altchaservicetest_altchaservicetest_testenabledflag", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L88", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "target": "captcha_altchaservicetest_altchaservicetest_service", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L49", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testvalidsolutionverifies", "target": "captcha_altchaservicetest_altchaservicetest_service", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L59", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testvalidsolutionverifies", "target": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L60", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "target": "captcha_altchaservicetest_altchaservicetest_service", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L66", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "target": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L67", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "target": "captcha_altchaservicetest_altchaservicetest_service", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L74", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "target": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L77", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "target": "captcha_altchaservicetest_altchaservicetest_service", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L82", "weight": 1.0}, {"source": "captcha_altchaservicetest_altchaservicetest_testenabledflag", "target": "captcha_altchaservicetest_altchaservicetest_service", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L90", "weight": 1.0}], "raw_calls": [{"caller_nid": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "callee": "solveChallenge", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L30", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L36", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "callee": "base64_encode", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L38", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_solvedpayload", "callee": "json_encode", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L38", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "callee": "createChallenge", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L49", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L50", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L51", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L52", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L53", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testcreatechallengeshape", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L54", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testvalidsolutionverifies", "callee": "createChallenge", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L60", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testvalidsolutionverifies", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L61", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testvalidsolutionverifies", "callee": "verifySolution", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L61", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "callee": "createChallenge", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L67", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L68", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "callee": "verifySolution", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L68", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L69", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testreplayisrejected", "callee": "verifySolution", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L69", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "callee": "createChallenge", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L75", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "callee": "str_repeat", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L76", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "callee": "strlen", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L76", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L77", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testtamperedsignaturerejected", "callee": "verifySolution", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L77", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L83", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "callee": "verifySolution", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L83", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L84", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "callee": "verifySolution", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L84", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L85", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "callee": "verifySolution", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L85", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testemptyandgarbagepayloadsrejected", "callee": "base64_encode", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L85", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testenabledflag", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L90", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testenabledflag", "callee": "enabled", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L90", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testenabledflag", "callee": "self", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L91", "receiver": null}, {"caller_nid": "captcha_altchaservicetest_altchaservicetest_testenabledflag", "callee": "enabled", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Shared/Captcha/AltchaServiceTest.php", "source_location": "L91", "receiver": null}]} |