socketry / cloudflare

An asynchronous Ruby wrapper for the CloudFlare V4 API.
138 stars 86 forks source link

Support bearer token authentication #55

Closed knu closed 4 years ago

knu commented 4 years ago

Cloudflare API now supports a normal bearer token authentication method instead of one using an email + API key pair.

https://blog.cloudflare.com/api-tokens-general-availability/ https://api.cloudflare.com/#getting-started-requests

ioquatix commented 4 years ago

LGTM, as this breaks public API I'll do a major version bump.

knu commented 4 years ago

@ioquatix Does it? I think I just added a new keyword argument.

knu commented 4 years ago

Ah, did you mean authenticated()? I wasn't considering it was a public API because it didn't have a spec. I couldn't manage to make rspec pass anyway, though. 😜

ioquatix commented 4 years ago

I will think about it. I can check some existing code but I don't think many use that method... if I'm confident that it's generally not used, then it can just be minor version bump.

Regarding testing, I could give several colourful words to describe it. Cloudflare have been less than helpful even thought I was assigned someone to try and sort it out, we never made any progress. I just asked for a sandbox account, but even that was "too hard". I don't know how anyone at Cloudflare tests anything.

knu commented 4 years ago

Thank you for the new release!