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 +4 -4
- data/.travis.yml +2 -1
- data/Gemfile.lock +18 -0
- data/README.rdoc +6 -1
- data/devise_ott.gemspec +1 -0
- data/lib/devise_ott.rb +14 -2
- data/lib/{devise → devise_ott}/models.rb +1 -2
- data/lib/{devise → devise_ott}/models/ott_authentication.rb +0 -0
- data/lib/devise_ott/strategies.rb +6 -0
- data/lib/{devise/strategies/ott.rb → devise_ott/strategies/ott_authetication.rb} +2 -2
- data/lib/devise_ott/version.rb +1 -1
- data/test/test_helper.rb +3 -2
- metadata +20 -7
- data/lib/devise.rb +0 -9
- data/lib/devise/strategies.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aed49018c61ba2d240337012f4cd2efaea8d736
|
4
|
+
data.tar.gz: fafef4d619522ffb6387743e5a4f7b249eca425c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 204622c6def2426ddd247bbd42c70f0b3386c5b218bbac4ffd42a623935be1e007bd9a4f117e7a1935f7fa4f9c53c4d61733efb641c741fcee108444b5a80d98
|
7
|
+
data.tar.gz: 8a3409786a9496a9c5b48d5306eb6e3517e53e71b64277599b541372b51300b8e9d5a48d0038b3c94c8c90fc8c909bd138a4d15e17e3aebf82b23fe8b5379e15
|
data/.travis.yml
CHANGED
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
|
-
|
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
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 '
|
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'
|
File without changes
|
data/lib/devise_ott/version.rb
CHANGED
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.
|
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-
|
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