{"id":35190466,"url":"https://github.com/phrenotype/figleaf","last_synced_at":"2026-05-19T08:10:35.390Z","repository":{"id":62501164,"uuid":"443593703","full_name":"phrenotype/figleaf","owner":"phrenotype","description":"Keep bots and unwanted humans away from your website","archived":false,"fork":false,"pushed_at":"2023-03-15T19:45:05.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T08:46:42.208Z","etag":null,"topics":["csrf","csrf-form","csrf-protection","figleaf","php","php-csrf"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phrenotype.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-01T17:57:10.000Z","updated_at":"2022-12-21T17:41:04.000Z","dependencies_parsed_at":"2022-11-02T12:01:25.317Z","dependency_job_id":null,"html_url":"https://github.com/phrenotype/figleaf","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/phrenotype/figleaf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Ffigleaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Ffigleaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Ffigleaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Ffigleaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phrenotype","download_url":"https://codeload.github.com/phrenotype/figleaf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Ffigleaf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28111192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-29T02:00:07.021Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csrf","csrf-form","csrf-protection","figleaf","php","php-csrf"],"created_at":"2025-12-29T05:38:39.593Z","updated_at":"2025-12-29T05:38:46.463Z","avatar_url":"https://github.com/phrenotype.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FigLeaF\n![license](https://img.shields.io/github/license/phrenotype/figleaf)\n![contributors](https://img.shields.io/github/contributors/phrenotype/figleaf)\n![code size](https://img.shields.io/github/languages/code-size/phrenotype/figleaf)\n![downloads](https://img.shields.io/packagist/dm/chase/figleaf)  \n\nThis library keeps bots and unwanted humans from making requests to your website.\n \nIt offers full csrf token generation and validation, without external dependencies.\n\nWith this, a brute force attack is only possible with browser automation, hence increased cost.\n\n## Install  \n`composer require figleaf/figleaf`  \n\n## Usage\n\nTo generate a csrf token for some random use ( you decide )  \n\n```php\n\u003c?php\n\nuse FigLeaf\\FigLeaf;\n\n$token = FigLeaf::token(true);\n\necho $token;\n```\n\n```html\n36ea3cb936ea66dbe4fc50444176a84c8138f76859467b86986efb53f1d6\n```\n\nTo get the current or old token value use `FigLeaf::token()`.  \n\nTo generate a hidden input field  \n\n```php\n\u003c?php\n\nuse FigLeaf\\FigLeaf;\n\n$input = FigLeaf::input(true);\n\necho $input;\n```  \n\n```html\n\u003cinput type=\"hidden\" name=\"__figleaf_token\" value=\"36ea3cb936ea66dbe4fc50444176a84c8138f76859467b86986efb53f1d6\"/\u003e\n```  \nAgain, to get an input based on the old or current value, use `FigLeaf::input()`.\n\nYou can then go on to add the input to your form or web request as the case may be.\n\n## Validation\n\nAfter a form is submitted or a request is sent by a user, you validate it by passing an associative array based on the request medium  \n  \n```php\n\u003c?php\n\nuse FigLeaf\\FigLeaf;\n\n$validator = Figleaf::validate($_REQUEST);\n\nif($validator-\u003epassed()){\n    // Do something\n}\n\nif($validator-\u003efailed()){\n    // Do something\n}\n\n```  \n\n## Recommendation  \nIt is highly recommeded you always generate new tokens per request, otherwise, this whole 'keeping bots and unwanted humans' away thing will just be an empty promise.\n\n## Contact  \n**Email** : paul.contrib@gmail.com\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrenotype%2Ffigleaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphrenotype%2Ffigleaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrenotype%2Ffigleaf/lists"}