hjk789 / NXEnhanced

Adds "quality-of-life" features to NextDNS website for a more practical usability
329 stars 20 forks source link

Support Official NextDNS API #56

Closed quantumpacket closed 1 year ago

quantumpacket commented 2 years ago

Docs: https://nextdns.github.io/api/ (BETA)

Just creating this issue as a placeholder. Not all functionality can be replaced with the API at the moment (log access for now?). However, if they add support for ruleset management that could greatly simplify the extension.

hjk789 commented 2 years ago

Yeah, I'm aware of this new API, it includes some additional features not included in the standard API. The problem is: it requires an API key provided by NextDNS devs, and I'm not sure if it would be a good idea to put the API key on an extension that anyone can easily view the code. On a compiled code it wouldn't be much of a problem, but extensions are wide open. The only safe solution would be sending all API requests to a server owned by me, which would include the API key. But that's not a good idea either, as the users would have to trust a third-party server. Of course, I would upload the server code here (without the key), but still...

quantumpacket commented 2 years ago

The API key is per user. I have my API key displayed on my NextDNS account settings page. All you need to do is have a way for people to supply it to the extension. For example the popular extensions Octotree and RefinedGithub have a setting option where you can supply your GitHub token.

I'm even wondering if there is a way to use the password manager to store the token, but honestly if my token is able to be accessed in my browser by someone or something, then I should probably not be using my browser to login to NextDNS to begin with.

hjk789 commented 2 years ago

Oh, I didn't noticed that they added the key to the account page. Cool. I think the user don't even need to inform the key, as the API itself already responds with it.

api