Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use API key in Twilio to improve security #3204

Closed
1 task done
woj-tek opened this issue May 29, 2023 · 0 comments · Fixed by #3205
Closed
1 task done

Use API key in Twilio to improve security #3204

woj-tek opened this issue May 29, 2023 · 0 comments · Fixed by #3205
Labels
feature-request Request for new features to be added

Comments

@woj-tek
Copy link
Contributor

woj-tek commented May 29, 2023

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

Other

🔖 Feature description

(This is a followup to #1860 (comment))

I would like to add/ask option to log-in via API Key instead of using master AccountSID and AuthToken. See https://www.twilio.com/docs/usage/requests-to-twilio#creating-or-updating-resources-with-the-post-method

Basically one can either use const client = require('twilio')(accountSid, authToken); or const client = require('twilio')(apiKey, apiSecret, { accountSid: accountSid });, where the second one is more secure and thus recomended.

Answering @CommanderStorm questions:

  • please also go into detail what you mean by "more secure and thus recommended"

As stated in the documentation: https://www.twilio.com/docs/iam/keys/api-key:

Main API Keys have the same access as Standard Keys, and can also manage API Keys, Account Configuration, and Subaccounts. Main API Keys give you the same level of access as if you were using account API Credentials.
For example, you might issue separate API Keys to different developers or to different subsystems within your application. If a key is compromised or no longer used, you can easily delete it to prevent unauthorized access!

It's not as easy as with main AuthToken/Main API key, which gives you almost unlimited access to the accont

The problem with the notification providers is, that they are for the most part untested/untestable. => Screenshots are needed to verify that this change works.

There seems to be test credentials (https://www.twilio.com/docs/iam/test-credentials) though most likely still requiring any Twilio account.

✔️ Solution

Use const client = require('twilio')(apiKey, apiSecret, { accountSid: accountSid }); if api key is provided.

❓ Alternatives

No response

📝 Additional Context

No response

@woj-tek woj-tek added the feature-request Request for new features to be added label May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features to be added
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant