omniauth-gitlab 1.0.1 → 1.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/lib/omniauth-gitlab/version.rb +1 -1
- data/lib/omniauth/strategies/gitlab.rb +8 -0
- data/spec/omniauth/strategies/gitlab_spec.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c90ebc7ccce82e78ef6218157792adbf2a8be97
|
|
4
|
+
data.tar.gz: 78aa9a9c27a1b99fe18a70cc619547552af6b88c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46f9f7128e336fb1f6c11050982378c633ef5a2702db33f8d8acaed89669b85d6d40ce39c9ba525840ed9a6918c20a44c0ed04d54dfe169fe82ebc8995ba83e8
|
|
7
|
+
data.tar.gz: f9712c2a6af44bd34cfc20abb593576acf05aaa2f2aa646536fd034267e2acb872235811376d3cad91669f9caa255f6abda976b2010c2c49ef43b060f752b2b5
|
|
@@ -11,6 +11,8 @@ module OmniAuth
|
|
|
11
11
|
token_url: '/oauth/token'
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
option :redirect_url
|
|
15
|
+
|
|
14
16
|
uid { raw_info['id'].to_s }
|
|
15
17
|
|
|
16
18
|
info do
|
|
@@ -29,6 +31,12 @@ module OmniAuth
|
|
|
29
31
|
def raw_info
|
|
30
32
|
@raw_info ||= access_token.get('/api/v3/user').parsed
|
|
31
33
|
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def callback_url
|
|
38
|
+
options.redirect_url || (full_host + script_name + callback_path)
|
|
39
|
+
end
|
|
32
40
|
end
|
|
33
41
|
end
|
|
34
42
|
end
|
|
@@ -17,7 +17,8 @@ describe OmniAuth::Strategies::GitLab do
|
|
|
17
17
|
site: enterprise_site,
|
|
18
18
|
authorize_url: enterprise_authorize_url,
|
|
19
19
|
token_url: enterprise_token_url
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
|
+
redirect_url: 'http://localhost:9292/callback_url'
|
|
21
22
|
)
|
|
22
23
|
end
|
|
23
24
|
|
|
@@ -45,6 +46,18 @@ describe OmniAuth::Strategies::GitLab do
|
|
|
45
46
|
end
|
|
46
47
|
end
|
|
47
48
|
|
|
49
|
+
describe 'redirect_url' do
|
|
50
|
+
context 'with defaults' do
|
|
51
|
+
subject { gitlab_service.options }
|
|
52
|
+
its(:redirect_url) { is_expected.to be_nil }
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
context 'with customs' do
|
|
56
|
+
subject { enterprise.options }
|
|
57
|
+
its(:redirect_url) { is_expected.to eq 'http://localhost:9292/callback_url' }
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
48
61
|
describe '#raw_info' do
|
|
49
62
|
it 'sent request to current user endpoint' do
|
|
50
63
|
expect(access_token).to receive(:get).with('/api/v3/user').and_return(response)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-gitlab
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ssein
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-02-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: omniauth
|