gamecenter-auth 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
- SHA1:
3
- metadata.gz: 888c7e5a931c6a0cd09e551c7acdc6b04681ec0e
4
- data.tar.gz: 819308cb201905a5d7ec099097ca084e76dde576
2
+ SHA256:
3
+ metadata.gz: a29d4d022c9382e5e02d4ab01821a51975dd6195254cbaf9b6c4a7afd33be0d6
4
+ data.tar.gz: 0c2c4f3dd75db8fb35809b5c6f655b8061203c556155b5ab94896dcba78a3aea
5
5
  SHA512:
6
- metadata.gz: fbb6abca0db31e2894bd28ee25c165b85bf7a688d4c5f4199c8ac4f8f28e5d5ad55f4b33523439fb55947433a2196ffcf1a3fc2b965dae0f52c0194593f131ee
7
- data.tar.gz: daeb7d88dc991b2803c987d161d5e4411356f01004dc2b5a5b66a27bb676c1e94e1830267e76d954cc0ab4b3c64c32f15a59aa87c2395b58e1c91976ad7f99b8
6
+ metadata.gz: 7988bd78f1ad655f0ffe0246cda7b1d0d24a2703184b427055289c1072be857b79fc39e5fe493ee2245b66ad099357e514f428ead350189a90664aab43e130a7
7
+ data.tar.gz: 4baafd6443cec70cbca970cee1862a0e1d496264f484e07722209e44d02d2b980534e2c77335bd8f9682024c49ad18ebb891f7f620d6d51f7671a006e500569c
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Ruby gem for iOS GameKit/Game Center player authentication using the "Identity Verification Signature" provided by the generateIdentityVerificationSignatureWithCompletionHandler method in Apple's GameKit framework
4
4
 
5
+ This gem fully replaces the gamekit-auth-ruby gem previously available at https://rubygems.org/gems/gamekit-auth-ruby and https://github.com/bichinger/gamekit-auth-ruby.
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -6,8 +6,8 @@ require 'gamecenter/auth/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'gamecenter-auth'
8
8
  spec.version = Gamecenter::Auth::VERSION
9
- spec.authors = ['Niklas Bichinger', 'Kai Machemehl']
10
- spec.email = %w(niklas@bichinger.de k.machemehl@bichinger.de)
9
+ spec.authors = ['Niklas Bichinger']
10
+ spec.email = %w(niklas@bichinger.de)
11
11
 
12
12
  spec.summary = %q{Server-side iOS GameKit/Game Center player authentication}
