nodejs-hawk/nodejs-hawk.spec
houyingchao 1fb50d3050 Fix CVE-2022-29167
(cherry picked from commit 635e46bf83348a65660afd711493466814a87e72)
2022-05-18 17:36:23 +08:00

54 lines
1.5 KiB
RPMSpec

%global enable_tests 0
Name: nodejs-hawk
Version: 4.1.2
Release: 2
Summary: HTTP Hawk authentication scheme
License: BSD
URL: https://github.com/hueniverse/hawk
Source0: https://registry.npmjs.org/hawk/-/hawk-%{version}.tgz
Patch0: CVE-2022-29167.patch
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging npm(boom) npm(cryptiles) npm(hoek) npm(sntp)
%if 0%{?enable_tests}
BuildRequires: npm(lab) npm(code)
%endif
%description
Hawk is an HTTP authentication scheme using a message authentication code (MAC)
algorithm to provide partial HTTP request cryptographic verification.
%prep
%autosetup -n package -p1
%nodejs_fixdep cryptiles "^2.0.5"
%nodejs_fixdep boom "^2.10.1"
%nodejs_fixdep hoek "^0.9.1"
chmod a-x README.md LICENSE package.json client.js example/* images/* lib/*
sed -i 's/\r$//' README.md
sed -i 's/\r$//' example/usage.js
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/hawk
cp -pr package.json lib %{buildroot}%{nodejs_sitelib}/hawk
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%__nodejs -e "require('./')"
%if 0%{?enable_tests}
%{nodejs_sitelib}/lab/bin/lab -a code -t 100 -L
%endif
%files
%doc README.md example images
%license LICENSE
%{nodejs_sitelib}/hawk
%changelog
* Tue May 17 2022 houyingchao <houyingchao@h-partners.com> - 4.1.2-2
- Fix CVE-2022-29167
* Thu Aug 20 2020 wangxiao <wangxiao65@huawei.com> - 4.1.2-1
- Package init