Name | cf-rules JSON |
Version |
2.0.0
JSON |
| download |
home_page | |
Summary | Wrapper library to import / export multiple remote rules and easily create, modify and delete rules. |
upload_time | 2024-01-26 13:21:19 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8 |
license | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [2024] [Quentin Lienhardt] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
keywords |
api
rules
wrapper
library
firewall
waf
cloudflare
bulk
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h1 align="center" style="font-size: 50px;">Welcome to Cloudflare WAF Custom rules library 👋</h1>
### Previously known as Cloudflare Firewall Rules
[![Website](https://quentium.fr/+img/github/website_cloudflare.svg)](https://quentiumyt.github.io/Cloudflare-Firewall-Rules/)
[![Donate](https://quentium.fr/+img/github/donate.svg)](https://www.paypal.me/QuentiumYT/1)
[![Contributions](https://quentium.fr/+img/github/contributions.svg)](https://github.com/QuentiumYT/Cloudflare-Firewall-Rules/pulls)
[![Tested on Python 3.12](https://quentium.fr/+img/github/python312.svg)](https://www.python.org/downloads)
[![License](https://quentium.fr/+img/github/apache2.svg)](https://github.com/QuentiumYT/Cloudflare-Firewall-Rules/blob/master/LICENSE)
[![Size](https://img.shields.io/github/repo-size/QuentiumYT/Cloudflare-Firewall-Rules?label=Repo%20Size&color=4391BD&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAUCSURBVHhe7ZzdbhtFFMfPru3ECSFtYlqhVKK9IQ0Iil0JAilIhSTQPgHPwVWBB2hRVcFzcAG3CNIIJIgrxEeqctPSXvWioh/5aBJok6Zr5r/rTdeb2fjs7tjZmfXvZsdeS9H8dM6cc9aKqUePHj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qh+G0NWnC4JJ4d7Izz6QJg0uineVhwuASe1eIvDxMGFxiCQykrfETBhd2Hxg+80yfMLiwmjVZwTB9wuDSducyeXlpkjnsaSIoL28TBpfIIhKWl7cJg4vURDht8zhhcNllQXbm5XHC4NJiYK+CEWyOVUvUVR7Y2f1e8nzCEpdWzZ0wuOwYEvIuiUsFU0N1Irra+v/MoqL/a5VHy3bD+UAneWDHwOmvfjzYv1nGjPvm0GCZ3js5QeVyn3ezA+geeT4tIdQtiabIA7tysNMSTZIHpIdYpySaJg9EVgHVEk2UByIFAlUSTZUH9hQI0ko0WR5oKxAklWi6PMASCOJKzIM8wBYIuBLzIg/EEgjaScyTPBBbIIiSmDd5IJFAEJZ4qnac/vr7dq7kgcQCgfsruFsWHoHV8PTGcX8aBE9VGjPffTa1iBemk0ogCEZiniLPJ/VXbD998v4q9TXOiOW8js/zevTQGaL/Af3ei59A3O7oAAAAAElFTkSuQmCC)](../../)
> #### A Cloudflare wrapper to bulk add / edit your WAF custom rules using Cloudflare's API.
This library is a wrapper that aims to easily create, modify, delete rules. It also provides a way to import & export new rules in your domain's firewall.
If you have several rules that you want to duplicate among your domains, this module is made for you!
### A complete documentation can be found at: https://quentiumyt.github.io/Cloudflare-Firewall-Rules/
## 📥 Installation
```bash
pip install cf_rules
# OR
git clone https://github.com/QuentiumYT/Cloudflare-Firewall-Rules.git
cd Cloudflare-Firewall-Rules/
pip install .
```
## 🚀 Usage
You have 2 auth methods available:
A Global API Key or a specific API Token generated from here: https://dash.cloudflare.com/profile/api-tokens
### Cloudflare Global API Key
![Cloudflare Key](/images/cloudflare_key.png)
Using a Global API Key, you will have access to everything allowed by a Cloudflare account. It can access all domains from every account you have, this might be overpowered...
### Cloudflare API Token
An API token is recommended to keep control of specific domains only. You will need to give the correct permissions for Cloudflare's WAF Custom rules to work.
The required permissions are "Zone.Zone, Zone.Firewall Services"
![Cloudflare Token](/images/cloudflare_tokens.png)
Here is a token creation example:
![Cloudflare Token](/images/cloudflare_token.png)
## 💨 Quickstart
You can use any example scripts in the examples folder, just create a .env file
I might add more examples in the future, but everything is in the docs :)
---
Create any Python file in the cloned directory and paste these lines
```python
from cf_rules import Cloudflare
cf = Cloudflare()
cf.auth_key("<your-address@email.com>", "<your-global-api-key>")
# OR
cf.auth_token("<your-specific-bearer-token>")
domains = cf.domains[0].name
print(domains)
# >>> ['example.com']
cf.export_rules("example.com")
# Creates a text file for every rule you have on your domain
cf.create_rule("example.com", "My Bad Bots FW rule", "Bad Bots", "challenge")
# Create a new rule with the content of the "Bad bots.txt" file with the challenge action
cf.update_rule("example.com", "My Bad Bots FW rule", "Bad Bots lib")
# Change the rule's expression to the content of the "Bad bots lib.txt" file
```
## 🤝 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change and join your fork with the modifications.\
Please make sure to test your suggestions before committing.
If you don't feel comfortable coding, you can submit your idea about what you would like to see implemented.
Any PR with small code examples or better documentation changes is appreciated :)
## 👤 Author
**Quentin L.**
- Website: [quentium.fr](https://quentium.fr/)
- Twitter: [@QuentiumYT](https://twitter.com/QuentiumYT)
- Contact: [Mail](mailto:pro@quentium.fr?subject=[Cloudflare]%20Contact%20for%20...)
Please ✰ this repository if this project helped you!
## 📖 License
[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
---
_Made with_ ❤ _by QuentiumYT_
Raw data
{
"_id": null,
"home_page": "",
"name": "cf-rules",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "api,rules,wrapper,library,firewall,waf,cloudflare,bulk",
"author": "",
"author_email": "Quentin Lienhardt <pro@quentium.fr>",
"download_url": "https://files.pythonhosted.org/packages/ae/44/20253ff11d792689328a507e228a0a0c0d3c17ac6af342256d437cbb6c60/cf_rules-2.0.0.tar.gz",
"platform": null,
"description": "<h1 align=\"center\" style=\"font-size: 50px;\">Welcome to Cloudflare WAF Custom rules library \ud83d\udc4b</h1>\n\n### Previously known as Cloudflare Firewall Rules\n\n[![Website](https://quentium.fr/+img/github/website_cloudflare.svg)](https://quentiumyt.github.io/Cloudflare-Firewall-Rules/) \n[![Donate](https://quentium.fr/+img/github/donate.svg)](https://www.paypal.me/QuentiumYT/1) \n[![Contributions](https://quentium.fr/+img/github/contributions.svg)](https://github.com/QuentiumYT/Cloudflare-Firewall-Rules/pulls) \n[![Tested on Python 3.12](https://quentium.fr/+img/github/python312.svg)](https://www.python.org/downloads) \n[![License](https://quentium.fr/+img/github/apache2.svg)](https://github.com/QuentiumYT/Cloudflare-Firewall-Rules/blob/master/LICENSE) \n[![Size](https://img.shields.io/github/repo-size/QuentiumYT/Cloudflare-Firewall-Rules?label=Repo%20Size&color=4391BD&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAUCSURBVHhe7ZzdbhtFFMfPru3ECSFtYlqhVKK9IQ0Iil0JAilIhSTQPgHPwVWBB2hRVcFzcAG3CNIIJIgrxEeqctPSXvWioh/5aBJok6Zr5r/rTdeb2fjs7tjZmfXvZsdeS9H8dM6cc9aKqUePHjpjNa+5YPbiQtV27Evbjv3x/OeTS823U2E3r8bTlHdZLKeLduPy9PlfK96ddORC4NkL9ZqQNy+WFdvGlhvVou3MffRlfdT9QAqMF4jIcyxrTixHX3zhAM1OvU7PDw3gVo227Pm0kWj0GRhI2wrkTZ54mRCBj7ee0C9/Xqf1jUfilnV127Fmkp6JxgqMkuejSqKRKTx9sX5GyFsQS6k8UO4r0bsnJ5rpjDMxWWExTiAir+RY34rlYLFYoOorx3bJ81Eh0SiBfto2iAYgb3v7KdUXb9KmSNco0ko0RmD4zJt55zUaHhqktY3/6MrVm96HIkgj0QiBsoIx0N8vpByng8PPiRRuXyuTStS+CrertnGJW521jsCgvFKbgsElbiRqKzAs7wmjYHCJI1FLgbsKxtvPCsbPf1ynx5vdk6idQNmZVy57BQMS1/995J5h3ZKolc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ZiniLPJ/VXbD998v4q9TXOiOW8js/zevTQGaL/Af3ei59A3O7oAAAAAElFTkSuQmCC)](../../) \n\n> #### A Cloudflare wrapper to bulk add / edit your WAF custom rules using Cloudflare's API.\n\nThis library is a wrapper that aims to easily create, modify, delete rules. It also provides a way to import & export new rules in your domain's firewall.\n\nIf you have several rules that you want to duplicate among your domains, this module is made for you!\n\n### A complete documentation can be found at: https://quentiumyt.github.io/Cloudflare-Firewall-Rules/\n\n## \ud83d\udce5 Installation\n\n```bash\npip install cf_rules\n\n# OR\n\ngit clone https://github.com/QuentiumYT/Cloudflare-Firewall-Rules.git\ncd Cloudflare-Firewall-Rules/\npip install .\n```\n\n## \ud83d\ude80 Usage\n\nYou have 2 auth methods available:\n\nA Global API Key or a specific API Token generated from here: https://dash.cloudflare.com/profile/api-tokens\n\n### Cloudflare Global API Key\n\n![Cloudflare Key](/images/cloudflare_key.png)\n\nUsing a Global API Key, you will have access to everything allowed by a Cloudflare account. It can access all domains from every account you have, this might be overpowered...\n\n### Cloudflare API Token\n\nAn API token is recommended to keep control of specific domains only. You will need to give the correct permissions for Cloudflare's WAF Custom rules to work.\n\nThe required permissions are \"Zone.Zone, Zone.Firewall Services\"\n\n![Cloudflare Token](/images/cloudflare_tokens.png)\n\nHere is a token creation example:\n\n![Cloudflare Token](/images/cloudflare_token.png)\n\n## \ud83d\udca8 Quickstart\n\nYou can use any example scripts in the examples folder, just create a .env file\n\nI might add more examples in the future, but everything is in the docs :)\n\n---\n\nCreate any Python file in the cloned directory and paste these lines\n\n```python\nfrom cf_rules import Cloudflare\n\ncf = Cloudflare()\ncf.auth_key(\"<your-address@email.com>\", \"<your-global-api-key>\")\n# OR\ncf.auth_token(\"<your-specific-bearer-token>\")\n\ndomains = cf.domains[0].name\n\nprint(domains)\n# >>> ['example.com']\n\ncf.export_rules(\"example.com\")\n# Creates a text file for every rule you have on your domain\n\ncf.create_rule(\"example.com\", \"My Bad Bots FW rule\", \"Bad Bots\", \"challenge\")\n# Create a new rule with the content of the \"Bad bots.txt\" file with the challenge action\n\ncf.update_rule(\"example.com\", \"My Bad Bots FW rule\", \"Bad Bots lib\")\n# Change the rule's expression to the content of the \"Bad bots lib.txt\" file\n```\n\n## \ud83e\udd1d Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change and join your fork with the modifications.\\\nPlease make sure to test your suggestions before committing.\n\nIf you don't feel comfortable coding, you can submit your idea about what you would like to see implemented.\n\nAny PR with small code examples or better documentation changes is appreciated :)\n\n## \ud83d\udc64 Author\n\n**Quentin L.**\n\n- Website: [quentium.fr](https://quentium.fr/)\n- Twitter: [@QuentiumYT](https://twitter.com/QuentiumYT)\n- Contact: [Mail](mailto:pro@quentium.fr?subject=[Cloudflare]%20Contact%20for%20...)\n\nPlease \u2730 this repository if this project helped you!\n\n## \ud83d\udcd6 License\n\n[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)\n\n---\n\n_Made with_ \u2764 _by QuentiumYT_\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License. \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\" \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives. Copyright [2024] [Quentin Lienhardt] Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
"summary": "Wrapper library to import / export multiple remote rules and easily create, modify and delete rules.",
"version": "2.0.0",
"project_urls": {
"Bug Reports": "https://github.com/QuentiumYT/Cloudflare-Firewall-Rules/issues",
"Documentation": "https://quentiumyt.github.io/Cloudflare-Firewall-Rules/",
"Homepage": "https://github.com/QuentiumYT/Cloudflare-Firewall-Rules",
"Source Code": "https://github.com/QuentiumYT/Cloudflare-Firewall-Rules"
},
"split_keywords": [
"api",
"rules",
"wrapper",
"library",
"firewall",
"waf",
"cloudflare",
"bulk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "646d8b122608a7e68f5b3c44509f0b9f1dcb264d4224c1e9632a7e709c261c21",
"md5": "b244abe9bb7262904d1d8677c7885722",
"sha256": "b1c8d61f71b49116f756fe00bb1b958a12183f6a3d9d328adc4e20e6bff2e453"
},
"downloads": -1,
"filename": "cf_rules-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b244abe9bb7262904d1d8677c7885722",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 20419,
"upload_time": "2024-01-26T13:21:16",
"upload_time_iso_8601": "2024-01-26T13:21:16.415555Z",
"url": "https://files.pythonhosted.org/packages/64/6d/8b122608a7e68f5b3c44509f0b9f1dcb264d4224c1e9632a7e709c261c21/cf_rules-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ae4420253ff11d792689328a507e228a0a0c0d3c17ac6af342256d437cbb6c60",
"md5": "f6cedb9a1820930ab10bcf3b1f519d5c",
"sha256": "de98121d2bec836e2bdeb3a10232852c6268283e2010a1fde625bbe830c6a279"
},
"downloads": -1,
"filename": "cf_rules-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "f6cedb9a1820930ab10bcf3b1f519d5c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 24256,
"upload_time": "2024-01-26T13:21:19",
"upload_time_iso_8601": "2024-01-26T13:21:19.007640Z",
"url": "https://files.pythonhosted.org/packages/ae/44/20253ff11d792689328a507e228a0a0c0d3c17ac6af342256d437cbb6c60/cf_rules-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-26 13:21:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "QuentiumYT",
"github_project": "Cloudflare-Firewall-Rules",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "cf-rules"
}