Wykres commitów

561 Commity (f57421b91b1638adaec7cf8e95840ab1b98c2031)

Autor SHA1 Wiadomość Data
Marnanel Thurman f57421b91b "Create" objects whose "object" points outside the cache don't crash.
Relatedly, the __obj suffix for the argument of Object.__getitem__
now allows retrieval of anything we don't have to fetch.
It used to be restricted to local objects.
2019-08-12 23:45:23 +01:00
Marnanel Thurman 2878e0b731 The special case of activity_form for Create is now in Create rather than its parent. 2019-08-12 19:45:35 +01:00
Marnanel Thurman cb551f50d9 test_validation largely rewritten so it uses httpretty. It passes. 2019-08-12 19:44:43 +01:00
Marnanel Thurman d482f50e78 @context is now a simple string.
Added remote_object_is_recorded().

Added the on_fetch param to mock_remote_object()
and create_remote_person().
2019-08-12 19:42:23 +01:00
Marnanel Thurman d49ca4b14f Defensive programming in validation.py.
Also, workaround for httpsig.utils.CaseInsensitiveDict not
reimplenting get()...!
2019-08-12 19:40:19 +01:00
Marnanel Thurman f69c33e6c9 object['remote_url'] can be set and got. 2019-08-12 19:39:42 +01:00
Marnanel Thurman 0711c49b78 If we have no public key, actor['publicKey'] returns None instead of falling over.
Added more logging.

Removed ['wombat']=1, for goodness' sake.
2019-08-12 19:38:32 +01:00
Marnanel Thurman 38c3b51eb3 find() now takes a "run_delivery" param which is passed into the same param in create().
Also we don't decorate field names with "f_" any more when we pass them into create().
2019-08-12 19:35:56 +01:00
Marnanel Thurman 1f87fb4492 Refactor create(). It could be more efficient, but let's look at that later. 2019-08-12 19:31:38 +01:00
Marnanel Thurman d65b43e3a9 Lists which don't exist, but default to empty, get created on first write.
test_read_from_outbox passes again.
2019-08-11 23:30:49 +01:00
Marnanel Thurman eaa8de0771 rm unwritten test in the wrong language 2019-08-11 19:48:03 +01:00
Marnanel Thurman eef4405280 tests.mastodon.test_create passes!
Public collection IDs are now exported from d_k.__init__ as a set.

user['following'] etc are returned as URLs, not paths.

side_effects.create() goes to some trouble to check whether a new object is relevant to us,
and rejects it if it isn't.
2019-08-11 19:44:49 +01:00
Marnanel Thurman 1d6f17684d test_collection passes 2019-08-11 16:31:44 +01:00
Marnanel Thurman 50a63a493a restore POST handler in KepiView
We previously had a POST handler in one of the subclasses which
should have been in KepiView itself. Later, this POST handler
got adapted into an ACTIVITY_STORE handler. But it should have been
split between ACTIVITY_STORE and POST, so the POST parts are now
reinstated.
2019-08-10 23:57:35 +01:00
Marnanel Thurman c4c65e9801 Delivery to shared inbox works.
test_collection passes!

Collection views uses "username" as a key in logging, not "name" (which was phased out a month ago)

test_collection uses "testserver" as the name of the test server.
2019-08-10 20:22:08 +01:00
Marnanel Thurman ea74909726 Side effect for "Follow" uses the new class methods in Following 2019-08-10 20:21:27 +01:00
Marnanel Thurman 590d74d0df create() refuses to create types which don't exist 2019-08-10 18:58:49 +01:00
Marnanel Thurman e91b42bad1 test_find asserts dict is subset rather than equal, and
doesn't double-encode JSON. Now passes.
2019-08-10 17:45:15 +01:00
Marnanel Thurman b662b5a4a5 Use django.utils.timezone.now() instead of datetime.datetime.now()
This was the cause of the runtime warning in the tests.
2019-08-10 17:44:41 +01:00
Marnanel Thurman 158da34d1e tests_send_to_outbox passes again 2019-08-10 17:29:48 +01:00
Marnanel Thurman b096eb41b5 Thing.run_side_effects() returns whether the object should be deleted,
rather than trying to delete it itself.

