nixpkgs/pkgs/tools/security/jwt-cli/default.nix

32 lines
984 B
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, fetchpatch }:
2020-01-10 15:44:09 +01:00
rustPlatform.buildRustPackage rec {
pname = "jwt-cli";
version = "5.0.0";
2020-01-10 15:44:09 +01:00
src = fetchFromGitHub {
owner = "mike-engel";
repo = pname;
rev = version;
sha256 = "0za4mpzry6i5gki524kp4by0n74pbc96cvzrkq286v8w033wj01i";
2020-01-10 15:44:09 +01:00
};
cargoSha256 = "1l5fhr5c2ygdlnpwsx62fm8di8li0wf15nvvcnnivjcic7f9b5j0";
2020-09-10 02:56:36 +02:00
2021-01-15 10:19:50 +01:00
buildInputs = lib.optional stdenv.isDarwin Security;
2020-01-12 15:11:17 +01:00
2020-09-16 23:20:16 +02:00
doInstallCheck = true;
installCheckPhase = ''
$out/bin/jwt --version > /dev/null
$out/bin/jwt decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c \
| grep -q 'John Doe'
'';
2020-09-16 23:20:16 +02:00
meta = with lib; {
2020-01-10 15:44:09 +01: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 ];
};
}