omniauth-ely 0.1.0 → 0.2.1
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 +5 -5
- data/.gitignore +0 -1
- data/Gemfile.lock +127 -0
- data/README.md +1 -1
- data/lib/omniauth/strategies/ely.rb +5 -1
- data/lib/omniauth-ely/version.rb +1 -1
- data/omniauth-ely.gemspec +1 -1
- data/spec/omniauth/strategies/ely_spec.rb +13 -13
- metadata +15 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bef96bfa999ae1d0730f067768ddaf4966235cbaf3543a17288dce99137263a3
|
|
4
|
+
data.tar.gz: 18beb6bd7d2cc62ebd1359051b675b86875abdba704065ccd0052cfca67c4d5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a5b061d97be5d02d2cb005ee4e9c82e174c156311f6e0ada72d80ac772cb4d86fb0ec46ab6a58452788ac799188699149304c9373a739062c7e9479581ea0ff3
|
|
7
|
+
data.tar.gz: 615ad5f484e69bb6d554ecc75438ed9a1ac8a6d0ed7228029e7c4dca6e62508b4281a2c95d943198d82f12e2b5df8343b47468379099a766ff66c66aec6042ad
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
omniauth-ely (0.2.1)
|
|
5
|
+
omniauth (>= 1.0, < 3.0)
|
|
6
|
+
omniauth-oauth2 (>= 1.1.1, < 2.0)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: http://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
addressable (2.8.5)
|
|
12
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
13
|
+
base64 (0.1.1)
|
|
14
|
+
coderay (1.1.3)
|
|
15
|
+
crack (0.4.5)
|
|
16
|
+
rexml
|
|
17
|
+
diff-lcs (1.5.0)
|
|
18
|
+
docile (1.4.0)
|
|
19
|
+
faraday (2.7.11)
|
|
20
|
+
base64
|
|
21
|
+
faraday-net_http (>= 2.0, < 3.1)
|
|
22
|
+
ruby2_keywords (>= 0.0.4)
|
|
23
|
+
faraday-net_http (3.0.2)
|
|
24
|
+
ffi (1.16.3)
|
|
25
|
+
formatador (1.1.0)
|
|
26
|
+
growl (1.0.3)
|
|
27
|
+
guard (2.18.1)
|
|
28
|
+
formatador (>= 0.2.4)
|
|
29
|
+
listen (>= 2.7, < 4.0)
|
|
30
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
31
|
+
nenv (~> 0.1)
|
|
32
|
+
notiffany (~> 0.0)
|
|
33
|
+
pry (>= 0.13.0)
|
|
34
|
+
shellany (~> 0.0)
|
|
35
|
+
thor (>= 0.18.1)
|
|
36
|
+
guard-bundler (3.0.1)
|
|
37
|
+
bundler (>= 2.1, < 3)
|
|
38
|
+
guard (~> 2.2)
|
|
39
|
+
guard-compat (~> 1.1)
|
|
40
|
+
guard-compat (1.2.1)
|
|
41
|
+
guard-rspec (4.7.3)
|
|
42
|
+
guard (~> 2.1)
|
|
43
|
+
guard-compat (~> 1.1)
|
|
44
|
+
rspec (>= 2.99.0, < 4.0)
|
|
45
|
+
hashdiff (1.0.1)
|
|
46
|
+
hashie (5.0.0)
|
|
47
|
+
jwt (2.7.1)
|
|
48
|
+
listen (3.8.0)
|
|
49
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
50
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
51
|
+
lumberjack (1.2.9)
|
|
52
|
+
method_source (1.0.0)
|
|
53
|
+
multi_xml (0.6.0)
|
|
54
|
+
nenv (0.3.0)
|
|
55
|
+
notiffany (0.1.3)
|
|
56
|
+
nenv (~> 0.1)
|
|
57
|
+
shellany (~> 0.0)
|
|
58
|
+
oauth2 (2.0.9)
|
|
59
|
+
faraday (>= 0.17.3, < 3.0)
|
|
60
|
+
jwt (>= 1.0, < 3.0)
|
|
61
|
+
multi_xml (~> 0.5)
|
|
62
|
+
rack (>= 1.2, < 4)
|
|
63
|
+
snaky_hash (~> 2.0)
|
|
64
|
+
version_gem (~> 1.1)
|
|
65
|
+
omniauth (2.1.1)
|
|
66
|
+
hashie (>= 3.4.6)
|
|
67
|
+
rack (>= 2.2.3)
|
|
68
|
+
rack-protection
|
|
69
|
+
omniauth-oauth2 (1.8.0)
|
|
70
|
+
oauth2 (>= 1.4, < 3)
|
|
71
|
+
omniauth (~> 2.0)
|
|
72
|
+
pry (0.14.2)
|
|
73
|
+
coderay (~> 1.1)
|
|
74
|
+
method_source (~> 1.0)
|
|
75
|
+
public_suffix (5.0.3)
|
|
76
|
+
rack (3.0.8)
|
|
77
|
+
rack-protection (3.0.6)
|
|
78
|
+
rack
|
|
79
|
+
rack-test (2.1.0)
|
|
80
|
+
rack (>= 1.3)
|
|
81
|
+
rb-fsevent (0.11.2)
|
|
82
|
+
rb-inotify (0.10.1)
|
|
83
|
+
ffi (~> 1.0)
|
|
84
|
+
rexml (3.2.6)
|
|
85
|
+
rspec (2.99.0)
|
|
86
|
+
rspec-core (~> 2.99.0)
|
|
87
|
+
rspec-expectations (~> 2.99.0)
|
|
88
|
+
rspec-mocks (~> 2.99.0)
|
|
89
|
+
rspec-core (2.99.2)
|
|
90
|
+
rspec-expectations (2.99.2)
|
|
91
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
|
92
|
+
rspec-mocks (2.99.4)
|
|
93
|
+
ruby2_keywords (0.0.5)
|
|
94
|
+
shellany (0.0.1)
|
|
95
|
+
simplecov (0.22.0)
|
|
96
|
+
docile (~> 1.1)
|
|
97
|
+
simplecov-html (~> 0.11)
|
|
98
|
+
simplecov_json_formatter (~> 0.1)
|
|
99
|
+
simplecov-html (0.12.3)
|
|
100
|
+
simplecov_json_formatter (0.1.4)
|
|
101
|
+
snaky_hash (2.0.1)
|
|
102
|
+
hashie
|
|
103
|
+
version_gem (~> 1.1, >= 1.1.1)
|
|
104
|
+
thor (1.3.0)
|
|
105
|
+
version_gem (1.1.3)
|
|
106
|
+
webmock (3.19.1)
|
|
107
|
+
addressable (>= 2.8.0)
|
|
108
|
+
crack (>= 0.3.2)
|
|
109
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
110
|
+
|
|
111
|
+
PLATFORMS
|
|
112
|
+
x86_64-linux
|
|
113
|
+
|
|
114
|
+
DEPENDENCIES
|
|
115
|
+
growl
|
|
116
|
+
guard
|
|
117
|
+
guard-bundler
|
|
118
|
+
guard-rspec
|
|
119
|
+
omniauth-ely!
|
|
120
|
+
rack-test
|
|
121
|
+
rb-fsevent
|
|
122
|
+
rspec (~> 2.7)
|
|
123
|
+
simplecov
|
|
124
|
+
webmock
|
|
125
|
+
|
|
126
|
+
BUNDLED WITH
|
|
127
|
+
2.4.20
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This is the official OmniAuth strategy for authenticating to Ely.by. To
|
|
4
4
|
use it, you'll need to sign up for an OAuth2 Application ID and Secret
|
|
5
|
-
on the [Ely.by Account Applications Page](
|
|
5
|
+
on the [Ely.by Account Applications Page](https://account.ely.by/dev/applications).
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
@@ -40,7 +40,11 @@ module OmniAuth
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def profile_url
|
|
43
|
-
'
|
|
43
|
+
'https://ely.by/u' + raw_info['id'].to_s
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def callback_url
|
|
47
|
+
options[:redirect_uri] || (full_host + script_name + callback_path)
|
|
44
48
|
end
|
|
45
49
|
end
|
|
46
50
|
end
|
data/lib/omniauth-ely/version.rb
CHANGED
data/omniauth-ely.gemspec
CHANGED
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
|
12
12
|
gem.description = %q{Official OmniAuth strategy for Ely.by.}
|
|
13
13
|
gem.summary = %q{Official OmniAuth strategy for Ely.by.}
|
|
14
14
|
|
|
15
|
-
gem.add_dependency 'omniauth', '
|
|
15
|
+
gem.add_dependency 'omniauth', '>= 1.0', '< 3.0'
|
|
16
16
|
gem.add_dependency 'omniauth-oauth2', '>= 1.1.1', '< 2.0'
|
|
17
17
|
gem.add_development_dependency 'rspec', '~> 2.7'
|
|
18
18
|
gem.add_development_dependency 'rack-test'
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe OmniAuth::Strategies::Ely do
|
|
4
|
-
let(:access_token) {
|
|
5
|
-
let(:parsed_response) {
|
|
6
|
-
let(:response) {
|
|
4
|
+
let(:access_token) { double('AccessToken', :options => {}) }
|
|
5
|
+
let(:parsed_response) { double('ParsedResponse') }
|
|
6
|
+
let(:response) { double('Response', :parsed => parsed_response) }
|
|
7
7
|
|
|
8
8
|
subject do
|
|
9
9
|
OmniAuth::Strategies::Ely.new({})
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
before(:each) do
|
|
13
|
-
subject.
|
|
13
|
+
allow(subject).to receive(:access_token).and_return(access_token)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
context 'client options' do
|
|
17
17
|
it 'should have correct site' do
|
|
18
|
-
subject.options.client_options.site.
|
|
18
|
+
expect(subject.options.client_options.site).to eq('https://account.ely.by')
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
it 'should have correct authorize url' do
|
|
22
|
-
subject.options.client_options.authorize_url.
|
|
22
|
+
expect(subject.options.client_options.authorize_url).to eq('https://account.ely.by/oauth2/v1/')
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it 'should have correct token url' do
|
|
26
|
-
subject.options.client_options.token_url.
|
|
26
|
+
expect(subject.options.client_options.token_url).to eq('https://account.ely.by/api/oauth2/v1/token')
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
context '#raw_info' do
|
|
31
31
|
it 'should use relative paths' do
|
|
32
|
-
access_token.
|
|
33
|
-
subject.raw_info.
|
|
32
|
+
expect(access_token).to receive(:get).and_return(response)
|
|
33
|
+
expect(subject.raw_info).to eq(parsed_response)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
it 'should build valid profile link' do
|
|
37
37
|
raw_info = Hash.new
|
|
38
38
|
raw_info['id'] = 1
|
|
39
|
-
subject.
|
|
40
|
-
subject.profile_url.
|
|
39
|
+
allow(subject).to receive(:raw_info).and_return(raw_info)
|
|
40
|
+
expect(subject.profile_url).to eq('https://ely.by/u1')
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
it 'should build valid skin link' do
|
|
44
44
|
raw_info = Hash.new
|
|
45
45
|
raw_info['username'] = 'Steve'
|
|
46
|
-
subject.
|
|
47
|
-
subject.skin_url.
|
|
46
|
+
allow(subject).to receive(:raw_info).and_return(raw_info)
|
|
47
|
+
expect(subject.skin_url).to eq('http://skinsystem.ely.by/skins/Steve.png')
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
metadata
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-ely
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ely.by team
|
|
8
8
|
- ErickSkrauch
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2023-11-04 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: omniauth
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
requirements:
|
|
18
|
-
- - "
|
|
18
|
+
- - ">="
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
20
|
version: '1.0'
|
|
21
|
+
- - "<"
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: '3.0'
|
|
21
24
|
type: :runtime
|
|
22
25
|
prerelease: false
|
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
27
|
requirements:
|
|
25
|
-
- - "
|
|
28
|
+
- - ">="
|
|
26
29
|
- !ruby/object:Gem::Version
|
|
27
30
|
version: '1.0'
|
|
31
|
+
- - "<"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '3.0'
|
|
28
34
|
- !ruby/object:Gem::Dependency
|
|
29
35
|
name: omniauth-oauth2
|
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -112,6 +118,7 @@ files:
|
|
|
112
118
|
- ".gitignore"
|
|
113
119
|
- ".rspec"
|
|
114
120
|
- Gemfile
|
|
121
|
+
- Gemfile.lock
|
|
115
122
|
- Guardfile
|
|
116
123
|
- LICENSE.txt
|
|
117
124
|
- README.md
|
|
@@ -126,7 +133,7 @@ homepage: https://github.com/elyby/omniauth-ely
|
|
|
126
133
|
licenses:
|
|
127
134
|
- MIT
|
|
128
135
|
metadata: {}
|
|
129
|
-
post_install_message:
|
|
136
|
+
post_install_message:
|
|
130
137
|
rdoc_options: []
|
|
131
138
|
require_paths:
|
|
132
139
|
- lib
|
|
@@ -141,9 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
141
148
|
- !ruby/object:Gem::Version
|
|
142
149
|
version: '0'
|
|
143
150
|
requirements: []
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
signing_key:
|
|
151
|
+
rubygems_version: 3.3.25
|
|
152
|
+
signing_key:
|
|
147
153
|
specification_version: 4
|
|
148
154
|
summary: Official OmniAuth strategy for Ely.by.
|
|
149
155
|
test_files:
|