mojo_auth 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05391a8161fa237e960a39f300e1a6d1672d29fd
4
- data.tar.gz: a2f0a74a402dc59e4607ecf25d8ef34dad6275ce
3
+ metadata.gz: 2438e430058337110bce28f677f818deb79d1005
4
+ data.tar.gz: 68fca313b937214cb4c1db6976a47f3fef0ef959
5
5
  SHA512:
6
- metadata.gz: 09102d044180a4d493e7b17bb1c2b629470b2841304abd29107cf2ebd10ce4a3f6c7908459f4078daf4e15d4f7ddd885960a4ac066ad73222df95ce468614bcf
7
- data.tar.gz: b7dd6991b3603f627363f867f3fccf20400ece3d8c2a820cdfd6e3895d20a1e1bfda8d037f57ec44ecc6d6a9c9111d0e89c9895129da0377c1899fbfb7c3380a
6
+ metadata.gz: 6e22869bffbb1c25da7481b7628511b6f987817c743e9bd512bd67a94af74a7bcd81620fb40516acf2a717b633813c9c6ba13979125a6b51ba70c3d4a4a1decf
7
+ data.tar.gz: b5af5957bc87edec2279e2203e7a69ee04a044315424d0047afd8e0f0c8a9a8d1070616c9540ef68d09cfb86484f3b202d8f29d7cf87ff162c2183477849c6ee
@@ -1,4 +1,7 @@
1
1
  # [develop](https://github.com/mojolingo/mojo-auth.rb)
2
2
 
