userbin 0.4.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +87 -111
- data/lib/userbin.rb +18 -39
- data/lib/userbin/configuration.rb +14 -16
- data/lib/userbin/errors.rb +5 -0
- data/lib/userbin/helpers.rb +83 -0
- data/lib/userbin/jwt.rb +40 -0
- data/lib/userbin/models/base.rb +24 -0
- data/lib/userbin/models/challenge.rb +4 -0
- data/lib/userbin/models/session.rb +11 -0
- data/lib/userbin/models/user.rb +9 -0
- data/lib/userbin/request.rb +99 -0
- data/lib/userbin/utils.rb +28 -0
- data/lib/userbin/version.rb +1 -1
- data/spec/configuration_spec.rb +8 -0
- data/spec/fixtures/vcr_cassettes/session_create.yml +47 -0
- data/spec/fixtures/vcr_cassettes/session_refresh.yml +47 -0
- data/spec/fixtures/vcr_cassettes/session_verify.yml +47 -0
- data/spec/fixtures/vcr_cassettes/user_find.yml +44 -0
- data/spec/fixtures/vcr_cassettes/user_find_non_existing.yml +42 -0
- data/spec/fixtures/vcr_cassettes/user_import.yml +46 -0
- data/spec/fixtures/vcr_cassettes/user_update.yml +47 -0
- data/spec/helpers_spec.rb +38 -0
- data/spec/jwt_spec.rb +67 -0
- data/spec/models/session_spec.rb +33 -0
- data/spec/models/user_spec.rb +43 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/utils_spec.rb +36 -0
- metadata +128 -36
- data/lib/userbin/authentication.rb +0 -132
- data/lib/userbin/basic_auth.rb +0 -31
- data/lib/userbin/current.rb +0 -17
- data/lib/userbin/events.rb +0 -40
- data/lib/userbin/rails/auth_helpers.rb +0 -22
- data/lib/userbin/railtie.rb +0 -14
- data/lib/userbin/session.rb +0 -26
- data/lib/userbin/userbin.rb +0 -104
- data/spec/session_spec.rb +0 -40
- data/spec/userbin_spec.rb +0 -102
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://secretkey:@secure.userbin.com/v1/users/import
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"users":[{"email":"10@example.com","username":"10"},{"email":"20@example.com","username":"20"}]}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- '*/*'
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 201
|
21
|
+
message: Created
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Thu, 24 Apr 2014 16:19:14 GMT
|
25
|
+
Status:
|
26
|
+
- 201 Created
|
27
|
+
Connection:
|
28
|
+
- close
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Content-Length:
|
32
|
+
- '85'
|
33
|
+
Set-Cookie:
|
34
|
+
- _ubt=; expires=Thu, 01-Jan-1970 00:00:00 GMT
|
35
|
+
X-Ua-Compatible:
|
36
|
+
- IE=Edge
|
37
|
+
Etag:
|
38
|
+
- '"e6928187afa7cffb7f793a998b7a1c91"'
|
39
|
+
Cache-Control:
|
40
|
+
- max-age=0, private, must-revalidate
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '[{"id":"fqnvfRSmxa6wqx3c6xmzDqDZrJCvtZ5P"},{"id":"4n9pcvrCSig2iVcZbk7pAMsjngzX9fgv"}]'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Thu, 24 Apr 2014 16:19:14 GMT
|
46
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://secretkey:@secure.userbin.com/v1/users/AKfwtfrAzdDKp55aty8o14MoudkaS9BL
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"id":"AKfwtfrAzdDKp55aty8o14MoudkaS9BL","email":"updated@example.com","created_at":"2014-04-27
|
9
|
+
22:10:22 +0200"}'
|
10
|
+
headers:
|
11
|
+
User-Agent:
|
12
|
+
- Faraday v0.9.0
|
13
|
+
Content-Type:
|
14
|
+
- application/json
|
15
|
+
Accept-Encoding:
|
16
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
17
|
+
Accept:
|
18
|
+
- '*/*'
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 200
|
22
|
+
message: OK
|
23
|
+
headers:
|
24
|
+
Date:
|
25
|
+
- Sun, 27 Apr 2014 20:10:22 GMT
|
26
|
+
Status:
|
27
|
+
- 200 OK
|
28
|
+
Connection:
|
29
|
+
- close
|
30
|
+
Content-Type:
|
31
|
+
- application/json
|
32
|
+
Content-Length:
|
33
|
+
- '252'
|
34
|
+
Set-Cookie:
|
35
|
+
- _ubt=; expires=Thu, 01-Jan-1970 00:00:00 GMT
|
36
|
+
X-Ua-Compatible:
|
37
|
+
- IE=Edge
|
38
|
+
Etag:
|
39
|
+
- '"de56261eb3d3bef170cc8e837af079fd"'
|
40
|
+
Cache-Control:
|
41
|
+
- max-age=0, private, must-revalidate
|
42
|
+
body:
|
43
|
+
encoding: UTF-8
|
44
|
+
string: '{"id":"AKfwtfrAzdDKp55aty8o14MoudkaS9BL","created_at":"2014-04-27T20:10:22Z","updated_at":"2014-04-27T20:10:22Z","email":"updated@example.com","username":"updated@example.com","name":null,"first_name":null,"last_name":null,"image":null,"status":"ACTIVE","identities":[]}'
|
45
|
+
http_version:
|
46
|
+
recorded_at: Sun, 27 Apr 2014 20:10:22 GMT
|
47
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Userbin helpers' do
|
4
|
+
let(:token) { 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImlhdCI6MTM5ODIzOTIwMywiZXhwIjoxMzk4MjQyODAzfQ.eyJ1c2VyX2lkIjoiZUF3djVIdGRiU2s4Yk1OWVpvanNZdW13UXlLcFhxS3IifQ.Apa7EmT5T1sOYz4Af0ERTDzcnUvSalailNJbejZ2ddQ' }
|
5
|
+
|
6
|
+
it 'creates a session' do
|
7
|
+
Userbin::Session.should_receive(:post).
|
8
|
+
with("users/user%201234/sessions", user: {email: 'valid@example.com'}).
|
9
|
+
and_return(Userbin::Session.new(token: token))
|
10
|
+
Userbin.authenticate(nil, 'user 1234', properties: {email: 'valid@example.com'})
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'refreshes, and does not create a session' do
|
14
|
+
Userbin::Session.should_not_receive(:create)
|
15
|
+
Userbin::Session.any_instance.should_receive(:refresh).
|
16
|
+
and_return(Userbin::Session.new(token: token))
|
17
|
+
opts = {
|
18
|
+
user_id: '1234',
|
19
|
+
properties: {
|
20
|
+
email: 'valid@example.com'
|
21
|
+
},
|
22
|
+
context: {
|
23
|
+
ip: '8.8.8.8',
|
24
|
+
user_agent: 'Mozilla'
|
25
|
+
}
|
26
|
+
}
|
27
|
+
Userbin.authenticate(token, opts)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'deauthenticates with context' do
|
31
|
+
Userbin::Session.should_receive(:destroy_existing)
|
32
|
+
|
33
|
+
jwt = Userbin::JWT.new(token)
|
34
|
+
jwt.merge!(context: { ip: '8.8.8.8', user_agent: 'Mozilla' })
|
35
|
+
|
36
|
+
Userbin.deauthenticate(jwt.to_token)
|
37
|
+
end
|
38
|
+
end
|
data/spec/jwt_spec.rb
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'timecop'
|
3
|
+
|
4
|
+
describe 'Userbin::JWT' do
|
5
|
+
let(:token) { 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImlhdCI6MTM5ODIzOTIwMywiZXhwIjoxMzk4MjQyODAzfQ.eyJ1c2VyX2lkIjoiZUF3djVIdGRiU2s4Yk1OWVpvanNZdW13UXlLcFhxS3IifQ.Apa7EmT5T1sOYz4Af0ERTDzcnUvSalailNJbejZ2ddQ' }
|
6
|
+
|
7
|
+
context 'valid JWT' do
|
8
|
+
it 'returns a payload' do
|
9
|
+
payload = Userbin::JWT.new(token).to_json
|
10
|
+
payload['user_id'].should == 'eAwv5HtdbSk8bMNYZojsYumwQyKpXqKr'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'verifies that JWT has expired' do
|
14
|
+
new_time = Time.utc(2014, 4, 23, 8, 46, 44)
|
15
|
+
Timecop.freeze(new_time) do
|
16
|
+
Userbin::JWT.new(token).expired?.should be_true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'verifies that JWT has not expired' do
|
21
|
+
new_time = Time.utc(2014, 4, 23, 8, 46, 43)
|
22
|
+
Timecop.freeze(new_time) do
|
23
|
+
Userbin::JWT.new(token).expired?.should be_false
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'invalid JWT' do
|
29
|
+
let(:token) { 'eyJ0eXhtWWNTU3pEUHp6WFF2WmZp26mn7Kkl6UgE' }
|
30
|
+
|
31
|
+
it 'throws error' do
|
32
|
+
expect {
|
33
|
+
payload = Userbin::JWT.new(token).to_json
|
34
|
+
}.to raise_error(Userbin::SecurityError)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'nil JWT' do
|
39
|
+
let(:token) { nil }
|
40
|
+
|
41
|
+
it 'throws error' do
|
42
|
+
token = nil
|
43
|
+
expect {
|
44
|
+
payload = Userbin::JWT.new(token).to_json
|
45
|
+
}.to raise_error(Userbin::SecurityError)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context '#to_token' do
|
50
|
+
it 'returns the same token' do
|
51
|
+
Userbin::JWT.new(token).to_token.should == token
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context '#merge' do
|
56
|
+
it 'merges payload' do
|
57
|
+
jwt = Userbin::JWT.new(token)
|
58
|
+
jwt.merge!(context: { ip: '8.8.8.8' })
|
59
|
+
|
60
|
+
merged_token = jwt.to_token
|
61
|
+
merged_token.should_not == token
|
62
|
+
Userbin::JWT.new(merged_token).
|
63
|
+
to_json['context']['ip'].should == '8.8.8.8'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Userbin::Session' do
|
4
|
+
|
5
|
+
let(:session_token) { 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImlzcyI6InVzZXItMjQxMiIsInN1YiI6IlMyb2R4UmVabkdxaHF4UGFRN1Y3a05rTG9Ya0daUEZ6IiwiYXVkIjoiODAwMDAwMDAwMDAwMDAwIiwiZXhwIjoxMzk5NDc5Njc1LCJpYXQiOjEzOTk0Nzk2NjUsImp0aSI6MH0.eyJjaGFsbGVuZ2UiOnsiaWQiOiJUVENqd3VyM3lwbTRUR1ZwWU43cENzTXFxOW9mWEVBSCIsInR5cGUiOiJvdHBfYXV0aGVudGljYXRvciJ9fQ.LT9mUzJEbsizbFxcpMo3zbms0aCDBzfgMbveMGSi1-s' }
|
6
|
+
|
7
|
+
it 'creates a session' do
|
8
|
+
VCR.use_cassette('session_create') do
|
9
|
+
user_id = 'user-2412'
|
10
|
+
session = Userbin::Session.post(
|
11
|
+
"users/#{user_id}/sessions", user: {email: 'valid@example.com'})
|
12
|
+
Userbin::JWT.new(session.token).header['iss'].should == user_id
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'refreshes a session' do
|
17
|
+
VCR.use_cassette('session_refresh') do
|
18
|
+
session = Userbin::Session.new(token: session_token)
|
19
|
+
session = session.refresh(user: {name: 'New Name'})
|
20
|
+
|
21
|
+
session.token.should_not == session_token
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'verifies a session' do
|
26
|
+
VCR.use_cassette('session_verify') do
|
27
|
+
Userbin::JWT.new(session_token).payload['challenge'].should_not be_nil
|
28
|
+
session = Userbin::Session.new(token: session_token)
|
29
|
+
session = session.verify(response: '017010')
|
30
|
+
Userbin::JWT.new(session.token).payload['challenge'].should be_nil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Userbin::User' do
|
4
|
+
it 'retrieves a user' do
|
5
|
+
VCR.use_cassette('user_find') do
|
6
|
+
user = Userbin::User.find('9RA2j3cYDxt8gefQUduKnxUxRRGy6Rz4')
|
7
|
+
user.email.should == 'brissmyr@gmail.com'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'handles non-existing user' do
|
12
|
+
VCR.use_cassette('user_find_non_existing') do
|
13
|
+
error = nil
|
14
|
+
begin
|
15
|
+
user = Userbin::User.find('non_existing')
|
16
|
+
rescue Userbin::Error => e
|
17
|
+
error = e
|
18
|
+
end
|
19
|
+
error.to_s.should match /Not found/
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'updates a user' do
|
24
|
+
VCR.use_cassette('user_update') do
|
25
|
+
user = Userbin::User.new(id: 'AKfwtfrAzdDKp55aty8o14MoudkaS9BL')
|
26
|
+
user.email = 'updated@example.com'
|
27
|
+
user.created_at = Time.now
|
28
|
+
user.save
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'imports users' do
|
33
|
+
VCR.use_cassette('user_import') do
|
34
|
+
users = Userbin::User.import(
|
35
|
+
users: [
|
36
|
+
{ email: '10@example.com', username: '10' },
|
37
|
+
{ email: '20@example.com', username: '20' }
|
38
|
+
]
|
39
|
+
)
|
40
|
+
users.count.should == 2
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,18 @@ require 'rubygems'
|
|
2
2
|
require 'bundler/setup'
|
3
3
|
require 'rack'
|
4
4
|
require 'userbin'
|
5
|
+
require 'vcr'
|
5
6
|
require 'webmock/rspec'
|
7
|
+
require 'pry'
|
8
|
+
|
9
|
+
VCR.configure do |config|
|
10
|
+
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
11
|
+
config.hook_into :webmock
|
12
|
+
end
|
13
|
+
|
14
|
+
Userbin.configure do |config|
|
15
|
+
config.api_secret = 'secretkey'
|
16
|
+
end
|
6
17
|
|
7
18
|
RSpec.configure do |config|
|
8
19
|
end
|
data/spec/utils_spec.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Userbin utils' do
|
4
|
+
describe 'ContextHeaders middleware' do
|
5
|
+
before do
|
6
|
+
Userbin::User.use_api(api = Her::API.new)
|
7
|
+
@user = api.setup do |c|
|
8
|
+
c.use Userbin::Request::Middleware::ContextHeaders
|
9
|
+
c.use Her::Middleware::FirstLevelParseJSON
|
10
|
+
c.adapter :test do |stub|
|
11
|
+
stub.post('/users') do |env|
|
12
|
+
@env = env
|
13
|
+
[200, {}, [].to_json]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
let(:env) do
|
20
|
+
Rack::MockRequest.env_for('/',
|
21
|
+
"HTTP_USER_AGENT" => "Mozilla", "REMOTE_ADDR" => "8.8.8.8")
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'handles non-existing context headers' do
|
25
|
+
Userbin::User.create()
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'sets context headers from env' do
|
29
|
+
Userbin.with_context(ip: '8.8.8.8', user_agent: 'Mozilla') do
|
30
|
+
Userbin::User.create()
|
31
|
+
@env['request_headers']['X-Userbin-Ip'].should == '8.8.8.8'
|
32
|
+
@env['request_headers']['X-Userbin-User-Agent'].should == 'Mozilla'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,122 +1,203 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: userbin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: her
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.6.8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.6.8
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.9.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.9.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: multi_json
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - ~>
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '1.0'
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - ~>
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '1.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: jwt
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.1.11
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.1.11
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: request_store
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.0.5
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.5
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
46
88
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
89
|
+
version: '3'
|
48
90
|
type: :runtime
|
49
91
|
prerelease: false
|
50
92
|
version_requirements: !ruby/object:Gem::Requirement
|
51
93
|
requirements:
|
52
|
-
- -
|
94
|
+
- - ">="
|
53
95
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
96
|
+
version: '3'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: rspec
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
58
100
|
requirements:
|
59
|
-
- -
|
101
|
+
- - ">="
|
60
102
|
- !ruby/object:Gem::Version
|
61
103
|
version: '0'
|
62
104
|
type: :development
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
|
-
- -
|
108
|
+
- - ">="
|
67
109
|
- !ruby/object:Gem::Version
|
68
110
|
version: '0'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: rack
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
|
-
- -
|
115
|
+
- - ">="
|
74
116
|
- !ruby/object:Gem::Version
|
75
117
|
version: '0'
|
76
118
|
type: :development
|
77
119
|
prerelease: false
|
78
120
|
version_requirements: !ruby/object:Gem::Requirement
|
79
121
|
requirements:
|
80
|
-
- -
|
122
|
+
- - ">="
|
81
123
|
- !ruby/object:Gem::Version
|
82
124
|
version: '0'
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
126
|
name: webmock
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
|
-
- -
|
129
|
+
- - ">="
|
88
130
|
- !ruby/object:Gem::Version
|
89
131
|
version: '0'
|
90
132
|
type: :development
|
91
133
|
prerelease: false
|
92
134
|
version_requirements: !ruby/object:Gem::Requirement
|
93
135
|
requirements:
|
94
|
-
- -
|
136
|
+
- - ">="
|
95
137
|
- !ruby/object:Gem::Version
|
96
138
|
version: '0'
|
97
|
-
|
98
|
-
|
99
|
-
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: vcr
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: timecop
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: Secure your application with multi-factor authentication, user activity
|
168
|
+
monitoring, and real-time threat protection.
|
100
169
|
email: johan@userbin.com
|
101
170
|
executables: []
|
102
171
|
extensions: []
|
103
172
|
extra_rdoc_files: []
|
104
173
|
files:
|
105
|
-
-
|
106
|
-
- lib/userbin
|
174
|
+
- README.md
|
175
|
+
- lib/userbin.rb
|
107
176
|
- lib/userbin/configuration.rb
|
108
|
-
- lib/userbin/
|
109
|
-
- lib/userbin/
|
110
|
-
- lib/userbin/
|
111
|
-
- lib/userbin/
|
112
|
-
- lib/userbin/
|
113
|
-
- lib/userbin/
|
177
|
+
- lib/userbin/errors.rb
|
178
|
+
- lib/userbin/helpers.rb
|
179
|
+
- lib/userbin/jwt.rb
|
180
|
+
- lib/userbin/models/base.rb
|
181
|
+
- lib/userbin/models/challenge.rb
|
182
|
+
- lib/userbin/models/session.rb
|
183
|
+
- lib/userbin/models/user.rb
|
184
|
+
- lib/userbin/request.rb
|
185
|
+
- lib/userbin/utils.rb
|
114
186
|
- lib/userbin/version.rb
|
115
|
-
-
|
116
|
-
-
|
117
|
-
- spec/
|
187
|
+
- spec/configuration_spec.rb
|
188
|
+
- spec/fixtures/vcr_cassettes/session_create.yml
|
189
|
+
- spec/fixtures/vcr_cassettes/session_refresh.yml
|
190
|
+
- spec/fixtures/vcr_cassettes/session_verify.yml
|
191
|
+
- spec/fixtures/vcr_cassettes/user_find.yml
|
192
|
+
- spec/fixtures/vcr_cassettes/user_find_non_existing.yml
|
193
|
+
- spec/fixtures/vcr_cassettes/user_import.yml
|
194
|
+
- spec/fixtures/vcr_cassettes/user_update.yml
|
195
|
+
- spec/helpers_spec.rb
|
196
|
+
- spec/jwt_spec.rb
|
197
|
+
- spec/models/session_spec.rb
|
198
|
+
- spec/models/user_spec.rb
|
118
199
|
- spec/spec_helper.rb
|
119
|
-
- spec/
|
200
|
+
- spec/utils_spec.rb
|
120
201
|
homepage: https://userbin.com
|
121
202
|
licenses:
|
122
203
|
- MIT
|
@@ -127,21 +208,32 @@ require_paths:
|
|
127
208
|
- lib
|
128
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
129
210
|
requirements:
|
130
|
-
- -
|
211
|
+
- - ">="
|
131
212
|
- !ruby/object:Gem::Version
|
132
213
|
version: '0'
|
133
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
215
|
requirements:
|
135
|
-
- -
|
216
|
+
- - ">="
|
136
217
|
- !ruby/object:Gem::Version
|
137
218
|
version: '0'
|
138
219
|
requirements: []
|
139
220
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.2.2
|
141
222
|
signing_key:
|
142
223
|
specification_version: 4
|
143
224
|
summary: Userbin
|
144
225
|
test_files:
|
145
|
-
- spec/
|
226
|
+
- spec/configuration_spec.rb
|
227
|
+
- spec/fixtures/vcr_cassettes/session_create.yml
|
228
|
+
- spec/fixtures/vcr_cassettes/session_refresh.yml
|
229
|
+
- spec/fixtures/vcr_cassettes/session_verify.yml
|
230
|
+
- spec/fixtures/vcr_cassettes/user_find.yml
|
231
|
+
- spec/fixtures/vcr_cassettes/user_find_non_existing.yml
|
232
|
+
- spec/fixtures/vcr_cassettes/user_import.yml
|
233
|
+
- spec/fixtures/vcr_cassettes/user_update.yml
|
234
|
+
- spec/helpers_spec.rb
|
235
|
+
- spec/jwt_spec.rb
|
236
|
+
- spec/models/session_spec.rb
|
237
|
+
- spec/models/user_spec.rb
|
146
238
|
- spec/spec_helper.rb
|
147
|
-
- spec/
|
239
|
+
- spec/utils_spec.rb
|