{"id":24290746,"url":"https://github.com/k0rventen/flask-gatekeeper","last_synced_at":"2026-05-14T12:32:40.682Z","repository":{"id":57430345,"uuid":"363481370","full_name":"k0rventen/flask-gatekeeper","owner":"k0rventen","description":"A (very) simple banning \u0026 rate limiting extension for Flask.","archived":false,"fork":false,"pushed_at":"2022-05-16T18:02:40.000Z","size":2958,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T20:31:19.264Z","etag":null,"topics":["banning","flask","python","rate-limiting"],"latest_commit_sha":null,"homepage":"https://k0rventen.github.io/flask-gatekeeper/","language":"Python","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/k0rventen.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":"2021-05-01T18:34:45.000Z","updated_at":"2021-10-24T11:37:55.000Z","dependencies_parsed_at":"2022-08-26T03:51:03.530Z","dependency_job_id":null,"html_url":"https://github.com/k0rventen/flask-gatekeeper","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/k0rventen/flask-gatekeeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fflask-gatekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fflask-gatekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fflask-gatekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fflask-gatekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k0rventen","download_url":"https://codeload.github.com/k0rventen/flask-gatekeeper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fflask-gatekeeper/sbom","scorecard":{"id":546254,"data":{"date":"2025-08-11","repo":{"name":"github.com/k0rventen/flask-gatekeeper","commit":"5c8b9d54e70148a23b2b1fb0d9e014edc2a11c05"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-package.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/python-sphinx.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/k0rventen/flask-gatekeeper/python-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/k0rventen/flask-gatekeeper/python-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/k0rventen/flask-gatekeeper/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/k0rventen/flask-gatekeeper/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-sphinx.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/k0rventen/flask-gatekeeper/python-sphinx.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-sphinx.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/k0rventen/flask-gatekeeper/python-sphinx.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-sphinx.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/k0rventen/flask-gatekeeper/python-sphinx.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/python-sphinx.yml:22","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T09:35:59.782Z","repository_id":57430345,"created_at":"2025-08-20T09:35:59.782Z","updated_at":"2025-08-20T09:35:59.782Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33024969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":["banning","flask","python","rate-limiting"],"created_at":"2025-01-16T12:36:28.795Z","updated_at":"2026-05-14T12:32:40.664Z","avatar_url":"https://github.com/k0rventen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flask-gatekeeper\n\nA simple banning \u0026 rate limiting extension for Flask.\n\n![PyPI - Status](https://img.shields.io/badge/status-stable-green)\n[![PyPI - Version](https://img.shields.io/pypi/v/flask-gatekeeper.svg)](https://pypi.org/project/flask-gatekeeper/)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-gatekeeper)\n\nIt's not meant to be a replacement for other, more complex banning \u0026 rate limiting modules like `flask-Limiter` or `flask-ipban`.\n\nIt has the following specificities:\n\n- no dependencies,\n- quite fast due to the use of `collections.deque`,\n- in-memory storage (no persistence across restarts).\n\nFull documentation can be found here: https://k0rventen.github.io/flask-gatekeeper/\n\n## Getting started\n\n### Install\n\n```\npip install flask-gatekeeper\n```\n\n### Sample usage\n\nHere is a demo app showing the main capabilities of flask-gatekeeper : \n\n\n```py\n\n# import flask-gatekeeper along flask\nfrom flask import Flask\nfrom flask_gatekeeper import GateKeeper \n\napp = Flask(__name__)\ngk = GateKeeper(app, # or use .init_app(app) later \n                ip_header=\"x-my-ip\", # optionnal header to use for the client IP (e.g if using a reverse proxy)\n                ban_rule={\"count\":3,\"window\":10,\"duration\":600}, # 3 reports in a 10s window will ban for 600s\n                rate_limit_rules=[{\"count\":20,\"window\":1},{\"count\":100,\"window\":10}], # rate limiting will be applied if over 20 requests in 1s or 100 requests in 10s\n                excluded_methods=[\"HEAD\"]) # do not add HEAD requests to the tally \n\n# By default, all routes will use the rate limiting we defined above:\n\n@app.route(\"/ping\") # this route is rate limited by the global rule\ndef ping():\n    return \"ok\",200\n\n@app.route(\"/login\") # also rate limited by the global rule\ndef login():\n    if request.json.get(\"password\") == \"password\":\n        return token,200\n    else:\n        gk.report() # report the request's IP, after 3 reports in this case the IP will be banned \n        return \"bad password\",401\n\n# we can specify different rate limiting rules using decorators\n\n@app.route(\"/global_plus_specific\")\n@gk.specific(rate_limit_rules=[{\"count\":1,\"window\":2}]) # add another rate limit on top of the global one (to avoid bursting for example)\ndef specific():\n    return \"ok\",200\n\n@app.route(\"/standalone\")\n@gk.specific(rate_limit_rules=[{\"count\":10,\"window\":3600}],standalone=True) # rate limited only by this rule\ndef standalone():\n    return \"ok\",200\n\n@app.route(\"/bypass\")\n@gk.bypass # do not apply anything on that route\ndef bypass():\n    return \"ok\",200\n\n\napp.run(\"127.0.0.1\",5000)\n```\n\nCopy that in a file or your REPL, then try the various endpoints.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0rventen%2Fflask-gatekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk0rventen%2Fflask-gatekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0rventen%2Fflask-gatekeeper/lists"}