omniauth-moloni 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/moloni.rb +8 -24
- data/lib/omniauth-moloni/version.rb +1 -1
- data/omniauth-moloni.gemspec +4 -4
- data/spec/omniauth/strategies/moloni_spec.rb +2 -2
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a9df27d025c154de68da2a9f4e867c7894a61b0cfe78cdfd3973126607424f
|
4
|
+
data.tar.gz: cfc4b7072718a4eec37860408969f9a6d8aa90849b4abe549c3cf81fb022b3ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4edbf552bd70078eb5eec10d53ff6c3ac13ce1f667a636c2156b6ec9ef8332d8f3a8415df67e9c3ff5f61635db4a0584cde2fa16d7615c30a7262abba41541a1
|
7
|
+
data.tar.gz: 1d241870c46f6a7cc28fa9b38ff00251ec07c279a93084e8779ce04a6a84eaaf22750aa790c14b1d4446f7d6a2ab0a6826fb2d52736ac48d1e131d947d2b7e6e
|
@@ -4,23 +4,15 @@ module OmniAuth
|
|
4
4
|
module Strategies
|
5
5
|
class Moloni < OmniAuth::Strategies::OAuth2
|
6
6
|
option :client_options, {
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
7
|
+
site: 'https://api.moloni.pt/v1/',
|
8
|
+
authorize_url: 'https://api.moloni.pt/v1/authorize/',
|
9
|
+
token_url: 'https://api.moloni.pt/v1/grant/',
|
10
|
+
token_method: :get
|
10
11
|
}
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def authorize_params
|
17
|
-
super.tap do |params|
|
18
|
-
%w[client_options].each do |v|
|
19
|
-
if request.params[v]
|
20
|
-
params[v.to_sym] = request.params[v]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
13
|
+
# Moloni does not allow even different query params, even if with the same base URI
|
14
|
+
def callback_url
|
15
|
+
full_host + callback_path
|
24
16
|
end
|
25
17
|
|
26
18
|
uid { raw_info['user_id'].to_s }
|
@@ -42,21 +34,13 @@ module OmniAuth
|
|
42
34
|
end
|
43
35
|
|
44
36
|
def raw_info
|
45
|
-
access_token.options[:mode] = :
|
37
|
+
access_token.options[:mode] = :query
|
46
38
|
@raw_info ||= access_token.get('users/getMe/').parsed
|
47
39
|
end
|
48
40
|
|
49
41
|
def email
|
50
42
|
raw_info['email']
|
51
43
|
end
|
52
|
-
|
53
|
-
def scope
|
54
|
-
access_token['scope']
|
55
|
-
end
|
56
|
-
|
57
|
-
def callback_url
|
58
|
-
full_host + callback_path
|
59
|
-
end
|
60
44
|
end
|
61
45
|
end
|
62
46
|
end
|
data/omniauth-moloni.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.authors = ["Dinis Lage"]
|
6
6
|
gem.email = ["dinis@lage.pw"]
|
7
7
|
gem.description = %q{Unofficial OmniAuth strategy for Moloni.}
|
8
|
-
gem.summary = %q{Unofficial OmniAuth strategy
|
8
|
+
gem.summary = %q{Unofficial OmniAuth strategy to authenticate against Moloni platform.}
|
9
9
|
gem.homepage = "https://github.com/dlage/omniauth-moloni"
|
10
10
|
gem.license = "MIT"
|
11
11
|
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.add_dependency 'omniauth', '~> 2.0'
|
20
20
|
gem.add_dependency 'omniauth-oauth2', '~> 1.7.1'
|
21
21
|
gem.add_development_dependency 'rspec', '~> 3.5'
|
22
|
-
gem.add_development_dependency 'rack-test'
|
23
|
-
gem.add_development_dependency 'simplecov'
|
24
|
-
gem.add_development_dependency 'webmock'
|
22
|
+
gem.add_development_dependency 'rack-test', '~> 2.0'
|
23
|
+
gem.add_development_dependency 'simplecov', '~> 0.20.0'
|
24
|
+
gem.add_development_dependency 'webmock', '~> 3.0'
|
25
25
|
end
|
@@ -76,10 +76,10 @@ describe OmniAuth::Strategies::Moloni do
|
|
76
76
|
expect(subject.raw_info).to eq(parsed_response)
|
77
77
|
end
|
78
78
|
|
79
|
-
it 'should use the
|
79
|
+
it 'should use the query auth mode' do
|
80
80
|
expect(access_token).to receive(:get).with(moloni_user_path).and_return(response)
|
81
81
|
subject.raw_info
|
82
|
-
expect(access_token.options[:mode]).to eq(:
|
82
|
+
expect(access_token.options[:mode]).to eq(:query)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-moloni
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dinis Lage
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2022-08-10 00:00:00.000000000 Z
|
@@ -56,44 +56,44 @@ dependencies:
|
|
56
56
|
name: rack-test
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '2.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
|
-
version: '0'
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.20.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
|
-
version:
|
82
|
+
version: 0.20.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: webmock
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '3.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '3.0'
|
97
97
|
description: Unofficial OmniAuth strategy for Moloni.
|
98
98
|
email:
|
99
99
|
- dinis@lage.pw
|
@@ -121,7 +121,7 @@ homepage: https://github.com/dlage/omniauth-moloni
|
|
121
121
|
licenses:
|
122
122
|
- MIT
|
123
123
|
metadata: {}
|
124
|
-
post_install_message:
|
124
|
+
post_install_message:
|
125
125
|
rdoc_options: []
|
126
126
|
require_paths:
|
127
127
|
- lib
|
@@ -136,10 +136,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
|
-
rubygems_version: 3.
|
140
|
-
signing_key:
|
139
|
+
rubygems_version: 3.3.19
|
140
|
+
signing_key:
|
141
141
|
specification_version: 4
|
142
|
-
summary: Unofficial OmniAuth strategy
|
142
|
+
summary: Unofficial OmniAuth strategy to authenticate against Moloni platform.
|
143
143
|
test_files:
|
144
144
|
- spec/omniauth/strategies/moloni_spec.rb
|
145
145
|
- spec/spec_helper.rb
|