13
13
  spec.description = %q{Server-side iOS GameKit/Game Center player authentication using the "Identity Verification Signature" provided by the method generateIdentityVerificationSignatureWithCompletionHandler in Apple's GameKit framework}
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_development_dependency 'bundler', '~> 1.10'
23
- spec.add_development_dependency 'rake', '~> 10.0'
22
+ spec.add_development_dependency 'bundler'
23
+ spec.add_development_dependency 'rake'
24
24
  spec.add_development_dependency 'rspec'
25
25
  end
@@ -2,6 +2,7 @@ require 'gamecenter/auth/version'
2
2
  require 'uri'
3
3
  require 'logger'
4
4
  require 'base64'
5
+ require 'openssl'
5
6
 
6
7
  module Gamecenter
7
8
  class Auth
@@ -18,39 +19,50 @@ module Gamecenter
18
19
  @@request_public_key_read_timeout = 5 # seconds
19
20
  @@request_public_key_ssl_timeout = 5 # seconds
20
21
 
21
- @@ca_certificate = OpenSSL::X509::Certificate.new <<EOCACERT
22
- -----BEGIN CERTIFICATE-----
23
- MIIFWTCCBEGgAwIBAgIQPXjX+XZJYLJhffTwHsqGKjANBgkqhkiG9w0BAQsFADCB
24
- yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
25
- ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp
26
- U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW
27
- ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IEN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R0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRow
44
- GAYDVQQDExFTeW1hbnRlY1BLSS0xLTU2NzAdBgNVHQ4EFgQUljtT8Hkzl699g+8u
45
- K8zKt4YecmYwHwYDVR0jBBgwFoAUf9Nlp8Ld7LvwMAnzQzn6Aq8zMTMwDQYJKoZI
46
- hvcNAQELBQADggEBABOFGh5pqTf3oL2kr34dYVP+nYxeDKZ1HngXI9397BoDVTn7
47
- cZXHZVqnjjDSRFph23Bv2iEFwi5zuknx0ZP+XcnNXgPgiZ4/dB7X9ziLqdbPuzUv
48
- M1ioklbRyE07guZ5hBb8KLCxR/Mdoj7uh9mmf6RWpT+thC4p3ny8qKqjPQQB6rqT
49
- og5QIikXTIfkOhFf1qQliZsFay+0yQFMJ3sLrBkFIqBgFT/ayftNTI/7cmd3/SeU
50
- x7o1DohJ/o39KK9KEr0Ns5cF3kQMFfo2KwPcwVAB8aERXRTl4r0nS1S+K4ReD6bD
51
- dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE=
52
- -----END CERTIFICATE-----
53
- EOCACERT
22
+ @@ca_certificate = OpenSSL::X509::Certificate.new <<~EOCACERT
23
+ -----BEGIN CERTIFICATE-----
24
+ MIIHbDCCBVSgAwIBAgIQAwuBj1pc45FkhpmTbIvZOjANBgkqhkiG9w0BAQsFADBp
25
+ MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xQTA/BgNVBAMT
26
+ OERpZ2lDZXJ0IFRydXN0ZWQgRzQgQ29kZSBTaWduaW5nIFJTQTQwOTYgU0hBMzg0
27
+ IDIwMjEgQ0ExMB4XDTIxMDcyOTAwMDAwMFoXDTIyMDcyODIzNTk1OVowcTELMAkG
28
+ A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcTCUN1cGVydGlu
29
+ bzETMBEGA1UEChMKQXBwbGUgSW5jLjEPMA0GA1UECxMGR0MgU1JFMRMwEQ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
+ 6yMXdAi9pEs9Aj13LAW74MCDrToCzoa2ZaisvxbRfQSpXryUQEnqpuQqCVjglxaJ
61
+ FIMhV0DRWIaLF9vhv6zF9kL77qr+arLd/wJlXubtD/P9tJZRlEh6/0iHvyyH2+Rg
62
+ u05//UQ7ex/j15PLFSVkQXIFPpN1ZgN0FrJKAJOL+MWiB5RncKxjin8Y9xfC3XKS
63
+ fbV6c7J9AGi8bE8aFMM2ISg7v/dOQzcLPPScWbe5cTg=
64
+ -----END CERTIFICATE-----
65
+ EOCACERT
54
66
 
55
67
  # Verifies the identity of the given player. Takes all return values from GameKit's generateIdentityVerificationSignatureWithCompletionHandler method.
56
68
  # @see https://developer.apple.com/library/prerelease/ios/documentation/GameKit/Reference/GKLocalPlayer_Ref/index.html#//apple_ref/occ/instm/GKLocalPlayer/generateIdentityVerificationSignatureWithCompletionHandler:
@@ -88,7 +100,7 @@ EOCACERT
88
100
  true
89
101
  end
90
102
 
91
- # Verifies that the public key url originates from one of Apple's secured servers
103
+ # Verifies that the public key url originates from one of Apple's secured servers.
92
104
  # @param [String] public_key_url The publicKeyURL property returned from the GameKit framework
93
105
  # @return [Boolean] true if url verification was successful, false if url fails verification
94
106
  def verify_public_key_url(public_key_url)
@@ -103,7 +115,7 @@ EOCACERT
103
115
  url_ok
104
116
  end
105
117
 
106
- # Checks if given public key certificate can be verified with the CA certificate
118
+ # Checks if given public key certificate can be verified with the CA certificate.
107
119
  # @param [OpenSSL::X509::Certificate] public_key_cert a previously fetched public key certificate object
108
120
  # @return [Boolean] true if certificate could be verified against the CA certificate, false if it couldn't
109
121
  def verify_public_key_certificate(public_key_cert)
@@ -113,7 +125,7 @@ EOCACERT
113
125
  verified && no_errors
114
126
  end
115
127
 
116
- # Verifies the signature of given payload with given public key certificate
128
+ # Verifies the signature of given payload with given public key certificate.
117
129
  # @param [OpenSSL:X509::Certificate] public_key_cert a previously fetched public key certificate object
118
130
  # @param [String] signature the signature to be verified
119
131
  # @param [String] payload the payload to verify the signature for
@@ -1,5 +1,5 @@
1
1
  module Gamecenter
2
2
  class Auth
3
- VERSION = '1.0.1'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,44 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamecenter-auth
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
  - Niklas Bichinger
8
- - Kai Machemehl
9
- autorequire:
8
+ autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2021-08-07 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
- - - "~>"
17
+ - - ">="
19
18
  - !ruby/object:Gem::Version
20
- version: '1.10'
19
+ version: '0'
21
20
  type: :development
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
- - - "~>"
24
+ - - ">="
26
25
  - !ruby/object:Gem::Version
27
- version: '1.10'
26
+ version: '0'
28
27
  - !ruby/object:Gem::Dependency
29
28
  name: rake
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
- - - "~>"
31
+ - - ">="
33
32
  - !ruby/object:Gem::Version
34
- version: '10.0'
33
+ version: '0'
35
34
  type: :development
36
35
  prerelease: false
37
36
  version_requirements: !ruby/object:Gem::Requirement
38
37
  requirements:
39
- - - "~>"
38
+ - - ">="
40
39
  - !ruby/object:Gem::Version
41
- version: '10.0'
40
+ version: '0'
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: rspec
44
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,7 +57,6 @@ description: Server-side iOS GameKit/Game Center player authentication using the
58
57
  in Apple's GameKit framework
59
58
  email:
60
59
  - niklas@bichinger.de
61
- - k.machemehl@bichinger.de
62
60
  executables: []
63
61
  extensions: []
64
62
  extra_rdoc_files: []
@@ -79,7 +77,7 @@ homepage: https://github.com/bichinger/gamecenter-auth
79
77
  licenses:
80
78
  - MIT
81
79
  metadata: {}
82
- post_install_message:
80
+ post_install_message:
83
81
  rdoc_options: []
84
82
  require_paths:
85
83
  - lib
@@ -94,9 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
92
  - !ruby/object:Gem::Version
95
93
  version: '0'
96
94
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.4.8
99
- signing_key:
95
+ rubygems_version: 3.2.24
96
+ signing_key:
100
97
  specification_version: 4
101
98
  summary: Server-side iOS GameKit/Game Center player authentication
102
99
  test_files: []