3
- # [v0.1.0](https://github.com/adhearsion/punchblock/compare/0e767e1c19b251a6dd3665e2f1f920fa237ac9cf...v0.1.0) - [2014-09-26](https://rubygems.org/gems/mojo_auth/versions/0.1.0)
3
+ # [v0.1.1](https://github.com/mojolingo/mojo-auth.rb/compare/v0.1.0...v0.1.1) - [2015-04-09](https://rubygems.org/gems/mojo_auth/versions/0.1.1)
4
+ * Bugfix: Remove newlines from passwords for compat with other libs
5
+
6
+ # [v0.1.0](https://github.com/mojolingo/mojo-auth.rb/compare/0e767e1c19b251a6dd3665e2f1f920fa237ac9cf...v0.1.0) - [2014-09-26](https://rubygems.org/gems/mojo_auth/versions/0.1.0)
4
7
  * Initial release
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
- [![Gem Version](https://badge.fury.io/rb/mojo_auth.png)](https://rubygems.org/gems/mojo_auth)
2
- [![Build Status](https://secure.travis-ci.org/mojolingo/mojo-auth.rb.png?branch=develop)](http://travis-ci.org/mojolingo/mojo-auth.rb)
1
+ [![Gem Version](https://badge.fury.io/rb/mojo_auth.svg)](http://badge.fury.io/rb/mojo_auth)
2
+ [![Build Status](https://travis-ci.org/mojolingo/mojo-auth.rb.svg?branch=develop)](http://travis-ci.org/mojolingo/mojo-auth.rb)
3
3
  [![Dependency Status](https://gemnasium.com/mojolingo/mojo-auth.rb.png?travis)](https://gemnasium.com/mojolingo/mojo-auth.rb)
4
- [![Code Climate](https://codeclimate.com/github/mojolingo/mojo-auth.rb.png)](https://codeclimate.com/github/mojolingo/mojo-auth.rb)
5
- [![Coverage Status](https://coveralls.io/repos/mojolingo/mojo-auth.rb/badge.png?branch=develop)](https://coveralls.io/r/mojolingo/mojo-auth.rb)
6
- [![Inline docs](http://inch-ci.org/github/mojolingo/mojo-auth.rb.png?branch=develop)](http://inch-ci.org/github/mojolingo/mojo-auth.rb)
4
+ [![Code Climate](https://codeclimate.com/github/mojolingo/mojo-auth.rb/badges/gpa.svg)](https://codeclimate.com/github/mojolingo/mojo-auth.rb)
5
+ [![Coverage Status](https://img.shields.io/coveralls/mojolingo/mojo-auth.rb.svg)](https://coveralls.io/r/mojolingo/mojo-auth.rb?branch=develop)
6
+ [![Inline docs](http://inch-ci.org/github/mojolingo/mojo-auth.rb.svg?branch=develop)](http://inch-ci.org/github/mojolingo/mojo-auth.rb)
7
7
 
8
8
  # mojo_auth
9
9
 
10
- [MojoAuth](http://mojolingo.com/mojoauth) is a set of standard approaches to cross-app authentication based on [Hash-based Message Authentication Codes](http://en.wikipedia.org/wiki/Hash-based_message_authentication_code) (HMAC), inspired by ["A REST API For Access To TURN Services"](http://tools.ietf.org/html/draft-uberti-behave-turn-rest).
10
+ [MojoAuth](http://mojoauth.mojolingo.com) is a set of standard approaches to cross-app authentication based on [Hash-based Message Authentication Codes](http://en.wikipedia.org/wiki/Hash-based_message_authentication_code) (HMAC), inspired by ["A REST API For Access To TURN Services"](http://tools.ietf.org/html/draft-uberti-behave-turn-rest).
11
11
 
12
12
  ## Installation
13
13
 
@@ -32,20 +32,20 @@ require 'mojo_auth'
32
32
 
33
33
  # Generate a shared secret
34
34
  secret = MojoAuth.create_secret
35
- # => "XyD+xeJHivzbOUe3vwdU6Z5vDe/vio34MxKX8HYViR0+p4t/NzaIpbK+9VwX\n5qHCj7m4f7UNRXgOJPXzn6MT0Q==\n"
35
+ # => "XyD+xeJHivzbOUe3vwdU6Z5vDe/vio34MxKX8HYViR0+p4t/NzaIpbK+9VwX\n5qHCj7m4f7UNRXgOJPXzn6MT0Q=="
36
36
 
37
37
  # Create temporary credentials
38
38
  credentials = MojoAuth.create_credentials(id: 'foobar', secret: secret)
39
- # => {:username=>"1411837760:foobar", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}
39
+ # => {:username=>"1411837760:foobar", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw="}
40
40
 
41
41
  # Test credentials
42
- MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}, secret: secret)
42
+ MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw="}, secret: secret)
43
43
  # => "foobar"
44
44
  MojoAuth.test_credentials({username: "1411837760:foobar", password: "wrongpassword"}, secret: secret)
45
45
  # => false
46
46
 
47
47
  # 1 day later
48
- MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}, secret: secret)
48
+ MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw="}, secret: secret)
49
49
  # => false
50
50
  ```
51
51
 
@@ -11,20 +11,20 @@ require 'mojo_auth/version'
11
11
  #
12
12
  # # Generate a shared secret
13
13
  # secret = MojoAuth.create_secret
14
- # # => "XyD+xeJHivzbOUe3vwdU6Z5vDe/vio34MxKX8HYViR0+p4t/NzaIpbK+9VwX\n5qHCj7m4f7UNRXgOJPXzn6MT0Q==\n"
14
+ # # => "XyD+xeJHivzbOUe3vwdU6Z5vDe/vio34MxKX8HYViR0+p4t/NzaIpbK+9VwX\n5qHCj7m4f7UNRXgOJPXzn6MT0Q=="
15
15
  #
16
16
  # # Create temporary credentials
17
17
  # credentials = MojoAuth.create_credentials(id: 'foobar', secret: secret)
18
- # # => {:username=>"1411837760:foobar", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}
18
+ # # => {:username=>"1411837760:foobar", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw="}
19
19
  #
20
20
  # # Test credentials
21
- # MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}, secret: secret)
21
+ # MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw="}, secret: secret)
22
22
  # # => "foobar"
23
23
  # MojoAuth.test_credentials({username: "1411837760:foobar", password: "wrongpassword"}, secret: secret)
24
24
  # # => false
25
25
  #
26
26
  # # 1 day later
27
- # MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}, secret: secret)
27
+ # MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw="}, secret: secret)
28
28
  # # => false
29
29
  #
30
30
  class MojoAuth
@@ -48,15 +48,15 @@ class MojoAuth
48
48
  #
49
49
  # @example Basic usage
50
50
  # credentials = MojoAuth.create_credentials(secret: secret)
51
- # # => {:username=>"1411837760", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}
51
+ # # => {:username=>"1411837760", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw="}
52
52
  #
53
53
  # @example Asserting an identity
54
54
  # credentials = MojoAuth.create_credentials(id: 'foobar', secret: secret)
55
- # # => {:username=>"1411837760:foobar", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}
55
+ # # => {:username=>"1411837760:foobar", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw="}
56
56
  #
57
57
  # @example Specifying an alternative TTL
58
58
  # credentials = MojoAuth.create_credentials(ttl: 600, secret: secret)
59
- # # => {:username=>"1411837760", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}
59
+ # # => {:username=>"1411837760", :password=>"wb6KxLj6NXcUaqNb1SlHH1V3QHw="}
60
60
  #
61
61
  def self.create_credentials(id: nil, secret: required, ttl: DAY_IN_SECONDS)
62
62
  expiry_timestamp = (Time.now.utc + ttl).to_i
@@ -72,11 +72,11 @@ class MojoAuth
72
72
  # @return [Boolean, String] whether or not the credentials are valid (were created using the specified secret) and current (have not yet expired). When the credentials assert an identity, that identity is returned.
73
73
  #
74
74
  # @example Testing correct credentials
75
- # MojoAuth.test_credentials({username: "1411837760", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}, secret: secret)
75
+ # MojoAuth.test_credentials({username: "1411837760", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw="}, secret: secret)
76
76
  # # => true
77
77
  #
78
78
  # @example Testing correct ID-asserting credentials
79
- # MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw=\n"}, secret: secret)
79
+ # MojoAuth.test_credentials({username: "1411837760:foobar", password: "wb6KxLj6NXcUaqNb1SlHH1V3QHw="}, secret: secret)
80
80
  # # => "foobar"
81
81
  #
82
82
  # @example Testing incorrect credentials
@@ -107,7 +107,7 @@ class MojoAuth
107
107
  #
108
108
  # @return [String] the message signed with the shared secret
109
109
  def sign(message)
110
- Base64.encode64(OpenSSL::HMAC.digest('sha1', @secret, message))
110
+ Base64.encode64(OpenSSL::HMAC.digest('sha1', @secret, message)).chomp
111
111
  end
112
112
 
113
113
  # Assert a set of credentials
@@ -1,4 +1,4 @@
1
1
  # MojoAuth version
2
2
  class MojoAuth
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['ben@langfeld.me']
11
11
  spec.summary = 'Implementation of MojoAuth in Ruby'
12
12
  spec.description = 'MojoAuth is a set of standard approaches to cross-app authentication based on HMAC.'
13
- spec.homepage = 'https://github.com/mojolingo/mojo_auth.rb'
13
+ spec.homepage = 'https://github.com/mojolingo/mojo-auth.rb'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mojo_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Langfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-26 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -186,7 +186,7 @@ files:
186
186
  - mojo-auth.gemspec
187
187
  - spec/mojo_auth_spec.rb
188
188
  - spec/spec_helper.rb
189
- homepage: https://github.com/mojolingo/mojo_auth.rb
189
+ homepage: https://github.com/mojolingo/mojo-auth.rb
190
190
  licenses:
191
191
  - MIT
192
192
  metadata: {}
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.2.2
209
+ rubygems_version: 2.4.5
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Implementation of MojoAuth in Ruby