ruby-c2pa 0.2.1 → 0.4.0

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.
data/Rakefile CHANGED
@@ -14,5 +14,33 @@ Rake::TestTask.new(:test) do |t|
14
14
  t.verbose = true
15
15
  end
16
16
 
17
- task test: :compile
17
+ # The signing tests need an X.509 certificate chain and key per algorithm.
18
+ # These are generated locally rather than downloaded: it needs no network, it
19
+ # covers every algorithm the gem accepts rather than only ES256, and it keeps
20
+ # third-party material out of the repository entirely.
21
+ #
22
+ # The generated chains are rooted in a CA created here, so signed assets carry
23
+ # a signingCredential.untrusted warning. That does not make a manifest invalid.
24
+ #
25
+ # They are written to an ignored directory rather than committed: a PEM private
26
+ # key in a content-authenticity repository reads badly and trips secret
27
+ # scanning, and regenerating them costs a fraction of a second.
28
+ namespace :fixtures do
29
+ desc "Generate the signing certificates used by the test suite"
30
+ task :certs do
31
+ require_relative "test/fixtures/generate_certs"
32
+ CertificateFixtures.generate_all
33
+ end
34
+
35
+ desc "Regenerate the signing certificates, replacing any that exist"
36
+ task :certs_force do
37
+ require_relative "test/fixtures/generate_certs"
38
+ CertificateFixtures.generate_all(force: true)
39
+ end
40
+ end
41
+
42
+ # Tests depend on the certificates, so a checkout can run `rake test` with no
43
+ # manual setup, and a missing certificate fails the run rather than quietly
44
+ # skipping the tests that do the real work.
45
+ task test: [:compile, "fixtures:certs"]
18
46
  task default: :test