omniauth-apple 1.0.1 → 1.1.0

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: d02eff08c32265bcb73e97ecc94b1d8618c18f12b639a777857ff55ca63f6fa8
4
- data.tar.gz: 79f70fdc2a50af00f0dce3732c36b9865409622a724a9950c7dcae31cfddb000
3
+ metadata.gz: feebd01d5717de66bfd00f8587459642d203ca2ffaf0b2057c5cd002993d3531
4
+ data.tar.gz: 2febe43a836eb2232c011b7f87996bbc837ce56f94ebe03f8eb57378ead44530
5
5
  SHA512:
6
- metadata.gz: 42ef4d2b269a555f35a2afd042fe267dcba9de51ab14a4fe16804ca83ba5060dd906e00ecdf58f067fdefeff08f8f6459fd302da93482a6e63ee4c131b2b22df
7
- data.tar.gz: ff29eb36ce8e76e06041a5b86d0b4d393d7407feda0a2bd716d71dae925ef5e1e1032742d71f731e065cd09b7836b51ab9a487425221c8b4ac0128ce8248610d
6
+ metadata.gz: 4c91f969f3e89c2bfd272d8c8df82287b964d3bb636c8dde97b037edb3b6030e415e79715ff940175c0c807a518c1279470fbe73b69a6bb752acb84774db358b
7
+ data.tar.gz: 619709528b5b0e683ea0f9938268a9443cb273788dea3ae98f557cf828d539b35dd898c7c73efcfb04115944f003bfd29702916403a40d3e715ef8fb5c53fbe6
@@ -6,21 +6,22 @@ on:
6
6
  - master
7
7
  pull_request:
8
8
 
9
+ permissions:
10
+ contents: read
11
+
9
12
  jobs:
10
- build:
13
+ spec:
11
14
  runs-on: ubuntu-latest
12
15
  strategy:
13
16
  fail-fast: false
14
17
  matrix:
15
- ruby: ['2.5', '2.6', '2.7']
18
+ ruby: ['2.6', '2.7', '3.0', '3.1']
16
19
  steps:
17
- - uses: actions/checkout@v2
18
- - name: Set up Ruby ${{ matrix.ruby }}
19
- uses: actions/setup-ruby@v1
20
+ - uses: actions/checkout@v3
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
20
23
  with:
21
24
  ruby-version: ${{ matrix.ruby }}
