summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorLines
2021-08-02Utilise jinja inheritance to streamline in/outboxuntestedTom Harley-59/+110
Using jinja's templating extensions, we can recreate the activitypub inheritance hierarchy without using clunky python OO. Extending from multiple template files in sequence might cause unnecesary IO to slow response times; if this ever becomes an issue, it should be possible to pre-process some of the templating since a lot of it will be based on constant expressions (such as @context and type). I think some formatting fixes leaked into this commit; oops! I'm leaving this note here in the hopes that if I ever want to clean this up, I can locate this commit easier.
2021-07-31Support dev environment via nix-shellTom Harley-3/+8
shell.nix now contains the tools used for development/testing, since it is invoked when nix-shell is run.
2021-07-31Display inbox/outbox contents correctlyTom Harley-80/+238
As per previous commit, the contents of inboxes and outboxes were not being properly displayed, which was difficult to test because of there being very few items in the test DB. This commit includes moving functions such as prepared_output into a new file sw/util.py; including them in sw/users.py made little sense and caused a circular dependency with sw/auth.py. A stub function for item info retreival has also been created, in new file sw/items.py.
2021-07-30Add templatesTom Harley-87/+241
Rather than using jsonify on a dict, the system now uses render_template on json documents. This gives the ability to extend previous files (which might be useful for activitypub features), and also enables using different templates for different filetypes. Supplied are templates for accessing inboxes and outboxes in JSON-LD and HTML. The "items" field in get_user_inbox_page.json and get_user_outbox_page.json might be currently borked.
2021-07-11Add more inbox/outbox testsHEADmasterTom Harley-89/+95
Still not even total coverage! Need to: - write more tests for outbox manipulation - look into and implement receiving content from other servers (+ write tests) off the top of my head.
2021-07-09Add basic inbox/outbox functionalityTom Harley-15/+423
Lots of added TODOs, and very little test coverage for the new functions. Next step is to get 100% coverage of what we have so far.
2021-07-07Add testing for authorisation decoratorsTom Harley-9/+106
Test addition commits always look big lmao As mentioned in the previous commit, this commit adds a check for the correct user when accessing someone's /inbox.
2021-07-06Begin work on adding user interactionTom Harley-12/+136
This commit adds support for getting information about a user, as well as accessing their inbox (not actually getting a CollectionPage yet, though). Currently the inbox does not require the right user to be logged in to access their personal inbox; this should be fixed.
2021-07-03Add nixfmt to projectTom Harley-26/+16
nixfmt (https://github.com/serokell/nixfmt) will be used to keep default.nix formatted to a specific standard. default.nix was also reformatted as part of this commit.
2021-07-03Add Werkzeug as a required Python packageTom Harley-0/+2
Werkzeug (https://werkzeug.palletsprojects.com/en/2.0.x/) is used for its password hashing options.
2021-07-03Initial commitTom Harley-0/+467