create() deletes the new instance accordingly.
2019-08-10 17:28:31 +01:00
Marnanel Thurman 8db22b7f88 Actor.f_publicKey and .privateKey are JSON, so we need to dump/load them in the accessors. 2019-08-10 17:27:41 +01:00
Marnanel Thurman 36b3e8f0a7 test_views passes again. 2019-08-10 17:03:47 +01:00
Marnanel Thurman 8faa494ed6 Anything with a "former_type" is deemed to be a Tombstone.
This is instead of changing f_type, which has far too many knock-on
effects now that we're using polymorphism.

Tombstones have active=False.

AllUsersView updated so that it uses the polymorphic types.
2019-08-10 17:02:11 +01:00
Marnanel Thurman 712c57730b If publicKey or privateKey are not in the kwargs for create_local_person,
then we load keys from tests/keys rather than expecting django_kepi to
generate new keys for us.
2019-08-10 17:01:08 +01:00
Marnanel Thurman e29d083a37 formatting of values in settings.KEPI made consistent throughout 2019-08-10 16:22:36 +01:00
Marnanel Thurman 2d7411e574 Removed now we're not just a library 2019-08-10 16:22:16 +01:00
Marnanel Thurman 625caf2bb4 Actors use the actor URL format, not the general object URL format 2019-08-09 17:54:59 +01:00
Marnanel Thurman 1003350e85 __str__ on Actor 2019-08-09 17:51:59 +01:00
Marnanel Thurman a062e3740c Renaming "f_privateKey" in Actor to "privateKey"; it's not a field in the ActivityPub sense. 2019-08-09 17:45:10 +01:00
Marnanel Thurman edd67acf9a Rethinking admin forms; much reworking still to come 2019-08-09 17:42:01 +01:00
Marnanel Thurman ef48ef2bc3 host-meta.xml template; should have been checked in earlier 2019-08-09 17:06:58 +01:00
Marnanel Thurman a2f5e03ab0 Webfinger, plus tests 2019-08-09 17:06:44 +01:00
Marnanel Thurman 811e2e1fd9 If local_config doesn't exist, don't worry about it. 2019-08-08 22:28:22 +01:00
Marnanel Thurman 16cd517589 Fixes to settings so that templates get installed properly. 2019-08-08 19:55:32 +01:00
Marnanel Thurman 9d8c60b9c5 local_config is supposed to be local 2019-08-08 19:55:08 +01:00
Marnanel Thurman 3a00f56b2b ...and local_config.py is gitignored 2019-08-08 19:23:50 +01:00
Marnanel Thurman 910dd83198 kepi/settings.py includes kepi/local_config.py 2019-08-08 19:23:05 +01:00
Marnanel Thurman 71e97f6554 Added view for host-meta, and a test for it, which passes.
Moved views.py into views/activitypub.py, so we can have a
separate file for the host-meta view. views/activitypub.py
should be split up further at some point.
2019-08-08 00:01:43 +01:00
Marnanel Thurman 9f04e85577 Version bump to 0.0.30 2019-08-07 11:06:43 +01:00
Marnanel Thurman fd6258f5e4 IncomingMessage in the admin 2019-08-06 00:35:46 +01:00
Marnanel Thurman eff6709ef9 Starting to fix the forms 2019-08-05 20:37:02 +01:00
Marnanel Thurman c86fb7e1bd Merge branch 'master' of gitlab.com:marnanel/kepi 2019-08-05 15:27:28 +01:00
Marnanel Thurman b17af6f62b Removing d_k/types.py and doing the whole thing via polymorphic models.
Model names are their ActivityPub types.

As a result, Thing is renamed to Object.
2019-08-05 15:26:40 +01:00
Marnanel Thurman 31c1eb6fd5 Removing d_k/types.py and doing the whole thing via polymorphic models.
Model names are their ActivityPub types.

As a result, Thing is renamed to Object.
2019-08-05 15:25:20 +01:00
Marnanel Thurman 6c3e8edc55 remove old send_to_inbox test, and move send_to_inbox2 over it 2019-08-05 13:31:07 +01:00
Marnanel Thurman 82da292419 Ported the remaining tests from inbox to inbox2 2019-08-05 13:30:34 +01:00
Marnanel Thurman 3550a118b6 Extra fields in Thing go back into ThingFields,
rather than being stored in Thing.other_fields.
Long overdue.
2019-08-05 13:11:44 +01:00
Marnanel Thurman fc57cc4c71 Error checking. Call _after_create() if it exists. 2019-08-05 13:09:43 +01:00
Marnanel Thurman 0e298c1ac2 test_send_to_inbox2 has test_create and test_follow working at the same time :) 2019-08-04 22:56:05 +01:00