diff --git a/README.md b/README.md index 1782064..1961048 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A Clojure library designed to implement the ActivityPub protocol, obviously. +![The Dog and Duck, St George's Fields, London, 1647](https://simon-brooke.github.io/dog-and-duck/images/Dog_and_Duck_tavern.jpg) + ## Introduction The Old Dog and Duck is clearly a pub, and it's a pub related to an activity; to whit, hunting ducks with dogs. Yes, of course one could also hunt dogs with ducks, but in practice that doesn't work so well. The point isn't whether or not I approve of hunting ducks with dogs (or vice versa); to be clear, I don't. The point is that it's a pub related to an activity, and is therefore an [ActivityPub](https://www.w3.org/TR/activitypub/). diff --git a/doc/intro.md b/doc/intro.md index 97d9ad0..6308d94 100644 --- a/doc/intro.md +++ b/doc/intro.md @@ -1,8 +1,10 @@ -# The Old Dog and Duck +# Introduction + +## The Old Dog and Duck A Clojure library designed to implement the ActivityPub protocol, obviously. -## Introduction +![The Dog and Duck, Derby](../images/dog-and-duck-beverley.jpg) The Old Dog and Duck is clearly a pub, and it's a pub related to an activity; to whit, hunting ducks with dogs. Yes, of course one could also hunt dogs with ducks, but in practice that doesn't work so well. The point isn't whether or not I approve of hunting ducks with dogs (or vice versa); to be clear, I don't. The point is that it's a pub related to an activity, and is therefore an [ActivityPub](https://www.w3.org/TR/activitypub/). diff --git a/docs/codox/Using_ActivityPub.html b/docs/codox/Using_ActivityPub.html index f1fe215..36f193d 100644 --- a/docs/codox/Using_ActivityPub.html +++ b/docs/codox/Using_ActivityPub.html @@ -1,5 +1,5 @@ -Using ActivityPub

Using ActivityPub

+Using ActivityPub

Using ActivityPub

Introduction

I do not know what I am doing; I am learning, and playing. Nothing in this document should be treated as good advice; it simply relates to the current state of my knowledge.

\ No newline at end of file diff --git a/docs/codox/Validation_Faults.html b/docs/codox/Validation_Faults.html index 5e33709..09bf6f4 100644 --- a/docs/codox/Validation_Faults.html +++ b/docs/codox/Validation_Faults.html @@ -1,6 +1,6 @@ -Validation Faults in ActivityPub documents

Validation Faults in ActivityPub documents

+Validation Faults in ActivityPub documents

Validation Faults in ActivityPub documents

Motivation

This document is intended to provide an extension vocabulary for ActivityStreams documents, which provides vocabulary for categorising and describing faults in ActivityPub documents.

The motivation is to be able to serialise a validation report on an ActivityPub document as an ActivityStreams document.

diff --git a/docs/codox/clj-activitypub.core.html b/docs/codox/clj-activitypub.core.html index 8c06e24..337fb9a 100644 --- a/docs/codox/clj-activitypub.core.html +++ b/docs/codox/clj-activitypub.core.html @@ -1,3 +1,3 @@ -clj-activitypub.core documentation

clj-activitypub.core

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

activity

multimethod

Produces a map representing an ActivityPub activity which can be serialized directly to JSON in the form expected by the ActivityStreams 2.0 spec. See https://www.w3.org/TR/activitystreams-vocabulary/ for reference.

actor

(actor {:keys [user-id username public-key]})

Accepts a config, and returns a map in the form expected by the ActivityPub spec. See https://www.w3.org/TR/activitypub/#actor-objects for reference.

auth-headers

(auth-headers config {:keys [body headers]})

Given a config and request map of {:body … :headers …}, returns the original set of headers with Signature and Digest attributes appended.

config

(config {:keys [domain username username-route public-key private-key], :or {username-route "/users/", public-key nil, private-key nil}})

Creates hash of computed data relevant for most ActivityPub utilities.

fetch-user

(fetch-user user-id)

Fetches the customer account details located at user-id from a remote server. Will return cached results if they exist in memory.

gen-signature-header

(gen-signature-header config headers)

Generates a HTTP Signature string based on the provided map of headers.

obj

multimethod

Produces a map representing an ActivityPub object which can be serialized directly to JSON in the form expected by the ActivityStreams 2.0 spec. See https://www.w3.org/TR/activitystreams-vocabulary/ for reference.

parse-account

(parse-account handle)

Given an ActivityPub handle (e.g. @jahfer@mastodon.social), produces a map containing {:domain … :username …}.

signature-headers

TODO: write docs

with-config

(with-config config)

Returns curried forms of the #activity and #obj multimethods in the form {:activity … :obj …}, with the initial parameter set to config.

\ No newline at end of file +clj-activitypub.core documentation

clj-activitypub.core

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

activity

multimethod

Produces a map representing an ActivityPub activity which can be serialized directly to JSON in the form expected by the ActivityStreams 2.0 spec. See https://www.w3.org/TR/activitystreams-vocabulary/ for reference.

actor

(actor {:keys [user-id username public-key]})

Accepts a config, and returns a map in the form expected by the ActivityPub spec. See https://www.w3.org/TR/activitypub/#actor-objects for reference.

auth-headers

(auth-headers config {:keys [body headers]})

Given a config and request map of {:body … :headers …}, returns the original set of headers with Signature and Digest attributes appended.

config

(config {:keys [domain username username-route public-key private-key], :or {username-route "/users/", public-key nil, private-key nil}})

Creates hash of computed data relevant for most ActivityPub utilities.

fetch-user

(fetch-user user-id)

Fetches the customer account details located at user-id from a remote server. Will return cached results if they exist in memory.

gen-signature-header

(gen-signature-header config headers)

Generates a HTTP Signature string based on the provided map of headers.

obj

multimethod

Produces a map representing an ActivityPub object which can be serialized directly to JSON in the form expected by the ActivityStreams 2.0 spec. See https://www.w3.org/TR/activitystreams-vocabulary/ for reference.

parse-account

(parse-account handle)

Given an ActivityPub handle (e.g. @jahfer@mastodon.social), produces a map containing {:domain … :username …}.

signature-headers

TODO: write docs

with-config

(with-config config)

Returns curried forms of the #activity and #obj multimethods in the form {:activity … :obj …}, with the initial parameter set to config.

\ No newline at end of file diff --git a/docs/codox/clj-activitypub.internal.crypto.html b/docs/codox/clj-activitypub.internal.crypto.html index 6852d12..f97368e 100644 --- a/docs/codox/clj-activitypub.internal.crypto.html +++ b/docs/codox/clj-activitypub.internal.crypto.html @@ -1,3 +1,3 @@ -clj-activitypub.internal.crypto documentation

clj-activitypub.internal.crypto

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

base64-encode

(base64-encode bytes)

TODO: write docs

private-key

(private-key private-pem-str)

TODO: write docs

sha256-base64

(sha256-base64 data)

TODO: write docs

sign

(sign data private-key)

TODO: write docs

\ No newline at end of file +clj-activitypub.internal.crypto documentation

clj-activitypub.internal.crypto

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

base64-encode

(base64-encode bytes)

TODO: write docs

private-key

(private-key private-pem-str)

TODO: write docs

sha256-base64

(sha256-base64 data)

TODO: write docs

sign

(sign data private-key)

TODO: write docs

\ No newline at end of file diff --git a/docs/codox/clj-activitypub.internal.http-util.html b/docs/codox/clj-activitypub.internal.http-util.html index 1df08cf..754d7a6 100644 --- a/docs/codox/clj-activitypub.internal.http-util.html +++ b/docs/codox/clj-activitypub.internal.http-util.html @@ -1,3 +1,3 @@ -clj-activitypub.internal.http-util documentation

clj-activitypub.internal.http-util

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

date

(date)

TODO: write docs

digest

(digest body)

Accepts body from HTTP request and generates string for use in HTTP Digest request header.

encode-url-params

(encode-url-params params)

TODO: write docs

\ No newline at end of file +clj-activitypub.internal.http-util documentation

clj-activitypub.internal.http-util

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

date

(date)

TODO: write docs

digest

(digest body)

Accepts body from HTTP request and generates string for use in HTTP Digest request header.

encode-url-params

(encode-url-params params)

TODO: write docs

\ No newline at end of file diff --git a/docs/codox/clj-activitypub.internal.thread-cache.html b/docs/codox/clj-activitypub.internal.thread-cache.html index fe63b03..6ea40ed 100644 --- a/docs/codox/clj-activitypub.internal.thread-cache.html +++ b/docs/codox/clj-activitypub.internal.thread-cache.html @@ -1,3 +1,3 @@ -clj-activitypub.internal.thread-cache documentation

clj-activitypub.internal.thread-cache

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

make

(make)(make cache-if-nil)

Creates a thread-local cache.

\ No newline at end of file +clj-activitypub.internal.thread-cache documentation

clj-activitypub.internal.thread-cache

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

make

(make)(make cache-if-nil)

Creates a thread-local cache.

\ No newline at end of file diff --git a/docs/codox/clj-activitypub.webfinger.html b/docs/codox/clj-activitypub.webfinger.html index 8ea3cad..3b44a47 100644 --- a/docs/codox/clj-activitypub.webfinger.html +++ b/docs/codox/clj-activitypub.webfinger.html @@ -1,3 +1,3 @@ -clj-activitypub.webfinger documentation

clj-activitypub.webfinger

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

fetch-user-id

(fetch-user-id domain username)

Follows the webfinger request to a remote domain, retrieving the ID of the requested account. Typically returns a string in the form of a URL.

remote-uri-path

TODO: write docs

resource-url

(resource-url domain username & [params])

Builds a URL pointing to the user’s account on the remote server.

\ No newline at end of file +clj-activitypub.webfinger documentation

clj-activitypub.webfinger

copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

fetch-user-id

(fetch-user-id domain username)

Follows the webfinger request to a remote domain, retrieving the ID of the requested account. Typically returns a string in the form of a URL.

remote-uri-path

TODO: write docs

resource-url

(resource-url domain username & [params])

Builds a URL pointing to the user’s account on the remote server.

\ No newline at end of file diff --git a/docs/codox/dog-and-duck.quack.picky.html b/docs/codox/dog-and-duck.quack.picky.html index a3ba010..3de3700 100644 --- a/docs/codox/dog-and-duck.quack.picky.html +++ b/docs/codox/dog-and-duck.quack.picky.html @@ -1,6 +1,6 @@ -dog-and-duck.quack.picky documentation

dog-and-duck.quack.picky

Fault-finder for ActivityPub documents.

+dog-and-duck.quack.picky documentation

dog-and-duck.quack.picky

Fault-finder for ActivityPub documents.

Generally, each -faults function will return:

  1. nil if no faults were found;
  2. diff --git a/docs/codox/dog-and-duck.quack.quack.html b/docs/codox/dog-and-duck.quack.quack.html index 878a31d..4a768c3 100644 --- a/docs/codox/dog-and-duck.quack.quack.html +++ b/docs/codox/dog-and-duck.quack.quack.html @@ -1,6 +1,6 @@ -dog-and-duck.quack.quack documentation

    dog-and-duck.quack.quack

    Validator for ActivityPub objects: if it walks like a duck, and it quacks like a duck…

    +dog-and-duck.quack.quack documentation

    dog-and-duck.quack.quack

    Validator for ActivityPub objects: if it walks like a duck, and it quacks like a duck…

    **NOTE THAT the ActivityPub spec says

    Servers SHOULD validate the content they receive to avoid content spoofing attacks

    diff --git a/docs/codox/dog-and-duck.scratch.core.html b/docs/codox/dog-and-duck.scratch.core.html index 15b09e5..8adeb3a 100644 --- a/docs/codox/dog-and-duck.scratch.core.html +++ b/docs/codox/dog-and-duck.scratch.core.html @@ -1,3 +1,3 @@ -dog-and-duck.scratch.core documentation

    dog-and-duck.scratch.core

    TODO: write docs

    foo

    (foo x)

    I don’t do a whole lot.

    \ No newline at end of file +dog-and-duck.scratch.core documentation

    dog-and-duck.scratch.core

    TODO: write docs

    foo

    (foo x)

    I don’t do a whole lot.

    \ No newline at end of file diff --git a/docs/codox/dog-and-duck.scratch.parser.html b/docs/codox/dog-and-duck.scratch.parser.html index 147af45..b14fd92 100644 --- a/docs/codox/dog-and-duck.scratch.parser.html +++ b/docs/codox/dog-and-duck.scratch.parser.html @@ -1,3 +1,3 @@ -dog-and-duck.scratch.parser documentation

    dog-and-duck.scratch.parser

    TODO: write docs

    clean

    (clean json)

    Take this json input, and return a sequence of ActivityPub objects represented by it.

    \ No newline at end of file +dog-and-duck.scratch.parser documentation

    dog-and-duck.scratch.parser

    TODO: write docs

    clean

    (clean json)

    Take this json input, and return a sequence of ActivityPub objects represented by it.

    \ No newline at end of file diff --git a/docs/codox/dog-and-duck.scratch.scratch.html b/docs/codox/dog-and-duck.scratch.scratch.html index f74e1c0..4f30252 100644 --- a/docs/codox/dog-and-duck.scratch.scratch.html +++ b/docs/codox/dog-and-duck.scratch.scratch.html @@ -1,3 +1,3 @@ -dog-and-duck.scratch.scratch documentation

    dog-and-duck.scratch.scratch

    Scratchpad where I try to understand how to do this stuff.

    account

    Fetch my account to mess with

    account-handle

    TODO: write docs

    handle

    TODO: write docs

    kp

    TODO: write docs

    rsa

    TODO: write docs

    \ No newline at end of file +dog-and-duck.scratch.scratch documentation

    dog-and-duck.scratch.scratch

    Scratchpad where I try to understand how to do this stuff.

    account

    Fetch my account to mess with

    account-handle

    TODO: write docs

    handle

    TODO: write docs

    kp

    TODO: write docs

    rsa

    TODO: write docs

    \ No newline at end of file diff --git a/docs/codox/dog-and-duck.utils.process.html b/docs/codox/dog-and-duck.utils.process.html index 2cd7848..62f2844 100644 --- a/docs/codox/dog-and-duck.utils.process.html +++ b/docs/codox/dog-and-duck.utils.process.html @@ -1,3 +1,3 @@ -dog-and-duck.utils.process documentation

    dog-and-duck.utils.process

    TODO: write docs

    pid

    OK, this is hacky as fuck, but I hope it works. The problem is that the way to get the process id has changed several times during the history of Java development, and the code for one version of Java won’t even compile in a different version.

    \ No newline at end of file +dog-and-duck.utils.process documentation

    dog-and-duck.utils.process

    TODO: write docs

    pid

    OK, this is hacky as fuck, but I hope it works. The problem is that the way to get the process id has changed several times during the history of Java development, and the code for one version of Java won’t even compile in a different version.

    \ No newline at end of file diff --git a/docs/codox/index.html b/docs/codox/index.html index de6430f..c24d74c 100644 --- a/docs/codox/index.html +++ b/docs/codox/index.html @@ -1,3 +1,3 @@ -Dog-and-duck 0.1.0-SNAPSHOT

    Dog-and-duck 0.1.0-SNAPSHOT

    Released under the GPL-2.0-or-later

    A playground for hacking ActivityPub stuff.

    Installation

    To install, add the following dependency to your project or build file:

    [dog-and-duck "0.1.0-SNAPSHOT"]

    Topics

    Namespaces

    clj-activitypub.core

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    clj-activitypub.internal.crypto

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    clj-activitypub.internal.http-util

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    clj-activitypub.internal.thread-cache

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    clj-activitypub.webfinger

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    dog-and-duck.scratch.core

    TODO: write docs

    Public variables and functions:

    dog-and-duck.scratch.parser

    TODO: write docs

    Public variables and functions:

    dog-and-duck.scratch.scratch

    Scratchpad where I try to understand how to do this stuff.

    Public variables and functions:

    dog-and-duck.utils.process

    TODO: write docs

    Public variables and functions:

    \ No newline at end of file +Dog-and-duck 0.1.0-SNAPSHOT

    Dog-and-duck 0.1.0-SNAPSHOT

    Released under the GPL-2.0-or-later

    A playground for hacking ActivityPub stuff.

    Installation

    To install, add the following dependency to your project or build file:

    [dog-and-duck "0.1.0-SNAPSHOT"]

    Topics

    Namespaces

    clj-activitypub.core

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    clj-activitypub.internal.crypto

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    clj-activitypub.internal.http-util

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    clj-activitypub.internal.thread-cache

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    clj-activitypub.webfinger

    copied from Jahfer’s clj-activitypub library. If and when Jahfer issues a release of that library, this directory will be deleted and a dependency on that library will be added to the project.

    Public variables and functions:

    dog-and-duck.scratch.core

    TODO: write docs

    Public variables and functions:

    dog-and-duck.scratch.parser

    TODO: write docs

    Public variables and functions:

    dog-and-duck.scratch.scratch

    Scratchpad where I try to understand how to do this stuff.

    Public variables and functions:

    dog-and-duck.utils.process

    TODO: write docs

    Public variables and functions:

    \ No newline at end of file diff --git a/docs/codox/intro.html b/docs/codox/intro.html index a753b8d..66aa6ed 100644 --- a/docs/codox/intro.html +++ b/docs/codox/intro.html @@ -1,8 +1,9 @@ -The Old Dog and Duck

    The Old Dog and Duck

    +Introduction

    Introduction

    +

    The Old Dog and Duck

    A Clojure library designed to implement the ActivityPub protocol, obviously.

    -

    Introduction

    +

    The Dog and Duck, Derby

    The Old Dog and Duck is clearly a pub, and it’s a pub related to an activity; to whit, hunting ducks with dogs. Yes, of course one could also hunt dogs with ducks, but in practice that doesn’t work so well. The point isn’t whether or not I approve of hunting ducks with dogs (or vice versa); to be clear, I don’t. The point is that it’s a pub related to an activity, and is therefore an ActivityPub.

    Are we clear?

    Good.

    diff --git a/docs/images/dog-and-duck-beverley.jpg b/docs/images/dog-and-duck-beverley.jpg new file mode 100644 index 0000000..f238038 Binary files /dev/null and b/docs/images/dog-and-duck-beverley.jpg differ diff --git a/docs/images/dog-and-duck-cambridge.png b/docs/images/dog-and-duck-cambridge.png new file mode 100644 index 0000000..a982b9b Binary files /dev/null and b/docs/images/dog-and-duck-cambridge.png differ diff --git a/docs/images/dog-and-duck-derby.jpg b/docs/images/dog-and-duck-derby.jpg new file mode 100644 index 0000000..674646b Binary files /dev/null and b/docs/images/dog-and-duck-derby.jpg differ diff --git a/docs/index.html b/docs/index.html index 92c6977..79a48b9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,14 +8,7 @@

    The Old Dog and Duck: Documentation

    - Victorian painting by Thomas H. Shepherd, based on a 1646 drawing -

    'The Old Dog and Duck' is a fairly common pub name; - - the instance in the picture - stood in St George's Fields, London from the seventeenth century - until 1812, when the site was cleared to make way for the new Bethlehem - Hospital. -

    + The Dog and Duck, Derby