omniauth-microsoft_graph 0.3.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omniauth-microsoft_graph might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6530221ebe39d69b96ba1e8eb74ec88378f6499d
4
- data.tar.gz: 4f16cdfda140432a828d8d838f33126d59714764
2
+ SHA256:
3
+ metadata.gz: f6fe6e2c005ac0bf995f831460527c29ea1610daecfd48e9c83a6987a3b7ab91
4
+ data.tar.gz: 569e04a9a5e50e712ea4e4a847454f6d263392a9932fcd179b6e5a1db9c77645
5
5
  SHA512:
6
- metadata.gz: dc680a9b3565e3b015f6ee50718854f173f3a2ebd198f19df721b2caa961cafe9f7337307fef9779eebabc0b32c19235f7c74335206dabc274c7785271694a76
7
- data.tar.gz: bd712e7e5bf694a253f328b212a233bdec230891a775882adfe960af63adbf4f632b29c91423ea91cb130ceae9e79fa9fb0bc38dba06284837d91e364a240e49
6
+ metadata.gz: b2be452a85ef752c0c0b0b30a0338cbe867dbd3e29079001ebf3ae5e7377ca0fbd3c8ef8a0fb61461c507b99c9692a8aefb9ecf4c556bcd2f7f9e4e97125a56b
7
+ data.tar.gz: b77352003e95997a8993c098f894df4c3ea846c42fd0f18743cb933fe5417db3d631934ac073d2424cb7f8491407927fc83af5cfb77962b7d6a1305839bbed28
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [synth] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
@@ -0,0 +1,33 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ pull_request:
13
+
14
+ jobs:
15
+ test:
16
+
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ ruby-version: ['2.6', '2.7', '3.0']
21
+
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - name: Set up Ruby
25
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
26
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
27
+ # uses: ruby/setup-ruby@v1
28
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
29
+ with:
30
+ ruby-version: ${{ matrix.ruby-version }}
31
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
32
+ - name: Run tests
33
+ run: bundle exec rake
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # Omniauth::MicrosoftGraph [![Build Status](https://travis-ci.org/synth/omniauth-microsoft_graph.svg?branch=master)](https://travis-ci.org/synth/omniauth-microsoft_graph)
1
+ # Omniauth::MicrosoftGraph ![ruby workflow](https://github.com/synth/omniauth-microsoft_graph/actions/workflows/ruby.yml/badge.svg)
2
+
2
3
 
3
4
  Microsoft Graph OAuth2 Strategy for OmniAuth.
4
5
  Can be used to authenticate with Office365 or other MS services, and get a token for the Microsoft Graph Api, formerly the Office365 Unified Api.
@@ -33,6 +34,8 @@ Just add {login_hint: "email@example.com"} to your url generation to form:
33
34
  ```ruby
34
35
  /auth/microsoft_graph?login_hint=email@example.com
35
36
  ```
37
+ ### Upgrading to 1.0.0
38
+ This version requires OmniAuth v2. If you are using Rails, you will need to include or upgrade `omniauth-rails_csrf_protection`. If you upgrade and get an error in your logs complaining about "authenticity error" or similiar, make sure to do `bundle update omniauth-rails_csrf_protection`
36
39
 
37
40
  ## Contributing
38
41
 
@@ -1,5 +1,5 @@
1
- module Omniauth
1
+ module OmniAuth
2
2
  module MicrosoftGraph
3
- VERSION = "0.3.3"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -89,7 +89,7 @@ module OmniAuth
89
89
  verifier = body && body['code']
90
90
  client_get_token(verifier, '/auth/microsoft_graph/callback') if verifier
91
91
  rescue JSON::ParserError => e
92
- warn "[omniauth google-oauth2] JSON parse error=#{e}"
92
+ warn "[omniauth microsoft_graph] JSON parse error=#{e}"
93
93
  end
94
94
  end
95
95
  end
@@ -5,7 +5,7 @@ require 'omniauth/microsoft_graph/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "omniauth-microsoft_graph"
8
- spec.version = Omniauth::MicrosoftGraph::VERSION
8
+ spec.version = OmniAuth::MicrosoftGraph::VERSION
9
9
  spec.authors = ["Peter Philips", "Joel Van Horn"]
10
10
  spec.email = ["pete@p373.net", "joel@joelvanhorn.com"]
11
11
  spec.summary = %q{omniauth provider for Microsoft Graph}
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'omniauth', '~> 1.1', '>= 1.1.1'
22
- spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.6'
21
+ spec.add_runtime_dependency 'omniauth', '~> 2.0'
22
+ spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.8.0'
23
23
  spec.add_development_dependency "sinatra", '~> 0'
