devise_ott 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0c6d14dde77519a13190e9991d61c15263c1022
4
- data.tar.gz: d577d029fc506f7a8e09e0c8f17dafc2c0ec6c12
3
+ metadata.gz: 8aed49018c61ba2d240337012f4cd2efaea8d736
4
+ data.tar.gz: fafef4d619522ffb6387743e5a4f7b249eca425c
5
5
  SHA512:
6
- metadata.gz: cfb7a2a80bf88e155d955f401038f214464054f6f51f1b2354d3f4aa4d4fb8f06c9072f58f437f0f749aa5f3700440a91cb654ceff9e360864c15b8e8295729a
7
- data.tar.gz: d9b24eec89f9388dcbec1535c1c2b20d4a3d7eaf9c234fcca66e6ee5446762be6ec763c6a0031812cfeb57be6fc0a7a4ae92e968110a285173d29f33933bc483
6
+ metadata.gz: 204622c6def2426ddd247bbd42c70f0b3386c5b218bbac4ffd42a623935be1e007bd9a4f117e7a1935f7fa4f9c53c4d61733efb641c741fcee108444b5a80d98
7
+ data.tar.gz: 8a3409786a9496a9c5b48d5306eb6e3517e53e71b64277599b541372b51300b8e9d5a48d0038b3c94c8c90fc8c909bd138a4d15e17e3aebf82b23fe8b5379e15
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.1.0
6
- - ruby-head
6
+ before_install:
7
+ - gem install bundler -v '= 1.5.1'
7
8
  services:
8
9
  - redis-server
data/Gemfile.lock CHANGED
@@ -36,12 +36,19 @@ GEM
36
36
  atomic (1.1.14)
37
37
  bcrypt-ruby (3.1.2)
38
38
  builder (3.1.4)
39
+ coveralls (0.7.0)
40
+ multi_json (~> 1.3)
41
+ rest-client
42
+ simplecov (>= 0.7)
43
+ term-ansicolor
44
+ thor
39
45
  devise (3.2.2)
40
46
  bcrypt-ruby (~> 3.0)
41
47
  orm_adapter (~> 0.1)
42
48
  railties (>= 3.2.6, < 5)
43
49
  thread_safe (~> 0.1)
44
50
  warden (~> 1.2.3)
51
+ docile (1.1.1)
45
52
  erubis (2.7.0)
46
53
  hike (1.2.3)
47
54
  i18n (0.6.9)
@@ -74,6 +81,13 @@ GEM
74
81
  thor (>= 0.18.1, < 2.0)
75
82
  rake (10.1.1)
76
83
  redis (3.0.6)
84
+ rest-client (1.6.7)
85
+ mime-types (>= 1.16)
86
+ simplecov (0.8.2)
87
+ docile (~> 1.1.0)
88
+ multi_json
89
+ simplecov-html (~> 0.8.0)
90
+ simplecov-html (0.8.0)
77
91
  sprockets (2.10.1)
78
92
  hike (~> 1.2)
79
93
  multi_json (~> 1.0)
@@ -84,10 +98,13 @@ GEM
84
98
  activesupport (>= 3.0)
85
99
  sprockets (~> 2.8)
86
100
  sqlite3 (1.3.8)
101
+ term-ansicolor (1.2.2)
102
+ tins (~> 0.8)
87
103
  thor (0.18.1)
88
104
  thread_safe (0.1.3)
89
105
  atomic
90
106
  tilt (1.4.1)
107
+ tins (0.13.1)
91
108
  treetop (1.4.15)
92
109
  polyglot
93
110
  polyglot (>= 0.3.1)
@@ -100,6 +117,7 @@ PLATFORMS
100
117
 
101
118
  DEPENDENCIES
102
119
  bundler (~> 1.3)
120
+ coveralls
103
121
  devise_ott!
104
122
  minitest-rails
105
123
  rails
data/README.rdoc CHANGED
@@ -1,6 +1,7 @@
1
1
  # DeviseOtt
2
2
 
