nixpkgs/pkgs/tools/security/jwt-cli/default.nix
figsoda f97ce0a9a8 pkgs/tools/security: remove dead code
with the help of deadnix & nil
2023-07-12 14:35:00 -04:00

33 lines
993 B
Nix

{ lib, stdenv, fetchFromGitHub, rustPlatform, Security }:
rustPlatform.buildRustPackage rec {
pname = "jwt-cli";
version = "6.0.0";
src = fetchFromGitHub {
owner = "mike-engel";
repo = pname;
rev = version;
sha256 = "sha256-EzXpiJGTAlTDHJwl7FwIsDHMqStj2PLD1PHmv0flBKc=";
};
cargoHash = "sha256-l1W+eYuKnMPN2wPhYPXo5ixUz2bX+FZnDazk+FbxquU=";
buildInputs = lib.optional stdenv.isDarwin Security;
doInstallCheck = true;
installCheckPhase = ''
$out/bin/jwt --version > /dev/null
$out/bin/jwt decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c \
| grep -q 'John Doe'
'';
meta = with lib; {
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 ];
mainProgram = "jwt";
};
}