This command-line tool is designed to compute the signature for Twilio API requests. It helps ensure the integrity and authenticity of the requests coming from Twilio by using HMAC-SHA1 hashing algorithm.
- Compute the HMAC-SHA1 hash for Twilio API requests.
- Easy to use command-line interface.
- Supports different URL structures and parameter combinations.
To use this tool, you need to have Go installed on your system. Follow these steps to set it up:
go install github.com/kmesiab/go-twilio-compute@latest
or
-
Clone the repository:
git clone https://github.com/kmesiab/go-twilio-compute.git
-
Navigate to the project directory:
cd go-twilio-compute
-
Build the project:
go build
Run the tool with the required flags:
./go-twilio-compute
--url <url Twilio will call>
--key <your Twilio API key>
--params <URL encoded body of the message>
Example:
./go-twilio-compute --url "https://example.com/api" --key "mysecretkey"
--params "Body=sample%20message%3F&From=%2B12533"
--url
: The URL Twilio will call.--key
: Your Twilio API key used to hash the message.--params
: The URL-encoded body of the message.
./go-twilio-compute --url http://foo.com --key MyFakeKey --params foo=bar
Computed Signature: w6A4pOIG/hOAQsWqwnZRblmo7vo=
To run the unit tests:
go test
Contributions are welcome! Feel free to submit pull requests or open issues to improve the tool or add new features.
This project is licensed under the MIT License - see the LICENSE file for details.
This is not a replacement for Twilio validation. This tool enables you to generate valid signatures for testing your Twilio applications.