omniauth-moloni 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 115c7065e361f52e80786ab9f0b2c83747d541003014a5bc6244dbbae4e4db50
4
- data.tar.gz: 4d84fa28b39dcb037b64abaec860ebe35d4dab0fa7917ae667cd0acb19a624cd
3
+ metadata.gz: 63a1b840584bccf0cb729ef1f173b4bd87d33c96ca0f92dcbd8851a2b08aff1e
4
+ data.tar.gz: 83fc1fdc0eaac94b69a5223ae90be3a7ad2cee101f278995b9d8f69a2bb27704
5
5
  SHA512:
6
- metadata.gz: 2fdcdfb91a28444c9f243e29e8044a819c3b6dac9263c2dbd5db3a7839de26af4be14f3d9f5e95612d4e14dc2a73a3d65e6e69c534e7931507679600a3908d0b
7
- data.tar.gz: afdc7f2501b9ebbb2cf20baade83b14b0a1e5b58f2d0f4c62464efc83a7d26e1b2a1ef0d2eb1c6b788008ddd298cadad16522a36a7e9f93db5fdd873c983336a
6
+ metadata.gz: 04a4ac3bce23a8fe1ff6584679c5d6a43b70a448f5049f3a0de744755737359d7ad2ba33e4c577adf86aec8a4d8bf762457e191652bf8a4d440a6d2c1a5edbe0
7
+ data.tar.gz: bfd239e05b2bad986a8070de9bfca58709b8ef9f2496bb4749e90d843a26f383325423554bf97f1cfff6634b643a14fcf513bc028cd2c1649c9fc4a32ef936a6
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ * 0.1.2 - Bump version to support faraday 2.6.0 and upwards and prevent logged warnings
2
+ * 0.1.1 - First working version
@@ -4,23 +4,15 @@ module OmniAuth
4
4
  module Strategies
5
5
  class Moloni < OmniAuth::Strategies::OAuth2
6
6
  option :client_options, {
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/'
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
- def request_phase
13
- super
14
- end
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] = :header
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
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Moloni
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -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 for Moloni.}
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
 
@@ -17,9 +17,9 @@ Gem::Specification.new do |gem|
17
17
  gem.version = OmniAuth::Moloni::VERSION
18
18
 
19
19
  gem.add_dependency 'omniauth', '~> 2.0'
20
- gem.add_dependency 'omniauth-oauth2', '~> 1.7.1'
20
+ gem.add_dependency 'omniauth-oauth2', '~> 1.8'
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', '> 1.0'
23
+ gem.add_development_dependency 'simplecov', '> 0.10.0'
24
+ gem.add_development_dependency 'webmock', '> 2.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 header auth mode' do
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(:header)
82
+ expect(access_token.options[:mode]).to eq(:query)
83
83
  end
84
84
  end
85
85
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-moloni
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dinis Lage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-10 00:00:00.000000000 Z
11
+ date: 2022-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.1
33
+ version: '1.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.7.1
40
+ version: '1.8'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -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: '1.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: '1.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: '0'
75
+ version: 0.10.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: '0'
82
+ version: 0.10.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: '2.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: '2.0'
97
97
  description: Unofficial OmniAuth strategy for Moloni.
98
98
  email:
99
99
  - dinis@lage.pw
@@ -104,6 +104,7 @@ files:
104
104
  - ".github/workflows/ruby.yml"
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
+ - CHANGELOG.md
107
108
  - Dockerfile
108
109
  - Gemfile
109
110
  - Guardfile
@@ -136,10 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  - !ruby/object:Gem::Version
137
138
  version: '0'
138
139
  requirements: []
139
- rubygems_version: 3.0.3.1
140
+ rubygems_version: 3.2.33
140
141
  signing_key:
141
142
  specification_version: 4
142
- summary: Unofficial OmniAuth strategy for Moloni.
143
- test_files:
144
- - spec/omniauth/strategies/moloni_spec.rb
145
- - spec/spec_helper.rb
143
+ summary: Unofficial OmniAuth strategy to authenticate against Moloni platform.
144
+ test_files: []