Metadata-Version: 2.1
Name: cattle-grid
Version: 0.1.0
Summary: An authentication layer for the Fediverse
Home-page: https://codeberg.org/bovine/cattle_grid/
Author: Helge
Author-email: helge.krueger@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: bovine (>=0.5.0,<0.6.0)
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: fediverse-pasture (>=0.1.2,<0.2.0)
Requires-Dist: gunicorn (>=21.2.0,<22.0.0)
Requires-Dist: mkdocs-click (>=0.8.1,<0.9.0)
Requires-Dist: quart (>=0.19.0,<0.20.0)
Requires-Dist: tortoise-orm[sqlite] (>=0.20.0,<0.21.0)
Requires-Dist: uvicorn (>=0.23.2,<0.24.0)
Project-URL: Documentation, https://cattle-grid.readthedocs.io/en/latest/
Project-URL: Repository, https://codeberg.org/bovine/cattle_grid/
Description-Content-Type: text/markdown

# cattle_grid

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](https://bovine.codeberg.page/cattle_grid/).

## Development

One can run the pytest tests via

```bash
poetry install
poetry run pytest
```

## Development with Fediverse pasture

In your Funfedi.dev directory (see [here](https://funfedi.dev/testing_tools/verify_actor/)
for details), run

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

Now in the cattle grid directory, run

```bash
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

```bash
docker compose up
```

By opening [http://localhost:2909/?actor_uri=jskitten@cattle_grid_demo](http://localhost:2909/?actor_uri=jskitten%40cattle_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.

## Running GUI tests with the pasture

Start mastodon accessible through your browser

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

See [Fun Fediverse Development](https://funfedi.dev/fediverse_pasture/applications/mastodon_4_2/) for instructions.

Then you can open [mastodon42web](http://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](mastodon.png)

