apple_id 1.1.0 → 1.3.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: 1c660f0576768bf567a75575fc413a2edd9e1c805de1af2853be8fb6a04eeceb
4
- data.tar.gz: '07494d150bfa11e09cf8216b2bb46b6686869ac8164baad467651fdedcd4b7ca'
3
+ metadata.gz: a849c5014ce8f45fc143ad955ef8ce22ff7639955dcce14ce58812cfa0e0a523
4
+ data.tar.gz: 1b5dfa5e7179bf7102887e48f9870d510648fb6a5dbf246b15ba6ae7a0f8f76d
5
5
  SHA512:
6
- metadata.gz: 13ede95f09ed940bd443001b63cc5fb3fc038c6d0e176f7d6ad52427325ec1764e5ec8eabcb38e94e7c6069f59c354c8be0947397bd29c55cd814734b024ee83
7
- data.tar.gz: c8e8695d746b5a5431f45b0241530d2a49af18402e5f0f24924acd191eaac269e4a690e9998c4b5962905b89b3db98481900a75a3ced992aa3d95d3a35e5b8d6
6
+ metadata.gz: 220695160a1be005b4cfbd1e4e214966ab5b5fd7af1c9819eef95339a81fe2af2482ee9e30b595991c093bbd51505135d343b28ab2c74138abce3f9e311ca2ef
7
+ data.tar.gz: 10bed7c9835616114fa2ac2929a515ba4fe30c2552c589ca2a15c207bfe57547cdc775dc543cae91dc20e6b04641240e50e303dc590f47ba67a6e255bab57913
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: nov
data/.travis.yml CHANGED
@@ -6,4 +6,5 @@ before_install: gem install bundler
6
6
  rvm:
7
7
  - 2.5.8
8
8
  - 2.6.6
9
- - 2.7.1
9
+ - 2.7.2
10
+ - 3.0.2
data/README.md CHANGED
@@ -36,7 +36,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
36
36
 
37
37
  ## Contributing
38
38
 
39
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/apple_id. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nov/apple_id. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
40
40
 
41
41
  ## License
42
42
 
@@ -44,4 +44,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
44
44
 
45
45
  ## Code of Conduct
46
46
 
47
- Everyone interacting in the AppleID project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/apple_id/blob/master/CODE_OF_CONDUCT.md).
47
+ Everyone interacting in the AppleID project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/nov/apple_id/blob/master/CODE_OF_CONDUCT.md).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.3.0
data/apple_id.gemspec CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_runtime_dependency 'rack-oauth2', '~> 1.12'
22
- spec.add_runtime_dependency 'openid_connect', '~> 1.1.7'
21
+ spec.add_runtime_dependency 'rack-oauth2', '~> 1.21'
22
+ spec.add_runtime_dependency 'openid_connect', '~> 1.3.0'
23
23
  spec.add_development_dependency 'bundler'
24
24
  spec.add_development_dependency 'rake'
25
25
  spec.add_development_dependency 'rspec'
@@ -7,7 +7,8 @@ module AppleID
7
7
  def initialize(attributes)
8
8
  attributes_with_default = {
9
9
  authorization_endpoint: File.join(ISSUER, '/auth/authorize'),
10
- token_endpoint: File.join(ISSUER, '/auth/token')
10
+ token_endpoint: File.join(ISSUER, '/auth/token'),
11
+ revocation_endpoint: File.join(ISSUER, '/auth/revoke'),
11
12
  }.merge(attributes)
12
13
  super attributes_with_default
13
14
  end
@@ -17,6 +18,11 @@ module AppleID
17
18
  super :body, options
18
19
  end
19
20
 
21
+ def revoke!(options = {})
22
+ self.secret = client_secret_jwt
23
+ super :body, options
24
+ end
25
+
20
26
  private
21
27
 
22
28
  def client_secret_jwt
@@ -0,0 +1,27 @@
1
+ module AppleID
2
+ class IdToken::RealUserStatus
3
+ class UndefinedStatus < StandardError; end
4
+
5
+ attr_accessor :value
6
+
7
+ STATUSES = [
8
+ :unsupported,
9
+ :unknown,
10
+ :likely_real
11
+ ]
12
+
13
+ def initialize(value)
14
+ self.value = value
15
+ end
16
+
17
+ STATUSES.each do |expected_status|
18
+ define_method :"#{expected_status}?" do
19
+ send(:status) == expected_status
20
+ end
21
+ end
22
+
23
+ def status
24
+ STATUSES[value] or raise UndefinedStatus
25
+ end
26
+ end
27
+ end
@@ -2,7 +2,7 @@ module AppleID
2
2
  class IdToken < OpenIDConnect::ResponseObject::IdToken
3
3
  class VerificationFailed < StandardError; end
4
4
 
5
- attr_optional :email, :email_verified, :is_private_email, :nonce_supported
5
+ attr_optional :email, :email_verified, :is_private_email, :nonce_supported, :real_user_status
6
6
  attr_accessor :original_jwt_string
7
7
  alias_method :original_jwt, :raw_attributes
8
8
 
@@ -18,6 +18,13 @@ module AppleID
18
18
  end
19
19
  end
20
20
 
21
+ def initialize(attributes = {})
22
+ super
23
+ unless self.real_user_status.nil?
24
+ self.real_user_status = RealUserStatus.new(self.real_user_status)
25
+ end
26
+ end
27
+
21
28
  def verify!(verify_signature: true, client: nil, nonce: nil, state: nil, access_token: nil, code: nil)
22
29
  verify_signature! if verify_signature
23
30
  verify_claims! client, nonce, state, access_token, code
data/lib/apple_id.rb CHANGED
@@ -54,5 +54,6 @@ end
54
54
  require 'apple_id/client'
55
55
  require 'apple_id/access_token'
56
56
  require 'apple_id/id_token'
57
+ require 'apple_id/id_token/real_user_status'
57
58
  require 'apple_id/jwks'
58
59
  require 'apple_id/api/user_migration'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack-oauth2
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '1.21'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '1.21'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: openid_connect
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.7
33
+ version: 1.3.0
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.1.7
40
+ version: 1.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -129,6 +129,7 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - ".github/FUNDING.yml"
132
133
  - ".gitignore"
133
134
  - ".rspec"
134
135
  - ".travis.yml"
@@ -146,6 +147,7 @@ files:
146
147
  - lib/apple_id/api/user_migration.rb
147
148
  - lib/apple_id/client.rb
148
149
  - lib/apple_id/id_token.rb
150
+ - lib/apple_id/id_token/real_user_status.rb
149
151
  - lib/apple_id/jwks.rb
150
152
  homepage: https://github.com/nov/apple_id
151
153
  licenses:
@@ -166,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
168
  - !ruby/object:Gem::Version
167
169
  version: '0'
168
170
  requirements: []
169
- rubygems_version: 3.0.3
171
+ rubygems_version: 3.1.6
170
172
  signing_key:
171
173
  specification_version: 4
172
174
  summary: Sign-in with Apple Backend