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 +5 -5
- data/README.md +2 -0
- data/gamecenter-auth.gemspec +4 -4
- data/lib/gamecenter/auth.rb +48 -36
- data/lib/gamecenter/auth/version.rb +1 -1
- metadata +14 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a29d4d022c9382e5e02d4ab01821a51975dd6195254cbaf9b6c4a7afd33be0d6
|
4
|
+
data.tar.gz: 0c2c4f3dd75db8fb35809b5c6f655b8061203c556155b5ab94896dcba78a3aea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
data/gamecenter-auth.gemspec
CHANGED
@@ -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'
|
10
|
-
spec.email = %w(niklas@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'
|
23
|
-
spec.add_development_dependency 'rake'
|
22
|
+
spec.add_development_dependency 'bundler'
|
23
|
+
spec.add_development_dependency 'rake'
|
24
24
|
spec.add_development_dependency 'rspec'
|
25
25
|
end
|
data/lib/gamecenter/auth.rb
CHANGED
@@ -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
|
22
|
-
-----BEGIN CERTIFICATE-----
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-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J0VHJ1c3RlZEc0Q29kZVNpZ25pbmdSU0E0MDk2U0hB
|
52
|
+
Mzg0MjAyMUNBMS5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEA
|
53
|
+
uk71YLf55ne94hEeQtYsjCn38Tw3h78CH195J8H4T4r2p7p9MPjrA2zz+ZXza+kb
|
54
|
+
z5OTZ9k1/nu9vKnh4ljZS33uTh5AcdWhQNUeSuByjhVu+YTnVKqVYH/jaZXEFFe/
|
55
|
+
4/n23Shn2xN5jtkCEwYeqEaO6+8uBCFQldnUgbSag2Le9s/lICUJvGsKTAUhEGrK
|
56
|
+
R4u4OyJGGk8JO5Ozbnoe1AGBK9pKMWOAl+SY/b/CLLTgypwZwD/6xszM1MhcfzPS
|
57
|
+
aBbJ7MX2Uiq91/PNJdPnZI/PoqAQEzDL+5MZnwKwNpeC1rH8ZhlCn1BXbxI5jemw
|
58
|
+
Tfo2U6cDN1ObJ4LBzsVioWA0KoNnp4eWkMmbGGH5iWRcwoCjhkzot8VvXoll0uSe
|
59
|
+
F9v1RMOCM+Vcr++MYdJxdoQDNMunEoUnpHQbreHSLMcwPUhSNO4+EtZA86hob2u0
|
60
|
+
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
|
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
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niklas Bichinger
|
8
|
-
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
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: '
|
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: '
|
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: '
|
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: '
|
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
|
-
|
98
|
-
|
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: []
|