Comments (4)
@Sarga - oh; this is actually a complete oversight of the core code within the _raw
library call.
def _raw(self, method, headers,
api_call_part1, api_call_part2=None, api_call_part3=None,
identifier1=None, identifier2=None,
params=None, data=None):
...
url = (self.base_url + '/'
+ api_call_part1 + '/'
+ identifier1 + '/'
+ api_call_part2 + '/'
+ identifier2)
...
As you can see, there's no ability to handle a third identifier
within an API call. This is an oversight that was introduced with the new API waf calls.
It's only affects the following API calls (which is the ones you are using):
GET /zones/:zone_identifier/firewall/waf/packages/:package_identifier/groups/:identifier
PATCH /zones/:zone_identifier/firewall/waf/packages/:package_identifier/groups/:identifier
GET /zones/:zone_identifier/firewall/waf/packages/:package_identifier/rules/:identifier
PATCH /zones/:zone_identifier/firewall/waf/packages/:package_identifier/rules/:identifier
Code will have to be written, both in cli4
and the core libraries. Maybe later today.
from python-cloudflare.
@Sarga - the code is now there. It's in the 1.4.8 release (and pushed to pip). The cli4 command works along with the python api code. The third identifier is passed via the api call just like the first two.
$ cli4 --get /zones/:example.com/firewall/waf/packages/:1e334934fd7ae32ad705667f8c1057aa/rules/:100008C
{
"allowed_modes": [
"default",
"disable",
"simulate",
"block",
"challenge"
],
"default_mode": "block",
"description": "Block SQLi sleep probing",
"group": {
"id": "f90712123fb02287348dd34c0a282bb9",
"name": "Cloudflare Specials"
},
"id": "100008C",
"mode": "default",
"package_id": "1e334934fd7ae32ad705667f8c1057aa",
"priority": "22"
}
$
Please confirm on your side and then you can close this issue.
from python-cloudflare.
cli4 --get /zones/:example/firewall/waf/packages/:1e334934fd7ae32ad705667f8c1057aa/rules/:100008C - works well
cli4 --get /zones/:example.com/firewall/waf/packages/:1e334934fd7ae32ad705667f8c1057aa/rules/:100047WP - :NOT CODED YET 3
@mahtin check it please.
Also could you please add http2 / pseudo ipv4 settings?
#25
from python-cloudflare.
Yup - typo on my part. I matched [A-F]
vs. [A-Z]
(I just had a hexadecimal moment). This is now pushed to git and pip (as version 1.4.10).
$ cli4 --get /zones/:example.com/firewall/waf/packages/:1e334934fd7ae32ad705667f8c1057aa/rules/:100047WP
{
"allowed_modes": [
"default",
"disable",
"simulate",
"block",
"challenge"
],
"default_mode": "disable",
"description": "Block WordPress User-Agent completely (Pingback attack)",
"group": {
"id": "f90712123fb02287348dd34c0a282bb9",
"name": "Cloudflare Specials"
},
"id": "100047WP",
"mode": "default",
"package_id": "1e334934fd7ae32ad705667f8c1057aa",
"priority": "97"
}
$
Sorry for the extra cycle. Glad you are using the Python libs.
from python-cloudflare.
Related Issues (20)
- Deposit
- How to access R2 storage to perform CRUD on Bucket and Objects HOT 3
- Token authentication fails when using python-cloudflare versions above 2.8.15 HOT 8
- python-cloudflare is not PEP-561 aware HOT 2
- UnicodeDecodeError: 'gbk' codec can't decode byte 0x88 in position 16820: illegal multibyte sequence HOT 2
- HTTP method calls should be able to define content-header (headers) HOT 6
- Image error: /opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tests/__init__.py HOT 8
- 1012 Request must contain one of "purge_everything", "files", "tags", "hosts" or "prefixes" HOT 8
- Change WAF Custom Rule with wrong position HOT 1
- Get code and message from CloudFlare.exceptions.CloudFlareAPIError HOT 7
- CloudFlareError does not evaluate to true if there are no chained errors HOT 7
- Bad request for direct image upload HOT 6
- Regression in 2.18.0 HOT 8
- Would like to be able to pass in my own HTTP headers HOT 11
- Docs: Provide information on how arguments are mapped to API paths HOT 6
- URL creation doesn't ensure strings for parameters HOT 3
- Is max_requests_retries still valid? HOT 2
- Deprecate support for python3.5 HOT 3
- Possible error in README example HOT 2
- ModuleNotFoundError: No module named 'CloudFlare' after cloudflare dependency update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-cloudflare.