aboutsummaryrefslogtreecommitdiff
path: root/guix/channels.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-25 00:08:05 +0200
committerLudovic Courtès <ludo@gnu.org>2020-07-01 23:34:51 +0200
commit8b7d982e6ae090eb5b3938db14a8eb2e2c3a1419 (patch)
tree63cf99e39646f07d849c46a656e233e164e88f11 /guix/channels.scm
parent6577682a6c4885020949e014a536f96e8ae315d0 (diff)
downloadguix-8b7d982e6ae090eb5b3938db14a8eb2e2c3a1419.tar
guix-8b7d982e6ae090eb5b3938db14a8eb2e2c3a1419.tar.gz
channels: Make channel introductions public.
* guix/channels.scm (<channel-introduction>): Rename constructor to '%make-channel-introduction'. (make-channel-introduction): New procedure. * tests/channels.scm ("authenticate-channel, wrong first commit signer") ("authenticate-channel, .guix-authorizations"): Use 'make-channel-introduction' without '@@' and without third argument. * doc/guix.texi (Channels)[Channel Authentication, Specifying Channel Authorizations]: New subsections.
Diffstat (limited to 'guix/channels.scm')
-rw-r--r--guix/channels.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 02619c253f..5f48e6f04f 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -69,7 +69,9 @@
channel-location
channel-introduction?
- ;; <channel-introduction> accessors purposefully omitted for now.
+ make-channel-introduction
+ channel-introduction-first-signed-commit
+ channel-introduction-first-commit-signer
openpgp-fingerprint->bytevector
openpgp-fingerprint
@@ -130,13 +132,19 @@
;; commit so that only them may emit this introduction. Introductions are
;; used to bootstrap trust in a channel.
(define-record-type <channel-introduction>
- (make-channel-introduction first-signed-commit first-commit-signer
- signature)
+ (%make-channel-introduction first-signed-commit first-commit-signer
+ signature)
channel-introduction?
(first-signed-commit channel-introduction-first-signed-commit) ;hex string
(first-commit-signer channel-introduction-first-commit-signer) ;bytevector
(signature channel-introduction-signature)) ;string
+(define (make-channel-introduction commit signer)
+ "Return a new channel introduction: COMMIT is the introductory where
+authentication starts, and SIGNER is the OpenPGP fingerprint (a bytevector) of
+the signer of that commit."
+ (%make-channel-introduction commit signer #f))
+
(define (openpgp-fingerprint->bytevector str)
"Convert STR, an OpenPGP fingerprint (hexadecimal string with whitespace),
to the corresponding bytevector."