22
- - name: Build and test with Rake on Ruby ${{ matrix.ruby }}
23
- run: |
24
- gem install bundler
25
- bundle install --jobs 4 --retry 3
26
- bundle exec rake spec
25
+ bundler-cache: true
26
+ - name: Run Specs
27
+ run: bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.1.0] - 2022-09-26
4
+
5
+ ### Added
6
+
7
+ - [#67](https://github.com/nhosoya/omniauth-apple/pull/67) Add email_verified and is_private_email
8
+
9
+ ### Fixed
10
+
11
+ - [#74](https://github.com/nhosoya/omniauth-apple/pull/74) rspec failure - callback_path null pointer
12
+ - [#81](https://github.com/nhosoya/omniauth-apple/pull/81) Allow for omniauth 2.0 series
13
+ - [#88](https://github.com/nhosoya/omniauth-apple/pull/88) update github actions config
14
+
15
+ ## [1.0.2] - 2021-05-19
16
+
17
+ ### Fixed
18
+
19
+ - [#59](https://github.com/nhosoya/omniauth-apple/pull/59) Provide User-Agent when fetching JWKs
20
+
21
+
3
22
  ## [1.0.1] - 2020-12-03
4
23
 
5
24
  ### Security
@@ -26,7 +45,7 @@
26
45
 
27
46
  ### Changed
28
47
 
29
- - [#27](https://github.com/nhosoya/omniauth-apple/pull/27) Update development dependency
48
+ - [#27](https://github.com/nhosoya/omniauth-apple/pull/27) Update development dependency
30
49
  - [#28](https://github.com/nhosoya/omniauth-apple/pull/28) Update README.md
31
50
  - [#38](https://github.com/nhosoya/omniauth-apple/pull/38) Refine AuthHash
32
51
  - [#39](https://github.com/nhosoya/omniauth-apple/pull/39) Set the default scope to 'email name'
@@ -37,6 +56,7 @@
37
56
 
38
57
  ## [0.0.1] - 2019-06-07
39
58
 
40
- [Unreleased]: https://github.com/nhosoya/omniauth-apple/compare/v1.0.0...master
59
+ [Unreleased]: https://github.com/nhosoya/omniauth-apple/compare/v1.0.2...master
41
60
  [1.0.0]: https://github.com/nhosoya/omniauth-apple/compare/v0.0.3...v1.0.0
42
61
  [1.0.1]: https://github.com/nhosoya/omniauth-apple/compare/v1.0.0...v1.0.1
62
+ [1.0.2]: https://github.com/nhosoya/omniauth-apple/compare/v1.0.1...v1.0.2
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Apple
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -19,6 +19,8 @@ module OmniAuth
19
19
 
20
20
  uid { id_info['sub'] }
21
21
 
22
+ # Documentation on parameters
23
+ # https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/authenticating_users_with_sign_in_with_apple
22
24
  info do
23
25
  prune!(
24
26
  sub: id_info['sub'],
@@ -26,6 +28,8 @@ module OmniAuth
26
28
  first_name: first_name,
27
29
  last_name: last_name,
28
30
  name: (first_name || last_name) ? [first_name, last_name].join(' ') : email,
31
+ email_verified: email_verified,
32
+ is_private_email: is_private_email
29
33
  )
30
34
  end
31
35
 
@@ -38,12 +42,22 @@ module OmniAuth
38
42
  ::OAuth2::Client.new(client_id, client_secret, deep_symbolize(options.client_options))
39
43
  end
40
44
 
45
+ def email_verified
46
+ value = id_info['email_verified']
47
+ value == true || value == "true"
48
+ end
49
+
50
+ def is_private_email
51
+ value = id_info['is_private_email']
52
+ value == true || value == "true"
53
+ end
54
+
41
55
  def authorize_params
42
56
  super.merge(nonce: new_nonce)
43
57
  end
44
58
 
45
59
  def callback_url
46
- options[:redirect_uri] || (full_host + script_name + callback_path)
60
+ options[:redirect_uri] || (full_host + callback_path)
47
61
  end
48
62
 
49
63
  private
@@ -75,8 +89,10 @@ module OmniAuth
75
89
  end
76
90
 
77
91
  def fetch_jwks
78
- uri = URI.parse('https://appleid.apple.com/auth/keys')
79
- response = Net::HTTP.get_response(uri)
92
+ http = Net::HTTP.new('appleid.apple.com', 443)
93
+ http.use_ssl = true
94
+ request = Net::HTTP::Get.new('/auth/keys', 'User-Agent' => 'ruby/omniauth-apple')
95
+ response = http.request(request)
80
96
  JSON.parse(response.body, symbolize_names: true)
81
97
  end
82
98
 
@@ -38,9 +38,10 @@ Gem::Specification.new do |spec|
38
38
 
39
39
  spec.add_dependency 'omniauth-oauth2'
40
40
  spec.add_dependency 'jwt'
41
+ spec.add_dependency 'rack-protection', '~> 2.0'
41
42
  spec.add_development_dependency "bundler", "~> 2.0"
42
43
  spec.add_development_dependency "rake", "~> 13.0"
43
44
  spec.add_development_dependency "rspec", "~> 3.9"
44
45
  spec.add_development_dependency "webmock", "~> 3.8"
45
- spec.add_development_dependency 'simplecov', "~> 0.18"
46
+ spec.add_development_dependency "simplecov", "~> 0.18"
46
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-apple
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nhosoya
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-12-03 00:00:00.000000000 Z
12
+ date: 2022-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-oauth2
@@ -39,6 +39,20 @@ dependencies:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rack-protection
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '2.0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '2.0'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: bundler
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
164
  - !ruby/object:Gem::Version
151
165
  version: '0'
152
166
  requirements: []
153
- rubygems_version: 3.1.2
167
+ rubygems_version: 3.3.7
154
168
  signing_key:
155
169
  specification_version: 4
156
170
  summary: OmniAuth strategy for Sign In with Apple