unix命令行jwt生成器。
jwt-generator的Python项目详细描述
基于rsa私钥的简单命令行jwt令牌生成器。
默认情况下,它将打印带有iss、nbf和exp集的jwt令牌,该令牌已签名 通过~/.ssh/id_rsa中的私钥。:
iss - will be set to the current user name nbf - will be set to 1 minute in the past exp - will be set to 30 minutes in the future.
可以覆盖命令行上的默认设置。
选项
--issuer TEXT | of the token |
--not-before INTEGER | |
number of seconds before now the token is no longer valid | |
--expires-after INTEGER | |
number of seconds after which the token is no longer valid | |
--private-key-file PATH | |
the private key file to sign the token with | |
-A, --authorization-header | |
print authorization header bearer token | |
--help | Show this message and exit. |
示例
要发送带有curl的授权承载令牌,请键入:
curl -H "$(jwt-generator -A)" https://httpbin.org/headers
在MacOS上安装
要安装MacOS,由于依赖于加密技术,您可能会遇到麻烦。类型:
export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include" export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
在执行pip之前,请安装jwt generator。有关详细信息,请参见https://github.com/pyca/cryptography/issues/2692。