2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, fetchpatch }:
|
2020-01-10 14:44:09 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "jwt-cli";
|
2022-01-22 18:01:15 +00:00
|
|
|
version = "5.0.2";
|
2020-01-10 14:44:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mike-engel";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-01-22 18:01:15 +00:00
|
|
|
sha256 = "0w7fqmh8gihknvdamnq1n519253d4lxrpv378jajca9x906rqy1r";
|
2020-01-10 14:44:09 +00:00
|
|
|
};
|
|
|
|
|
2022-01-22 18:01:15 +00:00
|
|
|
cargoSha256 = "0b7m23azy8cb8d5wkawnw6nv8k7lfnfwc06swmbkfvg8vcxfsacs";
|
2020-09-10 00:56:36 +00:00
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security;
|
2020-01-12 14:11:17 +00:00
|
|
|
|
2020-09-16 21:20:16 +00:00
|
|
|
doInstallCheck = true;
|
2021-11-21 21:22:03 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/jwt --version > /dev/null
|
|
|
|
$out/bin/jwt decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c \
|
|
|
|
| grep -q 'John Doe'
|
|
|
|
'';
|
2020-09-16 21:20:16 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-01-10 14:44:09 +00:00
|
|
|
description = "Super fast CLI tool to decode and encode JWTs";
|
|
|
|
homepage = "https://github.com/mike-engel/jwt-cli";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ rycee ];
|
|
|
|
};
|
|
|
|
}
|