Needs work
Project:
Cloudflare
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2020 at 11:17 UTC
Updated:
1 Mar 2023 at 19:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lusitaniae commentedI forked the library and add support for both kinds of api keys
This is just a temporary fix, using the official SDK and/or merging my PR in github is the end goal.
Comment #3
useernamee commentedHello @lusitaniae,
I'd be very interested in using your fix, but I'm wondering how you were able to make your patch work? I'm getting this problem - a patch is applied after cloudflare module is installed by composer so required package stays at it's old value.
My workaround was to add your PR as a patch to my main composer.json file.
I'll let you know how it worked.
Comment #4
useernamee commented@lusitaniae
I've came accross another issue. My api token has uppercase letters in it and that makes it invalid. I can roll out a PR to your fork if you'd like me to do it, but I'm wondering in the first place whether I'm testing with the right thing and even if we do that will cloudflarephpsdk be able to make requests with tokens instead of api key.
Well here is quick PR to your PR: https://github.com/Lusitaniae/cloudflarephpsdk/pull/1
Comment #5
useernamee commentedI've just fixed the cloudflarephpsdk patch: https://github.com/d8-contrib-modules/cloudflarephpsdk/pull/34/files
This now works on our system. As you can see in the patch I also had to increase the timeout because authorization check requests were timing out.
Comment #6
alexgreyhead commentedIn case it helps anyone else, the diff for useernamee's PR #34 can be found at:
https://patch-diff.githubusercontent.com/raw/d8-contrib-modules/cloudfla...
... and you can patch the SDK via Composer by saving that patch file to your patches directory and adding the following to extra > patches:
(You will need to change the patch filename to whatever you chose to name the patch file.)
/Al
Comment #7
froboyI've added what I've deemed "one more API Key Length PR". As I've noted there:
As an update to #6, you don't even need to download the patch to your local, you can use the direct url from GitHub:
Comment #8
bburgI would urge against anyone using the diff of a pull request as a remote link in their composer patches. The diff could unpredictably, and fail to apply to future versions, or worse, a malicious developer could make unwanted changes to the code. Maybe less of an issue here, but this is something awareness is being raised around on Drupal module patches being created from Gitlab merge requests.
Comment #9
rosk0This needs to be re-tested and confirmed if still an issue as #2915341: Proposal to switch Cloudflare library was committed and released in 8.x-1.0-beta3.