Formatting/removing dead code. No functional change

This commit is contained in:
Jaidyn Ann 2025-01-14 22:42:24 -06:00
parent aa982ead3d
commit 1466c69548
Signed by: jadedctrl
GPG Key ID: FEF4FCF78B4BF019
2 changed files with 6 additions and 19 deletions

View File

@ -49,7 +49,8 @@ There is one required property:
:RETRIEVE should be a function of (RETRIEVE URI) :RETRIEVE should be a function of (RETRIEVE URI)
This function should simply return an object from your storage, queried by a URI. This function should simply return an object from your storage, queried by a URI.
The URI parameter is going to be either an @ID or an account-URI of the form acct:username@hostname.") The URI parameter is going to be either an @ID or an account-URI of the form
acct:username@hostname.")
(defvar *logs* nil "A list of incoming Clack HTTP requests, used for debugging.") (defvar *logs* nil "A list of incoming Clack HTTP requests, used for debugging.")
(defparameter *debug* nil "Whether or not debugging-mode is on. More verbose errors, detailed logging, etc.") (defparameter *debug* nil "Whether or not debugging-mode is on. More verbose errors, detailed logging, etc.")
@ -61,13 +62,6 @@ The URI parameter is going to be either an @ID or an account-URI of the form “
("inbox" . http-inbox) ("inbox" . http-inbox)
("" . http-object))) ; By default, assume object. ("" . http-object))) ; By default, assume object.
(defvar *privkey*
(alexandria:read-file-into-string
(asdf:system-relative-pathname :activity-servist #p"enc/privkey.pem")))
(defvar *pubkey*
(alexandria:read-file-into-string
(asdf:system-relative-pathname :activity-servist #p"enc/pubkey.pem")))
;;; Callbacks ;;; Callbacks
@ -285,7 +279,7 @@ Will error our if the requests Digest or Date headers dont match our calcu
(define-condition no-signature-header (invalid-signature) (define-condition no-signature-header (invalid-signature)
() ()
(:report (lambda (condition stream) (:report (lambda (condition stream) (declare (ignore condition))
(format stream "No signature header was provided! 🐄~%Take a look at: (format stream "No signature header was provided! 🐄~%Take a look at:
https://swicg.github.io/activitypub-http-signature/#how-to-obtain-a-signature-s-public-key~&"))) https://swicg.github.io/activitypub-http-signature/#how-to-obtain-a-signature-s-public-key~&")))
(:documentation (:documentation
@ -318,7 +312,7 @@ https://swicg.github.io/activitypub-http-signature/#how-to-obtain-a-signature-s-
(define-condition invalid-signature-domain-mismatch (invalid-signature) (define-condition invalid-signature-domain-mismatch (invalid-signature)
() ()
(:report (lambda (condition stream) (:report (lambda (condition stream) (declare (ignore condition))
(format stream "There is a domain-name mismatch within the activity, and so we cant say for sure the signature is valid.~% (format stream "There is a domain-name mismatch within the activity, and so we cant say for sure the signature is valid.~%
Check the ID domain-names of the actor, the activity, and the signature-key.~&"))) Check the ID domain-names of the actor, the activity, and the signature-key.~&")))
(:documentation "Thrown during HTTP signature-validation, when it's noticed that domains-names for ID URIs don't match.")) (:documentation "Thrown during HTTP signature-validation, when it's noticed that domains-names for ID URIs don't match."))
@ -345,7 +339,6 @@ Public keys are hash-tables, which should look more-or-less like so:
(actor-key-of-id (signature-key-owner signature-alist) (actor-key-of-id (signature-key-owner signature-alist)
(cdr (assoc :keyid signature-alist)))) (cdr (assoc :keyid signature-alist))))
(defun signature-key-owner (signature-alist) (defun signature-key-owner (signature-alist)
"Return a the owning actor (likely as a LITEPUB:PERSON) of the public key "Return a the owning actor (likely as a LITEPUB:PERSON) of the public key
corresponding to the given SIGNATURE-ALIST (of SIGNATURE-HEADER-PARSE's format)." corresponding to the given SIGNATURE-ALIST (of SIGNATURE-HEADER-PARSE's format)."
@ -361,7 +354,6 @@ corresponding to the given SIGNATURE-ALIST (of SIGNATURE-HEADER-PARSE's format).
(litepub:person (litepub:person
data)))) data))))
(defun actor-key-of-id (actor id) (defun actor-key-of-id (actor id)
"Search through an ActivityPub ACTORs public keys, returning the one "Search through an ActivityPub ACTORs public keys, returning the one
whose @id matches ID. whose @id matches ID.
@ -625,11 +617,6 @@ or “/bear/apple/” or “/bear/”, but not “/bear” (not a directory)."
/u/bear/apple.txt '(u bear apple.txt)" /u/bear/apple.txt '(u bear apple.txt)"
(str:split #\/ pathname :omit-nulls 't)) (str:split #\/ pathname :omit-nulls 't))
(defun sequence-hexadecimal-string (sequence)
(reduce #'str:concat
(loop for number across
sequence
collect (format nil "~X" number))))
(defun equal* (&rest items) (defun equal* (&rest items)
"Whether or not all ITEMS are EQUAL to one another." "Whether or not all ITEMS are EQUAL to one another."
(loop for item in items (loop for item in items

View File

@ -1,6 +1,6 @@
;;;; activity-vocabulary: Base vocabulary classes for ActivityStreams. ;;;; activity-vocabulary: Base vocabulary classes for ActivityStreams.
;; Copyright © 2024 Jaidyn Ann <jadedctrl@posteo.at> ;; Copyright © 2024-2025 Jaidyn Ann <jadedctrl@posteo.at>
;; ;;
;; This program is free software: you can redistribute it and/or ;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as ;; modify it under the terms of the GNU General Public License as
@ -46,7 +46,7 @@
(defmacro define-json-empty-types (superclasses context &rest direct-children) (defmacro define-json-empty-types (superclasses context &rest direct-children)
"For each list of DIRECT-CHILDREN, a hollow JSON subtype and CLOS subclass "For each list of DIRECT-CHILDREN, a hollow JSON subtype and CLOS subclass
ofE SUPERCLASSES will be created, with the given JSON-LD context @CONTEXT. of SUPERCLASSES will be created, with the given JSON-LD context @CONTEXT.
These new subclasses have no slots of its own they will be empty derivatives These new subclasses have no slots of its own they will be empty derivatives
of SUPERCLASSES. of SUPERCLASSES.