Curetix / mailflare-extension

Browser extension to use Cloudflare Email Routing as an email alias service like AnonAddy or SimpleLogin
https://mailflare.cc
MIT License
51 stars 2 forks source link

[Bug]: Authentication Error #20

Closed unalkalkan closed 3 months ago

unalkalkan commented 3 months ago

What is this bug about?

When I get a token with the config specified in the README.md, I get the following error in browser extension:

image

Here's the token config:

image

So I dug in a little bit and sent the /email/routing/rules request with curl with the API Token, and I got this:

$ curl --request GET \
  --url https://api.cloudflare.com/client/v4/zones/$ZONE_ID/email/routing/rules \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer $API_TOKEN'

{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}

I created a new token with Read access to all resources and Edit access to Email Routing Rules, then I was able to successfully sent the request.

So either I am missing something with the first config, or it needs an additional resource that is not added into the README.md

I'll dig in more when I got time, I'll be removing some resource read accesses to narrow it down to what else is actually needed.

Steps to reproduce

No response

Additional info

No response

Curetix commented 3 months ago

Looks like you're missing the Zone | Email Routing Rules | Edit permission in the first token.

unalkalkan commented 3 months ago

Ooops, that should be it. It flew over my head I guess haha. Thanks for the quick reply!