omniauth-cube7 0.0.3 → 0.0.4
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/lib/omniauth-cube7.rb +0 -1
- data/lib/omniauth/cube7/version.rb +1 -1
- data/lib/omniauth/strategies/cube7.rb +5 -5
- data/tests/cube7_test.rb +2 -2
- metadata +18 -19
- data/lib/omniauth/cube7/configuration.rb +0 -45
- data/tests/configuration_test.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56d33383a111384f96cd475722a6cf5f7bb37211
|
4
|
+
data.tar.gz: 8ee6fd15e9ed2a00cf6155d906feb5cd4a098bb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46e75974e5322f12a4cfea344e266cd2873e9301d67804d169fb5a68737bac3f86fb818272e7635a81de0126ed086e6c1b341d5adc58a6cdfd6599a925ef65b7
|
7
|
+
data.tar.gz: 5110024b3672e3e4f9e660584d369aafb79203aa2700b803af9f4454253047be0d08e77670896e9f7df31ca7184d6d5f838b49793f5e7f629292d1a269bb3a08
|
data/lib/omniauth-cube7.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require "omniauth/cube7/configuration"
|
2
1
|
require 'omniauth/strategies/oauth2'
|
3
2
|
|
4
3
|
module OmniAuth
|
@@ -6,6 +5,11 @@ module OmniAuth
|
|
6
5
|
class Cube7 < OmniAuth::Strategies::OAuth2
|
7
6
|
# change the class name and the :name option to match your application name
|
8
7
|
option :name, :cube7
|
8
|
+
|
9
|
+
option :client_options, {
|
10
|
+
:site => "https://www.cube7.com",
|
11
|
+
:authorize_url => "/oauth/authorize"
|
12
|
+
}
|
9
13
|
|
10
14
|
uid { raw_info["id"] }
|
11
15
|
|
@@ -23,10 +27,6 @@ module OmniAuth
|
|
23
27
|
{ :raw_info => raw_info }
|
24
28
|
end
|
25
29
|
|
26
|
-
def client
|
27
|
-
::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(Omniauth::Cube7.configuration.client_options))
|
28
|
-
end
|
29
|
-
|
30
30
|
def raw_info
|
31
31
|
@raw_info ||= access_token.get('/api/me.json').parsed
|
32
32
|
end
|
data/tests/cube7_test.rb
CHANGED
@@ -8,8 +8,8 @@ class StrategyTest < StrategyTestCase
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class ClientTest < StrategyTestCase
|
11
|
-
test 'has correct
|
12
|
-
assert_equal '
|
11
|
+
test 'has correct baio site' do
|
12
|
+
assert_equal 'https://www.cube7.com', strategy.client.site
|
13
13
|
end
|
14
14
|
|
15
15
|
test 'has correct authorize url' do
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-cube7
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.1.1
|
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: 1.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mocha
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: Cube7 strategy for Omniauth
|
@@ -87,19 +87,17 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- .gitignore
|
91
|
-
- .travis.yml
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
92
92
|
- Gemfile
|
93
93
|
- LICENSE.txt
|
94
94
|
- README.md
|
95
95
|
- Rakefile
|
96
96
|
- lib/omniauth-cube7.rb
|
97
97
|
- lib/omniauth/cube7.rb
|
98
|
-
- lib/omniauth/cube7/configuration.rb
|
99
98
|
- lib/omniauth/cube7/version.rb
|
100
99
|
- lib/omniauth/strategies/cube7.rb
|
101
100
|
- omniauth-cube7.gemspec
|
102
|
-
- tests/configuration_test.rb
|
103
101
|
- tests/cube7_test.rb
|
104
102
|
- tests/support/shared_examples.rb
|
105
103
|
- tests/test_helper.rb
|
@@ -113,18 +111,19 @@ require_paths:
|
|
113
111
|
- lib
|
114
112
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
113
|
requirements:
|
116
|
-
- -
|
114
|
+
- - ">="
|
117
115
|
- !ruby/object:Gem::Version
|
118
116
|
version: '0'
|
119
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
118
|
requirements:
|
121
|
-
- -
|
119
|
+
- - ">="
|
122
120
|
- !ruby/object:Gem::Version
|
123
121
|
version: '0'
|
124
122
|
requirements: []
|
125
123
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.2.2
|
127
125
|
signing_key:
|
128
126
|
specification_version: 4
|
129
127
|
summary: Cube7 strategy for Omniauth
|
130
128
|
test_files: []
|
129
|
+
has_rdoc:
|
@@ -1,45 +0,0 @@
|
|
1
|
-
module Omniauth
|
2
|
-
module Cube7
|
3
|
-
# Stores runtime configuration information.
|
4
|
-
#
|
5
|
-
# @example Standard settings
|
6
|
-
# Omniauth::Cube7.configure do |config|
|
7
|
-
# config.site_url = "http://cube7.com/api/v4"
|
8
|
-
# end
|
9
|
-
#
|
10
|
-
# @see Omniauth::Cube7.configure
|
11
|
-
class << self
|
12
|
-
attr_reader :configuration
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.configuration
|
16
|
-
@@configuration ||= Configuration.instance
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.configure
|
20
|
-
yield(self.configuration) if block_given?
|
21
|
-
end
|
22
|
-
|
23
|
-
class Configuration
|
24
|
-
attr_writer :site, :authorize_url
|
25
|
-
include Singleton
|
26
|
-
|
27
|
-
def site
|
28
|
-
@site || "http://www.cube7.com"
|
29
|
-
end
|
30
|
-
|
31
|
-
def authorize_url
|
32
|
-
@authorize_url || "/oauth/authorize"
|
33
|
-
end
|
34
|
-
|
35
|
-
def client_options
|
36
|
-
{
|
37
|
-
:site => self.site,
|
38
|
-
:authorize_url => self.authorize_url
|
39
|
-
}
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
data/tests/configuration_test.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
require 'omniauth-cube7'
|
3
|
-
|
4
|
-
class StrategyTest < StrategyTestCase
|
5
|
-
include OAuth2StrategyTests
|
6
|
-
end
|
7
|
-
|
8
|
-
class ConfigurationTest < StrategyTestCase
|
9
|
-
test "should set the configuration vars from site url" do
|
10
|
-
Omniauth::Cube7.configure do |config|
|
11
|
-
config.site = "http://cube7-test.com"
|
12
|
-
end
|
13
|
-
assert_equal Omniauth::Cube7.configuration.site, "http://cube7-test.com"
|
14
|
-
assert_equal 'http://cube7-test.com', strategy.client.site
|
15
|
-
end
|
16
|
-
|
17
|
-
test "should set configuration vars" do
|
18
|
-
Omniauth::Cube7.configure do |config|
|
19
|
-
config.authorize_url = "/oauth/authorize"
|
20
|
-
end
|
21
|
-
assert_equal Omniauth::Cube7.configuration.authorize_url, "/oauth/authorize"
|
22
|
-
end
|
23
|
-
end
|