[nodejs-cookie-signature] Initial commit

Jamie Nguyen jamielinux at fedoraproject.org
Thu Feb 14 15:15:55 UTC 2013


commit 8745a8e44f0cec14724f35d03e4e5f1a786f00ac
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Thu Feb 14 15:15:47 2013 +0000

    Initial commit

 .gitignore                   |    1 +
 index-test.js                |   24 ++++++++++++++++
 nodejs-cookie-signature.spec |   63 ++++++++++++++++++++++++++++++++++++++++++
 sources                      |    1 +
 4 files changed, 89 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..8436d93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/cookie-signature-0.0.1.tgz
diff --git a/index-test.js b/index-test.js
new file mode 100644
index 0000000..9305174
--- /dev/null
+++ b/index-test.js
@@ -0,0 +1,24 @@
+
+/**
+ * Module dependencies.
+ */
+
+var cookie = require('..');
+
+describe('.sign(val, secret)', function(){
+  it('should sign the cookie', function(){
+    var val = cookie.sign('hello', 'tobiiscool');
+    val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');
+
+    var val = cookie.sign('hello', 'luna');
+    val.should.not.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');
+  })
+})
+
+describe('.unsign(val, secret)', function(){
+  it('should unsign the cookie', function(){
+    var val = cookie.sign('hello', 'tobiiscool');
+    cookie.unsign(val, 'tobiiscool').should.equal('hello');
+    cookie.unsign(val, 'luna').should.be.false;
+  })
+})
\ No newline at end of file
diff --git a/nodejs-cookie-signature.spec b/nodejs-cookie-signature.spec
new file mode 100644
index 0000000..6cc80ff
--- /dev/null
+++ b/nodejs-cookie-signature.spec
@@ -0,0 +1,63 @@
+%global enable_tests 0
+
+Name:       nodejs-cookie-signature
+Version:    0.0.1
+Release:    2%{?dist}
+Summary:    Node.js module to sign and unsign cookies
+# License text is included in Readme.md
+License:    MIT
+Group:      System Environment/Libraries
+URL:        https://github.com/visionmedia/node-cookie-signature
+Source0:    http://registry.npmjs.org/cookie-signature/-/cookie-signature-%{version}.tgz
+# The test files are not included in the npm tarball.
+# Source1 is retrieved from upstream version control repository:
+# wget https://raw.github.com/visionmedia/node-cookie-signature/master/index.js
+Source1:    index-test.js
+BuildArch:  noarch
+
+BuildRequires:  nodejs-devel
+
+%if 0%{?enable_tests}
+BuildRequires:  npm(mocha)
+BuildRequires:  npm(should)
+%endif
+
+%description
+%summary
+
+
+%prep
+%setup -q -n package
+mkdir -p test
+cp -p %{SOURCE1} test/index.js
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/cookie-signature
+cp -pr package.json index.js \
+    %{buildroot}%{nodejs_sitelib}/cookie-signature
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+%{nodejs_sitelib}/mocha/bin/mocha --require should --reporter spec
+%endif
+
+
+%files
+%doc History.md Readme.md
+%{nodejs_sitelib}/cookie-signature
+
+
+%changelog
+* Tue Feb 12 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.0.1-2
+- document how to retrieve "Source1: index-test.js"
+
+* Mon Feb 11 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.0.1-1
+- initial package
diff --git a/sources b/sources
index e69de29..cd141e7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+7beecc1535a387cb694f95ee4438ad33  cookie-signature-0.0.1.tgz


More information about the scm-commits mailing list