diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index fa28630..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,48 +0,0 @@ -# AGENTS.md - -## Project identity -- **Name**: idv-demo — Jumio identity verification (KYC/KYB) demo app -- **Stack**: vanilla PHP (no framework, no Composer), nginx + PHP-FPM -- **Owner**: customer-engineering / Sechpoint - -## Repo setup -- **Git remote**: `https://git.sechpoint.app/customer-engineering/idv-demo.git` -- **Credentials**: source `~/bin/.gitenv` for `GIT_USER_NAME`, `GIT_USER_EMAIL`, `GIT_TOKEN` -- **Default branch**: `main` -- **Commit prefix convention**: `chore:` - -## Architecture (non-obvious) - -``` -html/ → web root (deploys as /var/www/html/public — see nginx config) - index.php → single entry point (front controller) - class/ → core: config.php, site.php (session init), functions.php - app/ - controler/ → routing: start.php (GET pages), request.php (POST actions) - model/ → Jumio API calls: M01.php, M04.php, docv.php, retrival_1.php, retrival_2.php, success.php - view/ → .phtml templates (header, footer, pages 00–04, loader, results) - cdn/ → static assets (JS includes iovation/IGLOO blackbox) - lng/ → language strings: en/ (default), de/ -nginx/ → nginx site config (serves from /var/www/html/public, PHP-FPM via socket) -``` - -- **No build tools, no tests, no CI/CD, no package manager** — it's raw PHP. -- Routing: URL segments drive pages (`$PARAMS[1]` in start.php); POST/GET `do` parameter drives actions (request.php). -- Jumio workflow: M01 (ID verification) → docv (document verification) → retrival → results. - -## Dev mode -- Hostname starting with `dev` sets `DEBUG = TRUE` (`html/class/config.php` line 28). -- When DEBUG is true, `debug_log()` writes to `html/log/YYYYMM.log`. The `log/` directory must exist and be writable. - -## Secrets warning -- `html/class/config.php` contains hardcoded Jumio API credentials. **Do not commit to public repos.** - -## Nginx -- Active config: `nginx/default.conf` -- PHP-FPM socket: `unix:/run/php-fpm.sock` -- Clean URLs via `try_files $uri $uri/ /index.php?$args` -- Stale backup files in `nginx/`: `default_old.conf`, `default.conf.bak`, `default.bak.3.conf` - -## Gotchas -- Filename `retrival` is intentionally misspelled (not "retrieval") — used consistently in `retrival_1.php`, `retrival_2.php`, and session keys. -- `html/` contains `.DS_Store` (macOS artifact) — should be gitignored. diff --git a/html/app/controler/dev.php b/html/app/controler/dev.php index 0c3c283..9be73ce 100644 --- a/html/app/controler/dev.php +++ b/html/app/controler/dev.php @@ -21,17 +21,12 @@ ##################################################################################### if (!empty($PARAMS['2'])) { - if (DEBUG) { + if (DEBUG) { switch ($PARAMS['2']) { -//==========>> - case 'workbanch': - include(__ROOT__.'/app/model/workbanch.php'); - break; - //==========>> case 'test': - include(__ROOT__.'/app/view/test.html'); + include(__ROOT__.'/app/view/dev_test.html'); break; - //==========>> + case 'clear': session_unset(); session_destroy(); diff --git a/html/app/controler/request.php b/html/app/controler/request.php index aeb1156..41693c3 100644 --- a/html/app/controler/request.php +++ b/html/app/controler/request.php @@ -64,6 +64,21 @@ if(!empty($HTML_REQUEST['do'])){ exit; break; + case 'login': + include(__ROOT__.'/app/model/login.php'); + exit; + break; + + case 'reset': + include(__ROOT__.'/app/model/reset.php'); + exit; + break; + + case 'pwless': + include(__ROOT__.'/app/model/pwless.php'); + exit; + break; + case 'callback': echo "callback"; #include(__ROOT__.'/app/model/callback.php'); diff --git a/html/app/controler/start.php b/html/app/controler/start.php index df4d641..4f7737a 100644 --- a/html/app/controler/start.php +++ b/html/app/controler/start.php @@ -4,7 +4,7 @@ if (!empty($PARAMS['1'])) { //==========>> MENUE OPTIONS case 'home': include(__ROOT__.'/app/view/_header.phtml'); - include(__ROOT__.'/app/view/page_00.phtml'); + include(__ROOT__.'/app/view/page_home.phtml'); include(__ROOT__.'/app/view/_footer.phtml'); break; case 'one': @@ -57,11 +57,7 @@ if (!empty($PARAMS['1'])) { break; //==========>> FUNCTIONAL OPTIONS case 'dev': - include(__ROOT__.'/app/controler/development.php'); - break; - - case 'q5b35W4M3cWt': - include(__ROOT__.'/app/view/dev_demo.html'); + include(__ROOT__.'/app/controler/dev.php'); break; case 'clear': diff --git a/html/app/model/login.php b/html/app/model/login.php new file mode 100644 index 0000000..bf47990 --- /dev/null +++ b/html/app/model/login.php @@ -0,0 +1,17 @@ + "https://retrieval.".$_SESSION['SITE']['datacenter']."/api/v1/accounts/".$_SESSION['TRANSACTION']["RETURN"]['accountId']."/workflow-executions/".$_SESSION['TRANSACTION']["RETURN"]['workflowExecutionId']."/status", - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => "", - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 30, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => "GET", - CURLOPT_HTTPHEADER => [ - "Authorization: Bearer ". $access_token , - "Content-Type: application/json", - "User-Agent: Jumio SE Testing" - ], - ]); - // Look to check Jumio Result. - do { - $response = curl_exec($curl); - $err = curl_error($curl); - if ($err) { - $_SESSION['SITE']['ERROR']="cURL Error #:" . $err; - $_SESSION['SITE']['ERROR']['API']=array(); - $_SESSION['SITE']['ERROR']['API']=$response_json; - debug_log("API ERROR",json_encode($_SESSION, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT )); - $error_msg=ERROR_501; - include(__ROOT__.'/app/view/_header.phtml'); - include(__ROOT__.'/app/view/page_error.phtml'); - include(__ROOT__.'/app/view/_footer.phtml'); - break; - } else { - $retrival_status=array(); - $retrival_status=json_decode($response,TRUE); - } - print_r($retrival_status); - if ($retrival_status["workflowExecution"]["status"] === "PROCESSED") { break; } - sleep(10); - $retry_count++; - } while ($retry_count < $max_retries); - break; -} -//==================================================== -echo '