omniauth-realgravity 0.1.0
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 +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +49 -0
- data/README.md +1 -0
- data/Rakefile +6 -0
- data/lib/omniauth/realgravity/version.rb +5 -0
- data/lib/omniauth/realgravity.rb +2 -0
- data/lib/omniauth/strategies/realgravity.rb +34 -0
- data/lib/omniauth-realgravity.rb +1 -0
- data/omniauth-realgravity.gemspec +25 -0
- data/spec/omniauth/strategies/realgravity_spec.rb +30 -0
- data/spec/spec_helper.rb +6 -0
- metadata +114 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bf5ceb87d155030e0d7a288e8b7538b1cb63af33
|
4
|
+
data.tar.gz: 4d10e8cf7c72c4d1283c28425253246f20decb9c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2b46690f7b631dc76b10ff2f26197b04698aa235c06172b233eaf767e30e88ae9a2491d16d53fdf08098f93df2703079a2ad1b61ce67ab851067a2d4914813ad
|
7
|
+
data.tar.gz: 8104ea5f29bcea8eb2da6560b91f4fb6b0cbd9d3330ae51c0c3ecb089a4e02dfc21b17fdb031179b17269d3463d1d6ddb26fb748a5db1f94cab84f5213fb0c56
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
omniauth-realgravity (0.1.0)
|
5
|
+
omniauth (~> 1.1.4)
|
6
|
+
omniauth-oauth2 (~> 1.1.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
diff-lcs (1.2.4)
|
12
|
+
faraday (0.8.8)
|
13
|
+
multipart-post (~> 1.2.0)
|
14
|
+
hashie (2.0.5)
|
15
|
+
httpauth (0.2.0)
|
16
|
+
jwt (0.1.8)
|
17
|
+
multi_json (>= 1.5)
|
18
|
+
multi_json (1.8.0)
|
19
|
+
multipart-post (1.2.0)
|
20
|
+
oauth2 (0.8.1)
|
21
|
+
faraday (~> 0.8)
|
22
|
+
httpauth (~> 0.1)
|
23
|
+
jwt (~> 0.1.4)
|
24
|
+
multi_json (~> 1.0)
|
25
|
+
rack (~> 1.2)
|
26
|
+
omniauth (1.1.4)
|
27
|
+
hashie (>= 1.2, < 3)
|
28
|
+
rack
|
29
|
+
omniauth-oauth2 (1.1.1)
|
30
|
+
oauth2 (~> 0.8.0)
|
31
|
+
omniauth (~> 1.0)
|
32
|
+
rack (1.5.2)
|
33
|
+
rake (10.0.4)
|
34
|
+
rspec (2.13.0)
|
35
|
+
rspec-core (~> 2.13.0)
|
36
|
+
rspec-expectations (~> 2.13.0)
|
37
|
+
rspec-mocks (~> 2.13.0)
|
38
|
+
rspec-core (2.13.1)
|
39
|
+
rspec-expectations (2.13.0)
|
40
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
41
|
+
rspec-mocks (2.13.1)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
ruby
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
omniauth-realgravity!
|
48
|
+
rake (~> 10.0.4)
|
49
|
+
rspec (~> 2.13.0)
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# OmniAuth RealGravity
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'omniauth/strategies/oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class RealGravity < OmniAuth::Strategies::OAuth2
|
6
|
+
|
7
|
+
option :name, :realgravity
|
8
|
+
|
9
|
+
option :client_options, {
|
10
|
+
site: 'http://api.realgravity.com',
|
11
|
+
authorize_url: '/oauth/authorize',
|
12
|
+
}
|
13
|
+
|
14
|
+
uid { raw_info['id'] }
|
15
|
+
|
16
|
+
info do
|
17
|
+
{
|
18
|
+
name: raw_info['name'],
|
19
|
+
email: raw_info['email'],
|
20
|
+
network_id: raw_info['network_id'],
|
21
|
+
company_id: raw_info['company_id'],
|
22
|
+
roles: raw_info['roles'],
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def raw_info
|
27
|
+
@raw_info ||= access_token.get('/api/v2/me.json').parsed
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
OmniAuth.config.add_camelization 'realgravity', 'RealGravity'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'omniauth/realgravity'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'omniauth/realgravity/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'omniauth-realgravity'
|
7
|
+
s.version = OmniAuth::RealGravity::VERSION
|
8
|
+
s.authors = ['Chris Caselas']
|
9
|
+
s.email = ['support@realgravity.com']
|
10
|
+
s.description = 'RealGravity strategy for OmniAuth to provide OAuth2 access.'
|
11
|
+
s.summary = 'RealGravity strategy for OmniAuth'
|
12
|
+
s.homepage = 'https://github.com/realgravity/omniauth-realgravity'
|
13
|
+
s.license = 'MIT'
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
18
|
+
s.require_paths = ['lib']
|
19
|
+
|
20
|
+
s.add_dependency 'omniauth', '~> 1.1.4'
|
21
|
+
s.add_dependency 'omniauth-oauth2', '~> 1.1.1'
|
22
|
+
|
23
|
+
s.add_development_dependency 'rspec', '~> 2.13.0'
|
24
|
+
s.add_development_dependency 'rake', '~> 10.0.4'
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'omniauth-realgravity'
|
3
|
+
|
4
|
+
describe OmniAuth::Strategies::RealGravity do
|
5
|
+
let(:request) do
|
6
|
+
double('request', params: {}, cookies: {}, env: {})
|
7
|
+
end
|
8
|
+
|
9
|
+
subject do
|
10
|
+
OmniAuth::Strategies::RealGravity.new(nil, @options || {}).tap do |strategy|
|
11
|
+
strategy.stub(request: request)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#client' do
|
16
|
+
it 'should have the correct RealGravity site' do
|
17
|
+
subject.client.site.should eq("http://api.realgravity.com")
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should have the correct authorization url' do
|
21
|
+
subject.client.options[:authorize_url].should eq("/oauth/authorize")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '#callback_path' do
|
26
|
+
it 'should have the correct callback path' do
|
27
|
+
subject.callback_path.should eq('/auth/realgravity/callback')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-realgravity
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Caselas
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: omniauth-oauth2
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.1.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.1.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.13.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.13.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 10.0.4
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 10.0.4
|
69
|
+
description: RealGravity strategy for OmniAuth to provide OAuth2 access.
|
70
|
+
email:
|
71
|
+
- support@realgravity.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- Gemfile
|
77
|
+
- Gemfile.lock
|
78
|
+
- README.md
|
79
|
+
- Rakefile
|
80
|
+
- lib/omniauth-realgravity.rb
|
81
|
+
- lib/omniauth/realgravity.rb
|
82
|
+
- lib/omniauth/realgravity/version.rb
|
83
|
+
- lib/omniauth/strategies/realgravity.rb
|
84
|
+
- omniauth-realgravity.gemspec
|
85
|
+
- spec/omniauth/strategies/realgravity_spec.rb
|
86
|
+
- spec/spec_helper.rb
|
87
|
+
homepage: https://github.com/realgravity/omniauth-realgravity
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.1.4
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: RealGravity strategy for OmniAuth
|
111
|
+
test_files:
|
112
|
+
- spec/omniauth/strategies/realgravity_spec.rb
|
113
|
+
- spec/spec_helper.rb
|
114
|
+
has_rdoc:
|