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.
This commit is contained in:
Ludovic Courtès 2020-06-25 00:08:05 +02:00
parent 6577682a6c
commit 8b7d982e6a
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 125 additions and 11 deletions

View file

@ -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."