summaryrefslogtreecommitdiff
path: root/test/integration/api/token_test.rb
diff options
context:
space:
mode:
authorazul <azul@leap.se>2014-05-26 10:08:27 +0200
committerazul <azul@leap.se>2014-05-26 10:08:27 +0200
commit1d0d61389011a8d0d169bc139590d90a6fbbac60 (patch)
tree9746836914f455889af9e24fdff36a1241ef4b24 /test/integration/api/token_test.rb
parentdf298887221cffc8cacc8965d73a0d7850118849 (diff)
parent5764daae090227bf4c5967900b708392c967be47 (diff)
Merge pull request #163 from azul/feature/3398-save-hashed-token
hash token with sha512 against timing attacs #3398
Diffstat (limited to 'test/integration/api/token_test.rb')
-rw-r--r--test/integration/api/token_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/integration/api/token_test.rb b/test/integration/api/token_test.rb
new file mode 100644
index 0000000..ad3ac22
--- /dev/null
+++ b/test/integration/api/token_test.rb
@@ -0,0 +1,15 @@
+require 'test_helper'
+require_relative 'srp_test'
+
+class TokenTest < SrpTest
+
+ setup do
+ register_user
+ end
+
+ test "stores token SHA512 encoded" do
+ authenticate
+ token = server_auth['token']
+ assert Token.find(Digest::SHA512.hexdigest(token))
+ end
+end