jwt 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data.tar.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -1,8 +1,11 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
+ require 'rake/clean'
3
4
  require 'echoe'
4
5
 
5
- Echoe.new('jwt', '0.1.1') do |p|
6
+ CLEAN.include("pkg")
7
+
8
+ Echoe.new('jwt', '0.1.2') do |p|
6
9
  p.description = "JSON Web Token implementation in Ruby"
7
10
  p.url = "http://github.com/progrium/ruby-jwt"
8
11
  p.author = "Jeff Lindsay"
@@ -14,4 +17,8 @@ end
14
17
 
15
18
  task :test do
16
19
  sh "spec spec/jwt.rb"
20
+ end
21
+
22
+ task :release => [:clean, :gem] do
23
+ sh "ls pkg/*.gem"
17
24
  end
@@ -2,18 +2,18 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{jwt}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jeff Lindsay"]
9
9
  s.cert_chain = ["/Users/progrium/.gem/gem-public_cert.pem"]
10
- s.date = %q{2011-02-23}
10
+ s.date = %q{2011-03-21}
11
11
  s.description = %q{JSON Web Token implementation in Ruby}
12
12
  s.email = %q{jeff.lindsay@twilio.com}
13
13
  s.extra_rdoc_files = ["lib/jwt.rb"]
14
14
  s.files = ["Rakefile", "lib/jwt.rb", "spec/jwt.rb", "Manifest", "jwt.gemspec"]
15
15
  s.homepage = %q{http://github.com/progrium/ruby-jwt}
16
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Jwt"]
16
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Jwt", "--main", "README.md"]
17
17
  s.require_paths = ["lib"]
18
18
  s.rubyforge_project = %q{jwt}
19
19
  s.rubygems_version = %q{1.4.1}
data/lib/jwt.rb CHANGED
@@ -13,7 +13,7 @@ module JWT
13
13
 
14
14
  def self.sign(algorithm, msg, key)
15
15
  raise NotImplementedError.new("Unsupported signing method") unless ["HS256", "HS384", "HS512"].include?(algorithm)
16
- OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(algorithm.sub('HS', 'sha')), key, msg)
16
+ OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new(algorithm.sub('HS', 'sha')), key, msg)
17
17
  end
18
18
 
19
19
  def self.base64url_decode(str)
@@ -14,7 +14,7 @@ describe JWT do
14
14
  it "decodes valid JWTs" do
15
15
  example_payload = {"hello" => "world"}
16
16
  example_secret = 'secret'
17
- example_jwt = 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJoZWxsbyI6ICJ3b3JsZCJ9.YjZmNmEwMmMzMmU4NmEyMjRhYzRlMmFhYTQxNWQyMTA2Y2JiNDk4NGEyN2Q5ODYzOWVkODI2ZjVjYjY5Y2EzZg'
17
+ example_jwt = 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJoZWxsbyI6ICJ3b3JsZCJ9.tvagLDLoaiJKxOKqpBXSEGy7SYSifZhjntgm9ctpyj8'
18
18
  decoded_payload = JWT.decode(example_jwt, example_secret)
19
19
  decoded_payload.should == example_payload
20
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwt
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Lindsay
@@ -36,7 +36,7 @@ cert_chain:
36
36
  WZqts+sMhUpDxxL+p6p6bQ==
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2011-02-23 00:00:00 -08:00
39
+ date: 2011-03-21 00:00:00 -07:00
40
40
  default_executable:
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
@@ -79,6 +79,8 @@ rdoc_options:
79
79
  - --inline-source
80
80
  - --title
81
81
  - Jwt
82
+ - --main
83
+ - README.md
82
84
  require_paths:
83
85
  - lib
84
86
  required_ruby_version: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file