https://github.com/lvillis/hmac-cli
🛠️ A command-line tool for generating HMAC signatures.
https://github.com/lvillis/hmac-cli
Last synced: 2 months ago
JSON representation
🛠️ A command-line tool for generating HMAC signatures.
- Host: GitHub
- URL: https://github.com/lvillis/hmac-cli
- Owner: lvillis
- License: mit
- Created: 2024-10-30T09:38:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-12T23:21:55.000Z (5 months ago)
- Last Synced: 2025-01-28T05:17:51.580Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Table of Contents↗️
hmac-cli
🛠️ A command-line tool for generating HMAC signatures.
---
## Example
```bash
$ hmac -h
Usage: hmac.exe [OPTIONS] --urlOptions:
-a, --ak Access Key ID (can be provided via config file `ak`)
-s, --sk Secret Key (can be provided via config file `sk`)
-m, --method Request method (default: POST) [default: POST]
-u, --url Request URL
-b, --body Request body (JSON format)
-g, --gateway Gateway type (default: traefik) [default: traefik] [possible values: apisix, traefik, higress]
--algorithm HMAC algorithm (default: hmac-sha256) [default: hmac-sha256] [possible values: hmac-sha256, hmac-sha384, hmac-sha512]
-h, --help Print help
-V, --version Print version
``````bash
# Generate an HMAC signature for a POST request
$ hmac --ak --sk --method POST --url https://exmaple.com/api --body "{\"hello\":\"world\"}" --gateway traefik# AK\SK can be set as environment variables (HMAC_AK\HMAC_SK)
$ hmac --method POST --url https://exmaple.com/api --body "{\"hello\":\"world\"}" --gateway apisix# AK\SK can be set in a configuration file (~/.hmac/config.toml)
# vi ~/.hmac/config.toml
# HMAC_AK = ""
# HMAC_SK = ""
$ hmac --method POST --url https://exmaple.com/api --body "{\"hello\":\"world\"}" --gateway higress
```