2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, django
|
|
|
|
, django_compat
|
|
|
|
, pytest-django
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-hijack";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "3.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# the wheel comes with pre-built assets, allowing us to avoid fighting
|
|
|
|
# with npm/webpack/gettext to build them ourselves.
|
|
|
|
format = "wheel";
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version format;
|
|
|
|
pname = "django_hijack";
|
|
|
|
dist = "py3";
|
|
|
|
python = "py3";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-sHI3ULJH5bH2n2AKQLHVEkBAYfM5GOC/+0qpKDFOods=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ django django_compat ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
checkInputs = [ pytestCheckHook pytest-django ];
|
|
|
|
preCheck = ''
|
|
|
|
export DJANGO_SETTINGS_MODULE='hijack.tests.test_app.settings'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestFlagsArray = [ "--pyargs" "hijack" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Allows superusers to hijack (=login as) and work on behalf of another user";
|
|
|
|
homepage = "https://github.com/arteria/django-hijack";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ris ];
|
|
|
|
};
|
|
|
|
}
|