-
Notifications
You must be signed in to change notification settings - Fork 57
Adding Code Snippets #63
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
Conversation
key = os.getenv('NEXMO_API_KEY'), | ||
secret = os.getenv('NEXMO_API_SECRET'), | ||
signature_secret = os.getenv('NEXMO_SIGNATURE_SECRET'), | ||
signature_method = 'md5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a difference between md5 hash and HMAC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, HMAC needs a cryptographic function like md5, sha1 to make the calculations... In other words HMAC depends on a cryptographic functions and other variables like a secret. Is there a specific requirement for either? i just went with md5 as the standard.
sms/send-signed-sms.py
Outdated
#Init the client | ||
client = nexmo.Client( | ||
key = os.getenv('NEXMO_API_KEY'), | ||
secret = os.getenv('NEXMO_API_SECRET'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They shouldn't need to add an API Secret if they're signing (the signature acts as the auth)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took after the other code snippet models. My bad. Cleaning up
On a side note, Python still need support for all the hashing algorithms, so might be a good idea to fully do this after we add those in. |
some changes to the Nexmo Client are needed for this to work
some changes to the Nexmo Client are needed in order for this to work
This reverts commit 16f3b68.
To use the async variant of the number insight a change in the For example, proposing: def get_advanced_number_insight(self, params=None, **kwargs):
argoparams = params or kwargs
if "callback" in argoparams:
return self.get(self.api_host, "/ni/advanced/async/json", params or kwargs)
else:
return self.get(self.api_host, "/ni/advanced/json", params or kwargs)```
I tested with the no callback param and is working too, and it works like a charm. Will submit a pr for that too |
No description provided.