passkit 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/passkit/version.rb +1 -1
- metadata +1 -19
- data/.env.test +0 -8
- data/.example.env +0 -8
- data/.semaphore/release.yml +0 -21
- data/.semaphore/semaphore.yml +0 -42
- data/.standard.yml +0 -2
- data/Gemfile +0 -12
- data/Rakefile +0 -20
- data/bin/console +0 -15
- data/bin/generate_test_certificates +0 -55
- data/bin/setup +0 -8
- data/docs/membership.png +0 -0
- data/docs/passkit_environment_variables.md +0 -53
- data/docs/step1.png +0 -0
- data/docs/step2.png +0 -0
- data/docs/step3.png +0 -0
- data/docs/step4.png +0 -0
- data/docs/step5.png +0 -0
- data/docs/wallet.png +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ba766112a286c8570851338476fee913b5eff4575cfc2fc6eeb91fb2617e5b0
|
|
4
|
+
data.tar.gz: 7b28c2c662b071529705a5fa409da39d42442eb702547a25ad960369d0c8500d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53782d8dd386090a3fda13fa70ebf39a82d06afe3f00fd83cc54845cdeb59b5f0d0a414fe4e151e773451b4d18a3331720acfbd0ebd2e7eb6238effb1b8ab719
|
|
7
|
+
data.tar.gz: f37f52f4b3f105e1a5dde4c2613ffa35372d2c5734b8da28e3551f84bf978742c4d1a257ee380c46fa950fbba04e9f22fc37c67dfa05de7149c0c902735d91f7
|
data/CHANGELOG.md
CHANGED
data/lib/passkit/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: passkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alessandro Rodi
|
|
@@ -143,17 +143,10 @@ executables: []
|
|
|
143
143
|
extensions: []
|
|
144
144
|
extra_rdoc_files: []
|
|
145
145
|
files:
|
|
146
|
-
- ".env.test"
|
|
147
|
-
- ".example.env"
|
|
148
|
-
- ".semaphore/release.yml"
|
|
149
|
-
- ".semaphore/semaphore.yml"
|
|
150
|
-
- ".standard.yml"
|
|
151
146
|
- CHANGELOG.md
|
|
152
147
|
- CODE_OF_CONDUCT.md
|
|
153
|
-
- Gemfile
|
|
154
148
|
- LICENSE.txt
|
|
155
149
|
- README.md
|
|
156
|
-
- Rakefile
|
|
157
150
|
- app/assets/config/passkit_manifest.js
|
|
158
151
|
- app/assets/images/passkit/add_to_apple_wallet_de.png
|
|
159
152
|
- app/assets/images/passkit/add_to_apple_wallet_en.png
|
|
@@ -181,18 +174,7 @@ files:
|
|
|
181
174
|
- app/views/passkit/dashboard/previews/index.html.erb
|
|
182
175
|
- app/views/passkit/example_mailer/example_email.html.erb
|
|
183
176
|
- app/views/shared/passkit/_navigation.html.erb
|
|
184
|
-
- bin/console
|
|
185
|
-
- bin/generate_test_certificates
|
|
186
|
-
- bin/setup
|
|
187
177
|
- config/routes.rb
|
|
188
|
-
- docs/membership.png
|
|
189
|
-
- docs/passkit_environment_variables.md
|
|
190
|
-
- docs/step1.png
|
|
191
|
-
- docs/step2.png
|
|
192
|
-
- docs/step3.png
|
|
193
|
-
- docs/step4.png
|
|
194
|
-
- docs/step5.png
|
|
195
|
-
- docs/wallet.png
|
|
196
178
|
- lib/generators/passkit/install_generator.rb
|
|
197
179
|
- lib/generators/templates/create_passkit_tables.rb.tt
|
|
198
180
|
- lib/generators/templates/passkit.rb
|
data/.env.test
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
PASSKIT_WEB_SERVICE_HOST=https://localhost:3000
|
|
2
|
-
PASSKIT_CERTIFICATE_KEY=passkit
|
|
3
|
-
PASSKIT_PRIVATE_P12_CERTIFICATE=certificates/certificate.p12
|
|
4
|
-
PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE=certificates/intermediate.cer
|
|
5
|
-
PASSKIT_APPLE_TEAM_IDENTIFIER=XXXXXXXXXX
|
|
6
|
-
PASSKIT_PASS_TYPE_IDENTIFIER=pass.com.example.pass
|
|
7
|
-
PASSKIT_DASHBOARD_USERNAME=admin
|
|
8
|
-
PASSKIT_DASHBOARD_PASSWORD=admin
|
data/.example.env
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
PASSKIT_WEB_SERVICE_HOST=https://localhost:3000
|
|
2
|
-
PASSKIT_CERTIFICATE_KEY=theCertPassword
|
|
3
|
-
PASSKIT_PRIVATE_P12_CERTIFICATE=path/to/certificate.p12
|
|
4
|
-
PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE=path/to/AppleWWDRCA.cer
|
|
5
|
-
PASSKIT_APPLE_TEAM_IDENTIFIER=XXXXXXXXXX
|
|
6
|
-
PASSKIT_PASS_TYPE_IDENTIFIER=pass.com.example.pass
|
|
7
|
-
PASSKIT_DASHBOARD_USERNAME=admin
|
|
8
|
-
PASSKIT_DASHBOARD_PASSWORD=admin
|
data/.semaphore/release.yml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
version: "v1.0"
|
|
2
|
-
name: Release gem
|
|
3
|
-
agent:
|
|
4
|
-
machine:
|
|
5
|
-
type: f1-standard-2
|
|
6
|
-
os_image: ubuntu2204
|
|
7
|
-
|
|
8
|
-
blocks:
|
|
9
|
-
- name: publish
|
|
10
|
-
execution_time_limit:
|
|
11
|
-
minutes: 10
|
|
12
|
-
task:
|
|
13
|
-
secrets:
|
|
14
|
-
- name: rubygems
|
|
15
|
-
jobs:
|
|
16
|
-
- name: build and push to rubygems.org
|
|
17
|
-
commands:
|
|
18
|
-
- checkout
|
|
19
|
-
- sem-version ruby 3.3
|
|
20
|
-
- gem build passkit.gemspec
|
|
21
|
-
- gem push passkit-*.gem < /dev/null
|
data/.semaphore/semaphore.yml
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
version: "v1.0"
|
|
2
|
-
name: passkit
|
|
3
|
-
agent:
|
|
4
|
-
machine:
|
|
5
|
-
type: f1-standard-2
|
|
6
|
-
os_image: ubuntu2204
|
|
7
|
-
auto_cancel:
|
|
8
|
-
running:
|
|
9
|
-
when: "true"
|
|
10
|
-
|
|
11
|
-
blocks:
|
|
12
|
-
- name: tests
|
|
13
|
-
execution_time_limit:
|
|
14
|
-
minutes: 10
|
|
15
|
-
task:
|
|
16
|
-
env_vars:
|
|
17
|
-
- name: RAILS_ENV
|
|
18
|
-
value: test
|
|
19
|
-
- name: BUNDLE_PATH
|
|
20
|
-
value: vendor/bundle
|
|
21
|
-
prologue:
|
|
22
|
-
commands:
|
|
23
|
-
- checkout --use-cache
|
|
24
|
-
- sem-version ruby 3.3
|
|
25
|
-
- cache restore gems-$(checksum passkit.gemspec)-$(checksum Gemfile)
|
|
26
|
-
- bundle install -j 4
|
|
27
|
-
- cache store gems-$(checksum passkit.gemspec)-$(checksum Gemfile) vendor/bundle
|
|
28
|
-
- bin/generate_test_certificates
|
|
29
|
-
jobs:
|
|
30
|
-
- name: linter
|
|
31
|
-
commands:
|
|
32
|
-
- bundle exec standardrb
|
|
33
|
-
- name: tests
|
|
34
|
-
commands:
|
|
35
|
-
- bundle exec rake test
|
|
36
|
-
- name: system tests
|
|
37
|
-
commands:
|
|
38
|
-
- bundle exec rake test:system
|
|
39
|
-
|
|
40
|
-
promotions:
|
|
41
|
-
- name: Release gem
|
|
42
|
-
pipeline_file: release.yml
|
data/.standard.yml
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "rake/testtask"
|
|
5
|
-
|
|
6
|
-
Rake::TestTask.new(:test) do |t|
|
|
7
|
-
t.libs << "test"
|
|
8
|
-
t.libs << "lib"
|
|
9
|
-
t.test_files = FileList["test/**/test_*.rb"]
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
Rake::TestTask.new("test:system") do |t|
|
|
13
|
-
t.libs << "test"
|
|
14
|
-
t.libs << "lib"
|
|
15
|
-
t.test_files = FileList["test/system/**/*_test.rb"]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
require "standard/rake"
|
|
19
|
-
|
|
20
|
-
task default: %i[test standard]
|
data/bin/console
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "bundler/setup"
|
|
5
|
-
require "passkit"
|
|
6
|
-
|
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
-
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
-
# require "pry"
|
|
12
|
-
# Pry.start
|
|
13
|
-
|
|
14
|
-
require "irb"
|
|
15
|
-
IRB.start(__FILE__)
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
# Generates a self-signed pass certificate and a fake "Apple intermediate"
|
|
5
|
-
# certificate, so that the test suite can sign passes without a real Apple
|
|
6
|
-
# Developer certificate.
|
|
7
|
-
|
|
8
|
-
require "openssl"
|
|
9
|
-
require "fileutils"
|
|
10
|
-
|
|
11
|
-
output_directory = File.expand_path("../test/dummy/certificates", __dir__)
|
|
12
|
-
password = ENV.fetch("PASSKIT_CERTIFICATE_KEY", "passkit")
|
|
13
|
-
|
|
14
|
-
FileUtils.mkdir_p(output_directory)
|
|
15
|
-
|
|
16
|
-
intermediate_key = OpenSSL::PKey::RSA.new(2048)
|
|
17
|
-
intermediate_certificate = OpenSSL::X509::Certificate.new
|
|
18
|
-
intermediate_certificate.version = 2
|
|
19
|
-
intermediate_certificate.serial = 1
|
|
20
|
-
intermediate_certificate.subject = OpenSSL::X509::Name.parse("/CN=Passkit Test Intermediate CA")
|
|
21
|
-
intermediate_certificate.issuer = intermediate_certificate.subject
|
|
22
|
-
intermediate_certificate.public_key = intermediate_key.public_key
|
|
23
|
-
intermediate_certificate.not_before = Time.now - 60
|
|
24
|
-
intermediate_certificate.not_after = Time.now + (10 * 365 * 24 * 60 * 60)
|
|
25
|
-
|
|
26
|
-
extension_factory = OpenSSL::X509::ExtensionFactory.new
|
|
27
|
-
extension_factory.subject_certificate = intermediate_certificate
|
|
28
|
-
extension_factory.issuer_certificate = intermediate_certificate
|
|
29
|
-
intermediate_certificate.add_extension(extension_factory.create_extension("basicConstraints", "CA:TRUE", true))
|
|
30
|
-
intermediate_certificate.add_extension(extension_factory.create_extension("keyUsage", "keyCertSign, cRLSign", true))
|
|
31
|
-
intermediate_certificate.sign(intermediate_key, OpenSSL::Digest.new("SHA256"))
|
|
32
|
-
|
|
33
|
-
pass_key = OpenSSL::PKey::RSA.new(2048)
|
|
34
|
-
pass_certificate = OpenSSL::X509::Certificate.new
|
|
35
|
-
pass_certificate.version = 2
|
|
36
|
-
pass_certificate.serial = 2
|
|
37
|
-
pass_certificate.subject = OpenSSL::X509::Name.parse("/CN=#{ENV.fetch("PASSKIT_PASS_TYPE_IDENTIFIER", "pass.com.example.pass")}")
|
|
38
|
-
pass_certificate.issuer = intermediate_certificate.subject
|
|
39
|
-
pass_certificate.public_key = pass_key.public_key
|
|
40
|
-
pass_certificate.not_before = Time.now - 60
|
|
41
|
-
pass_certificate.not_after = Time.now + (10 * 365 * 24 * 60 * 60)
|
|
42
|
-
|
|
43
|
-
extension_factory = OpenSSL::X509::ExtensionFactory.new
|
|
44
|
-
extension_factory.subject_certificate = pass_certificate
|
|
45
|
-
extension_factory.issuer_certificate = intermediate_certificate
|
|
46
|
-
pass_certificate.add_extension(extension_factory.create_extension("basicConstraints", "CA:FALSE", true))
|
|
47
|
-
pass_certificate.add_extension(extension_factory.create_extension("keyUsage", "digitalSignature", true))
|
|
48
|
-
pass_certificate.sign(intermediate_key, OpenSSL::Digest.new("SHA256"))
|
|
49
|
-
|
|
50
|
-
p12 = OpenSSL::PKCS12.create(password, "Passkit Test Certificate", pass_key, pass_certificate)
|
|
51
|
-
|
|
52
|
-
File.binwrite(File.join(output_directory, "intermediate.cer"), intermediate_certificate.to_der)
|
|
53
|
-
File.binwrite(File.join(output_directory, "certificate.p12"), p12.to_der)
|
|
54
|
-
|
|
55
|
-
puts "Certificates written to #{output_directory}"
|
data/bin/setup
DELETED
data/docs/membership.png
DELETED
|
Binary file
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Setup Passkit Environment variables
|
|
2
|
-
|
|
3
|
-
### `PASSKIT_WEB_SERVICE_HOST`
|
|
4
|
-
|
|
5
|
-
This is the host where your Rails app is running. It is used to generate the URLs for the passes.
|
|
6
|
-
When the device wants to update the Pass, it will invoke services on this host.
|
|
7
|
-
In production, it will simply be your domain name, but in development you can use [ngrok](https://ngrok.com/) to expose your local server to the internet.
|
|
8
|
-
|
|
9
|
-
**Remember that it must always start with `https://`.**
|
|
10
|
-
|
|
11
|
-
### `PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE`
|
|
12
|
-
|
|
13
|
-
This is the easy one.
|
|
14
|
-
Head to https://www.apple.com/certificateauthority/ and download the latest Apple Intermediate Certificate Worldwide Developer Relations.
|
|
15
|
-
You might want to choose the one with the longest expiration date. PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE is the path to the certificate.
|
|
16
|
-
|
|
17
|
-
### `PASSKIT_APPLE_TEAM_IDENTIFIER`
|
|
18
|
-
|
|
19
|
-
You find this in your Apple Developer dashboard, under Membership.
|
|
20
|
-
|
|
21
|
-

|
|
22
|
-
|
|
23
|
-
### `PASSKIT_PASS_TYPE_IDENTIFIER`, `PASSKIT_PRIVATE_P12_CERTIFICATE` and `PASSKIT_CERTIFICATE_KEY`
|
|
24
|
-
|
|
25
|
-
Head to your Apple Developers console and generate a new certificate.
|
|
26
|
-
|
|
27
|
-

|
|
28
|
-
|
|
29
|
-

|
|
30
|
-
|
|
31
|
-

|
|
32
|
-
|
|
33
|
-
The identifier is the `PASSKIT_PASS_TYPE_IDENTIFIER` variable.
|
|
34
|
-
|
|
35
|
-
**Note**: When renewing your certificate, make sure that this identifier stays the same as before. Changing this identifier will
|
|
36
|
-
require existing passes to be regenerated, as they will otherwise no longer be updateable via the web service URL.
|
|
37
|
-
|
|
38
|
-
Now, create a certificate signing request: https://developer.apple.com/help/account/create-certificates/create-a-certificate-signing-request/
|
|
39
|
-
|
|
40
|
-
And create the certificate:
|
|
41
|
-
|
|
42
|
-

|
|
43
|
-
|
|
44
|
-
At the end, you'll have a `pass.cer` file.
|
|
45
|
-
|
|
46
|
-
Open it in the Keychain Access tool and export it (you must be in the My Certificates tab):
|
|
47
|
-
|
|
48
|
-

|
|
49
|
-
|
|
50
|
-
Set a password and get your p12 file. The path to this file is the `PASSKIT_PRIVATE_P12_CERTIFICATE` variable.
|
|
51
|
-
Save the password. This is the `PASSKIT_CERTIFICATE_KEY` variable.
|
|
52
|
-
|
|
53
|
-
`PKCS12_parse: unsupported`: you might encounter this issue: https://help.heroku.com/88GYDTB2/how-do-i-configure-openssl-to-allow-the-use-of-legacy-cryptographic-algorithms
|
data/docs/step1.png
DELETED
|
Binary file
|
data/docs/step2.png
DELETED
|
Binary file
|
data/docs/step3.png
DELETED
|
Binary file
|
data/docs/step4.png
DELETED
|
Binary file
|
data/docs/step5.png
DELETED
|
Binary file
|
data/docs/wallet.png
DELETED
|
Binary file
|