Skip to main content

Middleware for the Fediverse

Project description

cattle_grid

THIS README needs to be updated for cattle_grid 0.2.0

cattle_grid is meant to simplify handling authentication in server to server communication of the Fediverse. cattle_grid checks the HTTP signatures based on the headers. For this public keys are retrieved and cached.

For installation instructions see the documentation.

Running

After creating a configuration file, one can run cattle_grid via

poetry run uvicorn cattle_grid:create_app

Development

One can run the pytest tests via

poetry install
poetry run pytest

Development with Fediverse pasture

In your Funfedi.dev directory (see here for details), run

cd fediverse-pasture
docker compose --file pasture.yml up pasture_verify_actor

Now in the cattle grid directory, run

poetry run python -mcattle_grid.config --actor_id http://cattle_grid/actor

to create a cattle_grid.toml file. Then start the docker containers via

docker compose up

By opening http://localhost:2909/?actor_uri=jskitten@cattle_grid_demo, you should then be able to view the verify actor result. By refreshing the page and inspecting the log files, you can also check that the requests only ran once.

Creating an user

By running

docker compose run runner

one can start a shell in the docker environment. By then running in it

curl abel/admin/create -X POST -F username=name -F password=secret

one can create the user with handle @name@abel.

Running GUI tests with the pasture

Start mastodon accessible through your browser

cd fediverse-pasture
docker compose --file mastodon42.yml --profile nginx up

See Fun Fediverse Development for instructions.

Then you can open mastodon42web and lookup jskitten@cattle_grid_demo. When you send a message to this kitten, it should reply with a meow, e.g.

Kitten meows

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cattle_grid-0.4.1.tar.gz (368.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cattle_grid-0.4.1-py3-none-any.whl (169.5 kB view details)

Uploaded Python 3

File details

Details for the file cattle_grid-0.4.1.tar.gz.

File metadata

  • Download URL: cattle_grid-0.4.1.tar.gz
  • Upload date:
  • Size: 368.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for cattle_grid-0.4.1.tar.gz
Algorithm Hash digest
SHA256 4d32cf4ad4dc5c2f4d957f2c2b38a880b671cde39203e48397432dd7af6f7889
MD5 1ff8953a4e5a4dc20cc58b41a1568b35
BLAKE2b-256 70b2ca36dfb67f9d438f7552e15c4404bbc7f5620b849c0b5462fbe312b3e36a

See more details on using hashes here.

File details

Details for the file cattle_grid-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cattle_grid-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 074210b9c09ea608e8dcb77a3a0b7991568acfcbfd29aeaa76c723a2fba052c1
MD5 15468293aaa3b3f4224384c85fca8d20
BLAKE2b-256 80a9c5338471d2babdfd3c415c256670c3cb3cb4f23f44f069d0bea33ce97974

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page