3
3
  {<img src="https://travis-ci.org/igagnidz/devise_ott.png" />}[https://travis-ci.org/igagnidz/devise_ott]
4
+ {<img src="https://coveralls.io/repos/igagnidz/devise_ott/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/igagnidz/devise_ott]
4
5
  {<img src="https://codeclimate.com/github/igagnidz/devise_ott.png" />}[https://codeclimate.com/github/igagnidz/devise_ott]
5
6
  {<img src="http://badge.fury.io/rb/devise_ott.png" />}[http://badge.fury.io/rb/devise_ott]
6
7
  {<img src="https://gemnasium.com/igagnidz/devise_ott.png" alt="Dependency Status" />}[https://gemnasium.com/igagnidz/devise_ott]
@@ -23,4 +24,8 @@ Add :ott_authentication to your model
23
24
 
24
25
  ## Usage
25
26
 
26
- TODO: Write usage instructions here
27
+ Programatically register token for a given user:
28
+ DeviseOtt::Tokens.instance.register('random_token', 'user@email.com', COUNT, EXPIRES_SECONDS) # COUNT and EXPIRES_SECONDS are integers
29
+
30
+ Login using One-Time Token:
31
+ include ott_token following parameter in the URL. Example: localhost:3000/?ott_token=random_token
data/devise_ott.gemspec CHANGED
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'rails'
27
27
  spec.add_development_dependency 'minitest-rails'
28
28
  spec.add_development_dependency 'sqlite3'
29
+ spec.add_development_dependency 'coveralls'
29
30
  end
data/lib/devise_ott.rb CHANGED
@@ -1,6 +1,18 @@
1
+ require 'devise'
1
2
  require_relative 'devise_ott/version'
2
3
  require_relative 'devise_ott/tokens'
3
- require_relative 'devise'
4
+ require_relative 'devise_ott/models'
5
+ require_relative 'devise_ott/strategies'
6
+
7
+ module Devise
8
+ # Ott redis host
9
+ # defaults to localhost
10
+ mattr_accessor :ott_redis_host
11
+ @@ott_redis_host = 'localhost'
12
+ end
4
13
 
5
14
  module DeviseOtt
6
- end
15
+ end
16
+
17
+ Warden::Strategies.add(:ott_authentication, DeviseOtt::Strategies::OttAuthentication)
18
+ Devise.add_module :ott_authentication, :strategy => true, :model => 'devise_ott/models/ott_authentication'
@@ -1,7 +1,6 @@
1
1
  require_relative 'models/ott_authentication'
2
2
 
3
- module Devise
3
+ module DeviseOtt
4
4
  module Models
5
-
6
5
  end
7
6
  end
@@ -0,0 +1,6 @@
1
+ require_relative 'strategies/ott_authetication'
2
+
3
+ module DeviseOtt
4
+ module Strategies
5
+ end
6
+ end
@@ -1,6 +1,6 @@
1
- module Devise
1
+ module DeviseOtt
2
2
  module Strategies
3
- class Ott < Devise::Strategies::Authenticatable
3
+ class OttAuthentication < Devise::Strategies::Authenticatable
4
4
  def valid?
5
5
  super || valid_for_ott_auth?
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseOtt
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/test/test_helper.rb CHANGED
@@ -6,10 +6,11 @@ TEST_ROOT = File.expand_path('../', __FILE__)
6
6
 
7
7
  require 'rails/all'
8
8
  require 'devise'
9
- require 'devise_ott'
10
9
  require 'rails/test_help'
11
10
  require 'minitest/rails'
11
+ require 'coveralls'
12
+ Coveralls.wear!
13
+ require 'devise_ott'
12
14
  require 'rails_app/config/environment'
13
15
 
14
-
15
16
  Dir[File.join(TEST_ROOT, 'support/*.rb')].each{ |f| require f }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_ott
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iuri Gagnidze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-02 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: coveralls
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: Adds one time token authentication to devise
112
126
  email:
113
127
  - igagnidz@gmail.com
@@ -125,12 +139,11 @@ files:
125
139
  - README.rdoc
126
140
  - Rakefile
127
141
  - devise_ott.gemspec
128
- - lib/devise.rb
129
- - lib/devise/models.rb
130
- - lib/devise/models/ott_authentication.rb
131
- - lib/devise/strategies.rb
132
- - lib/devise/strategies/ott.rb
133
142
  - lib/devise_ott.rb
143
+ - lib/devise_ott/models.rb
144
+ - lib/devise_ott/models/ott_authentication.rb
145
+ - lib/devise_ott/strategies.rb
146
+ - lib/devise_ott/strategies/ott_authetication.rb
134
147
  - lib/devise_ott/tokens.rb
135
148
  - lib/devise_ott/version.rb
136
149
  - test/devise_ott_test.rb
data/lib/devise.rb DELETED
@@ -1,9 +0,0 @@
1
- require_relative 'devise/models'
2
- require_relative 'devise/strategies'
3
-
4
- module Devise
5
- # Ott redis host
6
- # defaults to localhost
7
- mattr_accessor :ott_redis_host
8
- @@ott_redis_host = 'localhost'
9
- end
@@ -1,5 +0,0 @@
1
- require_relative 'strategies/ott'
2
- module Devise
3
- module Strategies
4
- end
5
- end