passkit 0.8.1 → 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 +9 -0
- data/README.md +8 -2
- data/app/controllers/passkit/api/v1/passes_controller.rb +2 -2
- data/app/models/passkit/pass.rb +1 -1
- data/lib/passkit/base_pass.rb +5 -5
- data/lib/passkit/example_store_card.rb +7 -7
- data/lib/passkit/generator.rb +1 -1
- data/lib/passkit/version.rb +1 -1
- data/lib/passkit.rb +2 -2
- metadata +4 -18
- data/.example.env +0 -8
- data/.standard.yml +0 -2
- data/Gemfile +0 -12
- data/Rakefile +0 -14
- data/bin/console +0 -15
- 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
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [0.8.3]
|
|
2
|
+
- Exclude development and test files from the packaged gem.
|
|
3
|
+
|
|
4
|
+
## [0.8.2]
|
|
5
|
+
- Set up the Semaphore CI pipeline with a manual promotion to release the gem.
|
|
6
|
+
- Self-signed certificates for the test suite, so it runs without an Apple Developer certificate.
|
|
7
|
+
- Code formatting cleanup (standardrb).
|
|
8
|
+
- Relax the `sqlite3` development dependency to `>= 1.4`.
|
|
9
|
+
|
|
1
10
|
## [0.8.1]
|
|
2
11
|
- [#45](https://github.com/coorasse/passkit/pull/45): Fix broken build.
|
|
3
12
|
|
data/README.md
CHANGED
|
@@ -188,9 +188,15 @@ or the certificate trust chain could not be verified." the certificate (p12) mig
|
|
|
188
188
|
|
|
189
189
|
## Development
|
|
190
190
|
|
|
191
|
-
After checking out the repo, run `bin/setup` to install dependencies
|
|
191
|
+
After checking out the repo, run `bin/setup` to install dependencies and to generate the self-signed certificates
|
|
192
|
+
used to sign the passes in the test suite. Then, run `rake test` to run the tests and `rake test:system` to run the
|
|
193
|
+
system tests (they require Chrome). You can also run `bin/console` for an interactive prompt that will allow you to
|
|
194
|
+
experiment.
|
|
192
195
|
|
|
193
|
-
|
|
196
|
+
The test suite reads its configuration from `.env.test`, so no Apple Developer certificate is needed to run it.
|
|
197
|
+
Values defined in your own `.env` take precedence, in case you want to run the dummy app with real certificates.
|
|
198
|
+
|
|
199
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
194
200
|
|
|
195
201
|
## Contributing
|
|
196
202
|
|
|
@@ -12,10 +12,10 @@ module Passkit
|
|
|
12
12
|
Passkit::Factory.create_pass(@payload[:pass_class], collection_item)
|
|
13
13
|
end
|
|
14
14
|
file = Passkit::Generator.compress_passes_files(files)
|
|
15
|
-
send_file(file, type:
|
|
15
|
+
send_file(file, type: "application/vnd.apple.pkpasses", disposition: "attachment")
|
|
16
16
|
else
|
|
17
17
|
file = Passkit::Factory.create_pass(@payload[:pass_class], @generator)
|
|
18
|
-
send_file(file, type:
|
|
18
|
+
send_file(file, type: "application/vnd.apple.pkpass", disposition: "attachment")
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
data/app/models/passkit/pass.rb
CHANGED
data/lib/passkit/base_pass.rb
CHANGED
|
@@ -189,10 +189,10 @@ module Passkit
|
|
|
189
189
|
|
|
190
190
|
# QRCode by default
|
|
191
191
|
def barcode
|
|
192
|
-
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
{messageEncoding: "iso-8859-1",
|
|
193
|
+
format: "PKBarcodeFormatQR",
|
|
194
|
+
message: "https://github.com/coorasse/passkit",
|
|
195
|
+
altText: "https://github.com/coorasse/passkit"}
|
|
196
196
|
end
|
|
197
197
|
|
|
198
198
|
# Barcode example
|
|
@@ -231,7 +231,7 @@ module Passkit
|
|
|
231
231
|
false
|
|
232
232
|
end
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
private
|
|
235
235
|
|
|
236
236
|
def folder_name
|
|
237
237
|
self.class.name.demodulize.underscore
|
|
@@ -39,10 +39,10 @@ module Passkit
|
|
|
39
39
|
# QRCode by default
|
|
40
40
|
def barcodes
|
|
41
41
|
[
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
{messageEncoding: "iso-8859-1",
|
|
43
|
+
format: "PKBarcodeFormatQR",
|
|
44
|
+
message: "https://github.com/coorasse/passkit",
|
|
45
|
+
altText: "https://github.com/coorasse/passkit"}
|
|
46
46
|
]
|
|
47
47
|
end
|
|
48
48
|
|
|
@@ -59,12 +59,12 @@ module Passkit
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def relevant_date
|
|
62
|
-
Time.current.strftime(
|
|
62
|
+
Time.current.strftime("%Y-%m-%dT%H:%M:%S%:z")
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def expiration_date
|
|
66
66
|
# Expire the pass tomorrow
|
|
67
|
-
(Time.current + 1.day).strftime(
|
|
67
|
+
(Time.current + 1.day).strftime("%Y-%m-%dT%H:%M:%S%:z")
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def semantics
|
|
@@ -121,7 +121,7 @@ module Passkit
|
|
|
121
121
|
}]
|
|
122
122
|
end
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
private
|
|
125
125
|
|
|
126
126
|
def folder_name
|
|
127
127
|
self.class.name.demodulize.underscore
|
data/lib/passkit/generator.rb
CHANGED
data/lib/passkit/version.rb
CHANGED
data/lib/passkit.rb
CHANGED
|
@@ -22,7 +22,7 @@ module Passkit
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def self.configured?
|
|
25
|
-
|
|
25
|
+
configuration&.configured?
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
class Configuration
|
|
@@ -68,7 +68,7 @@ module Passkit
|
|
|
68
68
|
# Optional
|
|
69
69
|
@skip_verification = false
|
|
70
70
|
@web_service_host = ENV["PASSKIT_WEB_SERVICE_HOST"] || "https://localhost:3000"
|
|
71
|
-
@available_passes = {
|
|
71
|
+
@available_passes = {"Passkit::ExampleStoreCard" => -> {}}
|
|
72
72
|
@format_version = ENV["PASSKIT_FORMAT_VERSION"] || 1
|
|
73
73
|
@dashboard_username = ENV["PASSKIT_DASHBOARD_USERNAME"]
|
|
74
74
|
@dashboard_password = ENV["PASSKIT_DASHBOARD_PASSWORD"]
|
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
|
|
@@ -41,14 +41,14 @@ dependencies:
|
|
|
41
41
|
name: sqlite3
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
|
-
- - "
|
|
44
|
+
- - ">="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
46
|
version: '1.4'
|
|
47
47
|
type: :development
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
|
-
- - "
|
|
51
|
+
- - ">="
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
53
|
version: '1.4'
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
@@ -143,14 +143,10 @@ executables: []
|
|
|
143
143
|
extensions: []
|
|
144
144
|
extra_rdoc_files: []
|
|
145
145
|
files:
|
|
146
|
-
- ".example.env"
|
|
147
|
-
- ".standard.yml"
|
|
148
146
|
- CHANGELOG.md
|
|
149
147
|
- CODE_OF_CONDUCT.md
|
|
150
|
-
- Gemfile
|
|
151
148
|
- LICENSE.txt
|
|
152
149
|
- README.md
|
|
153
|
-
- Rakefile
|
|
154
150
|
- app/assets/config/passkit_manifest.js
|
|
155
151
|
- app/assets/images/passkit/add_to_apple_wallet_de.png
|
|
156
152
|
- app/assets/images/passkit/add_to_apple_wallet_en.png
|
|
@@ -178,17 +174,7 @@ files:
|
|
|
178
174
|
- app/views/passkit/dashboard/previews/index.html.erb
|
|
179
175
|
- app/views/passkit/example_mailer/example_email.html.erb
|
|
180
176
|
- app/views/shared/passkit/_navigation.html.erb
|
|
181
|
-
- bin/console
|
|
182
|
-
- bin/setup
|
|
183
177
|
- config/routes.rb
|
|
184
|
-
- docs/membership.png
|
|
185
|
-
- docs/passkit_environment_variables.md
|
|
186
|
-
- docs/step1.png
|
|
187
|
-
- docs/step2.png
|
|
188
|
-
- docs/step3.png
|
|
189
|
-
- docs/step4.png
|
|
190
|
-
- docs/step5.png
|
|
191
|
-
- docs/wallet.png
|
|
192
178
|
- lib/generators/passkit/install_generator.rb
|
|
193
179
|
- lib/generators/templates/create_passkit_tables.rb.tt
|
|
194
180
|
- lib/generators/templates/passkit.rb
|
|
@@ -235,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
235
221
|
- !ruby/object:Gem::Version
|
|
236
222
|
version: '0'
|
|
237
223
|
requirements: []
|
|
238
|
-
rubygems_version:
|
|
224
|
+
rubygems_version: 4.0.9
|
|
239
225
|
specification_version: 4
|
|
240
226
|
summary: Serve Wallet Passes for iOS and Android directly from your Rails app
|
|
241
227
|
test_files: []
|
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/.standard.yml
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,14 +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
|
-
require "standard/rake"
|
|
13
|
-
|
|
14
|
-
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__)
|
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
|