24
24
  spec.add_development_dependency "rake", '~> 12.3.3', '>= 12.3.3'
25
25
  spec.add_development_dependency 'rspec', '~> 3.6'
@@ -151,7 +151,7 @@ describe OmniAuth::Strategies::MicrosoftGraph do
151
151
  end
152
152
 
153
153
  it 'should set default scope to email,profile' do
154
- expect(subject.authorize_params['scope']).to eq('openid email profile https://graph.microsoft.com/User.Read')
154
+ expect(subject.authorize_params['scope']).to eq('offline_access openid email profile https://graph.microsoft.com/User.Read')
155
155
  end
156
156
 
157
157
  it 'should support space delimited scopes' do
@@ -243,6 +243,7 @@ describe OmniAuth::Strategies::MicrosoftGraph do
243
243
 
244
244
  describe '#callback_path' do
245
245
  it 'has the correct default callback path' do
246
+ allow(subject).to receive(:script_name).and_return('')
246
247
  expect(subject.callback_path).to eq('/auth/microsoft_graph/callback')
247
248
  end
248
249
 
@@ -250,6 +251,11 @@ describe OmniAuth::Strategies::MicrosoftGraph do
250
251
  @options = { callback_path: '/auth/foo/callback' }
251
252
  expect(subject.callback_path).to eq('/auth/foo/callback')
252
253
  end
254
+
255
+ it 'should set the callback_path with script_name if present' do
256
+ allow(subject).to receive(:script_name).and_return('/api/v1')
257
+ expect(subject.callback_path).to eq('/api/v1/auth/microsoft_graph/callback')
258
+ end
253
259
  end
254
260
 
255
261
  describe '#info' do
@@ -261,7 +267,7 @@ describe OmniAuth::Strategies::MicrosoftGraph do
261
267
  end
262
268
  end
263
269
  end
264
- let(:access_token) { OAuth2::AccessToken.from_hash(client, {}) }
270
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, { 'access_token' => 'a' }) }
265
271
  before { allow(subject).to receive(:access_token).and_return(access_token) }
266
272
 
267
273
  context 'with verified email' do
@@ -285,7 +291,7 @@ describe OmniAuth::Strategies::MicrosoftGraph do
285
291
  end
286
292
  end
287
293
  end
288
- let(:access_token) { OAuth2::AccessToken.from_hash(client, {}) }
294
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, { 'access_token' => 'a' }) }
289
295
 
290
296
  before { allow(subject).to receive(:access_token).and_return(access_token) }
291
297
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-microsoft_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Philips
8
8
  - Joel Van Horn
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-17 00:00:00.000000000 Z
12
+ date: 2022-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -17,34 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.1'
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 1.1.1
20
+ version: '2.0'
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
25
  - - "~>"
29
26
  - !ruby/object:Gem::Version
30
- version: '1.1'
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.1.1
27
+ version: '2.0'
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: omniauth-oauth2
36
30
  requirement: !ruby/object:Gem::Requirement
37
31
  requirements:
38
32
  - - "~>"
39
33
  - !ruby/object:Gem::Version
40
- version: '1.6'
34
+ version: 1.8.0
41
35
  type: :runtime
42
36
  prerelease: false
43
37
  version_requirements: !ruby/object:Gem::Requirement
44
38
  requirements:
45
39
  - - "~>"
46
40
  - !ruby/object:Gem::Version
47
- version: '1.6'
41
+ version: 1.8.0
48
42
  - !ruby/object:Gem::Dependency
49
43
  name: sinatra
50
44
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +109,8 @@ executables: []
115
109
  extensions: []
116
110
  extra_rdoc_files: []
117
111
  files:
112
+ - ".github/FUNDING.yml"
113
+ - ".github/workflows/ruby.yml"
118
114
  - ".travis.yml"
119
115
  - CHANGELOG.md
120
116
  - Gemfile
@@ -133,7 +129,7 @@ homepage: https://github.com/synth/omniauth-microsoft_graph
133
129
  licenses:
134
130
  - MIT
135
131
  metadata: {}
136
- post_install_message:
132
+ post_install_message:
137
133
  rdoc_options: []
138
134
  require_paths:
139
135
  - lib
@@ -148,9 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
144
  - !ruby/object:Gem::Version
149
145
  version: '0'
150
146
  requirements: []
151
- rubyforge_project:
152
- rubygems_version: 2.5.2
153
- signing_key:
147
+ rubygems_version: 3.1.6
148
+ signing_key:
154
149
  specification_version: 4
155
150
  summary: omniauth provider for Microsoft Graph
156
151
  test_files: