<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix.git/tests/substitute-binary.scm, branch master</title>
<subtitle>Personal branch of https://git.savannah.gnu.org/cgit/guix.git/ for implementing 'guix deploy'.
</subtitle>
<id>https://git.jakob.space/guix.git/atom?h=master</id>
<link rel='self' href='https://git.jakob.space/guix.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/'/>
<updated>2015-03-25T09:46:22Z</updated>
<entry>
<title>Rename 'guix substitute-binary' to 'guix substitute'.</title>
<updated>2015-03-25T09:46:22Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2015-03-25T09:34:27Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=2c74fde00e4e721c6a73646935ab0cfe19dd9188'/>
<id>urn:sha1:2c74fde00e4e721c6a73646935ab0cfe19dd9188</id>
<content type='text'>
* guix/scripts/substitute-binary.scm: Rename to...
* guix/scripts/substitute.scm: ... this.  Adjust module name, entry
  point, comments, and help string accordingly.
* nix/scripts/substitute-binary.in: Rename to...
* nix/scripts/substitute.in: ... this.
* pre-inst-env.in (NIX_SUBSTITUTERS): Adjust accordingly.
* tests/substitute-binary.scm: Rename to...
* tests/substitute.scm: ... this.  Adjust references to (guix scripts
  substitute) accordingly.
* guix/ui.scm (show-guix-help)[internal?]: Change "substitute-binary" to
  "substitute".
* Makefile.am (MODULES, SCM_TESTS): Adjust to file renames.
* daemon.am (nodist_pkglibexec_SCRIPTS): Likewise.
* config-daemon.ac: Likewise.
* guix/tests.scm (call-with-derivation-narinfo): Adjust comments and
  docstring.
</content>
</entry>
<entry>
<title>Break module cycle involving (guix store) and (guix ui).</title>
<updated>2014-10-09T21:51:19Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-10-09T21:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=0363991a250177912d4ee6849c1b5ba05fbeaaff'/>
<id>urn:sha1:0363991a250177912d4ee6849c1b5ba05fbeaaff</id>
<content type='text'>
Before, there was a cycle along the lines of:

  (guix store) -&gt; (guix nar) -&gt; (guix ui) -&gt; (guix store)

This caused problems, as discussed at:

  http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00109.html

This patch removes cycles in the (guix ...) modules.

* guix/nar.scm (&amp;nar-error, &amp;nar-read-error, dump, write-contents,
  read-contents, %archive-version-1, write-file, restore-file): Move to...
* guix/serialization.scm: ... here.
* guix/store.scm: Remove dependency on (guix nar).
* guix/scripts/hash.scm, guix/scripts/offload.scm,
  guix/scripts/substitute-binary.scm, tests/nar.scm, tests/store.scm,
  tests/substitute-binary.scm: Adjust accordingly.
</content>
</entry>
<entry>
<title>substitute-binary: Ignore $GUIX_BINARY_SUBSTITUTE_URL.</title>
<updated>2014-10-09T21:51:19Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-10-09T11:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=4938b0eead9b1f34883c166a16c769a5db03edd9'/>
<id>urn:sha1:4938b0eead9b1f34883c166a16c769a5db03edd9</id>
<content type='text'>
* guix/scripts/substitute-binary.scm (%cache-url): Ignore the
  'GUIX_BINARY_SUBSTITUTE_URL' environment variable.
* test-env.in: Invoke 'guix-daemon' with '--substitute-urls'.
* tests/substitute-binary.scm: Set '%cache-url' to the value of
  'GUIX_BINARY_SUBSTITUTE_URL'.
</content>
</entry>
<entry>
<title>Use 'signature-case' in (guix nar) and 'substitute-binary'.</title>
<updated>2014-03-31T21:47:02Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-03-31T21:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=e4687a5e68fce458685dd33bfa240758c816b3a2'/>
<id>urn:sha1:e4687a5e68fce458685dd33bfa240758c816b3a2</id>
<content type='text'>
* guix/nar.scm (restore-file-set)[assert-valid-signature]: Rewrite in
  terms of 'signature-case'.
* guix/scripts/substitute-binary.scm (narinfo-signature-&gt;canonical-sexp):
  Call 'leave' instead of 'raise' when SIGNATURE is invalid.
  (&amp;nar-signature-error, &amp;nar-invalid-hash-error): Remove.
  (assert-valid-signature): Add 'narinfo' parameter; remove 'port'.
  Rewrite in terms of 'signature-case' and 'leave'.  Mention NARINFO's
  URI in error messages.  Adjust caller.
  (narinfo-sha256): New procedure.
  (assert-valid-narinfo): Use it.
  (valid-narinfo?): Rewrite using 'narinfo-sha256' and
  'signature-case'.
* tests/substitute-binary.scm (assert-valid-signature,
  test-error-condition): Remove.
  ("corrupt signature data", "unauthorized public key", "invalid
  signature"): Remove.
</content>
</entry>
<entry>
<title>tests: Test the error output of 'substitute-binary'.</title>
<updated>2014-03-30T20:32:16Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-03-30T20:25:47Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=f84f8590938e3cbcef10a51dda87f99c6c3b8b54'/>
<id>urn:sha1:f84f8590938e3cbcef10a51dda87f99c6c3b8b54</id>
<content type='text'>
* tests/substitute-binary.scm (test-error*): Rename to...
  (test-quit): ... this.  Add 'error-rx' parameter and honor it.
  ("not a number", "wrong version number", "substitute, no signature",
  "substitute, invalid hash", "substitute, unauthorized key"): Adjust
  accordingly.
</content>
</entry>
<entry>
<title>tests: Add more signed substitute tests.</title>
<updated>2014-03-30T20:32:16Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-03-30T20:11:22Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=e903b7c1a8cc4d96653f9dd12b9b8c05a3e01bd1'/>
<id>urn:sha1:e903b7c1a8cc4d96653f9dd12b9b8c05a3e01bd1</id>
<content type='text'>
* tests/substitute-binary.scm (%narinfo): Set 'URL', 'Compression', and
  'NarHash'.
  (call-with-narinfo): Create 'example.out' and 'example.nar'.
  ("query narinfo without signature", "substitute, no signature",
  "substitute, authorized key"): New tests.
</content>
</entry>
<entry>
<title>tests: Simplify 'substitute-binary' tests; reduce use of global variables.</title>
<updated>2014-03-30T20:32:16Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-03-30T19:35:22Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=52f80dfc8a1c2f116a91a20c8cefd62a317f3d36'/>
<id>urn:sha1:52f80dfc8a1c2f116a91a20c8cefd62a317f3d36</id>
<content type='text'>
* tests/substitute-binary.scm (signature-body): Change 'str' parameter
  to 'bv', and expect it to be a bytevector.
  (%signature-body, %wrong-signature, %acl): Remove.
  (signature): Rename to...
  (signature-field): ... this.  Add 'bv-or-str' parameter.  Change 'str'
  parameter to #:version.  Add #:public-key parameter.  Call
  'signature-body' directly.  Change domain part of the signature to
  'example.gnu.org'.
  ("not a number", "wrong version number", "valid
  narinfo-signature-&gt;canonical-sexp"): Use 'signature-field' instead of
  'signature' or %SIGNATURE.
  (test-error-condition): Add 'message-rx' parameter and honor it.
  ("corrupt signature data", "unauthorized public key", "invalid
  signature"): Adjust accordingly.
  (narinfo, %signed-narinfo): Remove.
  ("query narinfo with invalid hash"): Use '%narinfo' and
  'signature-field' instead of 'narinfo' and '%signature'.
  ("query narinfo signed with authorized key", "query narinfo signed
  with unauthorized key", "substitute, invalid hash", "substitute,
  unauthorized key"): Likewise.
</content>
</entry>
<entry>
<title>substitute-binary: Defer narinfo authentication and authorization checks.</title>
<updated>2014-03-30T20:32:11Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2014-03-30T20:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=cdea30e061490a521f1e9c66ff870ca98ae5d7e5'/>
<id>urn:sha1:cdea30e061490a521f1e9c66ff870ca98ae5d7e5</id>
<content type='text'>
* guix/scripts/substitute-binary.scm (narinfo-signature-&gt;canonical-sexp):
  Catch 'gcry-error' around 'string-&gt;canonical-sexp' call, and re-raise
  as a SRFI-35 &amp;message and &amp;nar-signature-error.
  (narinfo-maker): Handle when SIGNATURE is #f or an invalid canonical
  sexp.
  (&amp;nar-signature-error, &amp;nar-invalid-hash-error): New variables.
  (assert-valid-signature): Use them.  Expect 'signature' to be a
  canonical sexp.
  (read-narinfo): Remove authentication and authorization checks.
  (%signature-line-rx): New variable.
  (assert-valid-narinfo, valid-narinfo?): New procedures.
  (guix-substitute-binary): Wrap body in 'with-error-handling'.
  [valid?]: New procedure.
  &lt;--query&gt;: Show only store items of narinfos that match
  'valid-narinfo?'.
  &lt;--substitute&gt;: Call 'assert-valid-narinfo'.
* tests/substitute-binary.scm (test-error*): Use 'test-equal'.
  (%keypair): Remove.
  (%public-key, %private-key): Load from signing-key.{pub,sec}.
  (signature-body): Add #:public-key parameter.
  (call-with-narinfo): New procedure.
  (with-narinfo): New macro.
  ("corrupt signature data", "unauthorized public key", "invalid
  signature"): Make the first argument to 'assert-valid-signature' a
  canonical sexp.
  ("invalid hash", "valid read-narinfo", "valid write-narinfo"):
  Remove.
  ("query narinfo with invalid hash", "query narinfo signed with
  authorized key", "query narinfo signed with unauthorized key",
  "substitute, invalid hash", "substitute, unauthorized key"): New
  tests.
</content>
</entry>
<entry>
<title>substitute-binary: Support the Signature field of a narinfo file.</title>
<updated>2014-03-30T10:02:10Z</updated>
<author>
<name>Nikita Karetnikov</name>
<email>nikita@karetnikov.org</email>
</author>
<published>2014-03-28T23:06:41Z</published>
<link rel='alternate' type='text/html' href='https://git.jakob.space/guix.git/commit/?id=e9c6c58418043f36862a798389f3a7f4253f74cc'/>
<id>urn:sha1:e9c6c58418043f36862a798389f3a7f4253f74cc</id>
<content type='text'>
* guix/scripts/substitute-binary.scm (&lt;narinfo&gt;): Add the 'signature'
  and 'contents' fields.
  (narinfo-signature-&gt;canonical-sexp): New function.
  (narinfo-maker): Add the 'signature' argument and use it.
  (assert-valid-signature): New function.
  (read-narinfo): Support the Signature field.
  (write-narinfo): Use 'narinfo-contents'.
  (%allow-unauthenticated-substitutes?): New variable.
* guix/base64.scm, tests/base64.scm, tests/substitute-binary.scm: New files.
* Makefile.am (SCM_TESTS): Add tests/base64.scm and
  tests/substitute-binary.scm.
  (MODULES): Add guix/base64.scm.
* test-env.in: Set 'GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES'.
</content>
</entry>
</feed>
