Wykres commitów

306 Commity (ee070e6992e5470360ab5e748f7a353ee6e0f717)

Autor SHA1 Wiadomość Data
Marnanel Thurman b574ca93c5 remove TYPES array which was replaced by types.py 2019-07-09 00:06:16 +01:00
Marnanel Thurman 1698ccc357 find() creates Things marked as remote, rather than some weird
half-arsed replacement of its own.

python-mimeparse added to the requirements because fetch() needs it.
2019-07-05 17:26:21 +01:00
Marnanel Thurman 962e85c0f8 "is_local" param of create() replaces vague "sender" param.
Tests for particular fields by Thing type removed, pending
replacement with cleverer system from d_k/things.py.

Class imports for create() done in the importing code
rather than at the top of the file, which leaves a mess.
2019-07-05 17:23:50 +01:00
Marnanel Thurman d80a241b5d Added mention tracking. 2019-07-05 17:21:01 +01:00
Marnanel Thurman 6adddb39c3 Thing getitem/setitem honours Audiences 2019-07-03 21:01:45 +01:00
Marnanel Thurman 52b3491e66 Export AUDIENCE_FIELD_NAMES 2019-07-03 21:00:36 +01:00
Marnanel Thurman 44aeab91d1 Don't json-encode values twice.
_normalise_type_for_thing moved from create to Thing.
create doesn't worry about what kind of fields it's asking Thing to set.
Thing's setitem adds audiences correctly, though
  this requires it to save() as a side-effect
  if this is the first creation.
2019-07-03 12:59:21 +01:00
Marnanel Thurman 87f015eea5 Switching back to the old "other_fields" system
because it works much better with polymorphic models.
2019-07-03 00:48:58 +01:00
Marnanel Thurman 9ec4b84f8c move text and visibility to Item from Thing 2019-06-29 16:48:12 +01:00
Marnanel Thurman ca7b295a3d Old migrations deleted
(should have been committed earlier; oops)
2019-06-29 16:42:23 +01:00
Marnanel Thurman d79ce3ee94 types for polymorphic create()s 2019-06-29 16:41:51 +01:00
Marnanel Thurman 98520cd0ad create() produces instances of subtypes of Thing as appropriate. 2019-06-29 16:40:47 +01:00
Marnanel Thurman ca332a3396 Move to django-polymorphic. Everything gets simpler. Still cleaning up. 2019-06-27 17:19:02 +01:00
Marnanel Thurman fa367b4c36 Extra properties to meet the expectations of Mastodon tests.
Lots of ValueErrors converted to logged errors and None returns.
2019-06-27 16:15:37 +01:00
Marnanel Thurman 93a6f7a974 When an audience is None, store nothing, not the word "None".
Removed extraneous debug log statement.
2019-06-27 16:13:01 +01:00
Marnanel Thurman efc268ac23 __init__.py was missing 2019-06-27 16:12:33 +01:00
Marnanel Thurman a7e7d43e30 if kepicreate creates a Create, it prints the created object too 2019-06-25 00:17:27 +01:00
Marnanel Thurman fb212e725e rm debug prints! 2019-06-25 00:12:50 +01:00
Marnanel Thurman 78fc41e54f __setitem__; side-effect for "create"; type normalisation refactored 2019-06-25 00:11:12 +01:00
Marnanel Thurman 0ee6e2970f Remove "id" field during create 2019-06-17 20:45:47 +01:00
Marnanel Thurman f73e8dfbd1 you can have no F=V pairs with kepicreate 2019-06-17 20:45:30 +01:00
Marnanel Thurman c89fb32dd9 management commands: kepicreate, kepilist 2019-06-17 20:38:18 +01:00
Marnanel Thurman ffbec4bd09 "pretty" property for pretty-printing a Thing.
__getitem__() returns None if its argument is not found.
__getitem__("number") returns the serial number.
2019-06-17 20:37:20 +01:00
Marnanel Thurman f2a5a3eca7 Delivery to collections 2019-06-15 19:13:43 +01:00
Marnanel Thurman e7b26ccd73 Refactor delivery into local and remote fns 2019-06-15 00:33:32 +01:00
Marnanel Thurman 852a8541c0 "Public" and "as:Public" work as synonyms for the public collection.
Some outdated comments removed.
2019-06-13 19:38:26 +01:00
Marnanel Thurman 8e9193c796 Pass inbox name into local POST handler, as if it came in via HTTP 2019-06-13 18:49:55 +01:00
Marnanel Thurman 7d5b635012 rm confusing debug message 2019-06-08 23:33:21 +01:00
Marnanel Thurman ca144feeae Intermediate checkin; local delivery works a bit better 2019-06-08 23:27:55 +01:00
Marnanel Thurman d633ef4c08 fixed Audience debug messages to be similar to ThingField 2019-06-07 13:57:43 +01:00
Marnanel Thurman 02baeaa1f4 Thing adds Audiences for audience fields. Plus test. 2019-06-07 13:56:20 +01:00
Marnanel Thurman 1841276ae3 Thing's debug logging looks more like Audience's 2019-06-05 00:13:57 +01:00
Marnanel Thurman 51b8d7f347 new Audience model, plus tests. Not yet linked in to Thing. 2019-06-05 00:07:05 +01:00
Marnanel Thurman 63a3a82356 Sorted ACTIVITY_TYPE_CHOICES per https://code.djangoproject.com/ticket/30505 2019-06-05 00:06:23 +01:00
Marnanel Thurman 2dcc7e043f check for None before checking for type.
Thing and Actor implement __contains__.
2019-06-03 23:02:43 +01:00
Marnanel Thurman 7a57d691df Tombstones. Closes #7. 2019-05-29 12:37:51 +01:00
Marnanel Thurman fb1444e4ef Actors have an activity_form 2019-05-29 11:49:02 +01:00
Marnanel Thurman 1a9e124e57 Thing.create() takes params as params rather than as a dict, like its Django core counterparts. 2019-05-29 11:34:43 +01:00
Marnanel Thurman 03b9262402 checking for invalid remote JSON 2019-05-29 11:17:56 +01:00
Marnanel Thurman 47e0a58a22 Body of IncomingMessage is json-encoded, not Python encoded 2019-05-29 10:55:55 +01:00
Marnanel Thurman 572b4e608e Test for invalid UTF-8 2019-05-29 10:36:37 +01:00
Marnanel Thurman d93212320b Malformed JSON gets 400 2019-05-29 10:31:26 +01:00
Marnanel Thurman 2ee4b416a5 Require incoming messages to be application/activity+json or application/json 2019-05-29 10:22:00 +01:00
Marnanel Thurman 54465e537e Thing.__str___ improved, though I'm still not quite happy with it 2019-05-29 09:50:01 +01:00
Marnanel Thurman b6fc2812d5 Improved headers handling in message validation 2019-05-29 09:15:16 +01:00
Marnanel Thurman 2f5e77c85a Debug logging 2019-05-29 09:15:00 +01:00
Marnanel Thurman cb9e99a208 Follow events cause automatic Accepts if the flag is set for that.
create() can handle initial values which are lists.
2019-05-29 01:09:58 +01:00
Marnanel Thurman 3d7fd94f51 key_name().
The pk of thing is called url, not id.
2019-05-29 01:09:15 +01:00
Marnanel Thurman ddb65c42b0 export Actor 2019-05-29 01:08:57 +01:00
Marnanel Thurman a96d2a2a85 __str__() split into __str__() and __repr__(). RemoteItem param is str()ified before use. 2019-05-29 01:08:07 +01:00
Marnanel Thurman d4a1b5707c Sole inboxes were using the address of the shared inbox.
Improved debug logging about server response.
2019-05-29 01:06:53 +01:00
Marnanel Thurman 38512de494 ActorView is a specialised ThingView 2019-05-28 17:50:32 +01:00
Marnanel Thurman 31cee0ae93 More helpful error message if the param is of the wrong type 2019-05-28 17:49:51 +01:00
Marnanel Thurman 982fa47915 Add auto_follow flag (not implemented yet) 2019-05-27 21:17:29 +01:00
Marnanel Thurman 1b0b08d8ec Add the Actor model 2019-05-27 21:17:13 +01:00
Marnanel Thurman 5fd8c5f0db Anchored the regex 2019-05-25 18:42:09 +01:00
Marnanel Thurman ca306414ac fixed field name 2019-05-25 18:40:27 +01:00
Marnanel Thurman 1e32dcefe8 Read the publicKey field for an Actor to determine its public key,
since it might be local or remote.
2019-05-25 18:32:24 +01:00
Marnanel Thurman 66355d1acf Call validation properly on inbox messages 2019-05-25 18:16:47 +01:00
Marnanel Thurman 09180cc44e Unsigned messages are logged and dropped.
Keys are properties of the Actor object, not subscripted items.
(Otherwise the view might accidentally send them out!)
2019-05-25 18:14:59 +01:00
Marnanel Thurman 51a9377fda renamed actor_details to actor, since it's an actual object now 2019-05-25 18:14:36 +01:00
Marnanel Thurman 5699007838 redo kepi's migrations, since they got tangled 2019-05-25 18:13:52 +01:00
Marnanel Thurman c82429f0c2 "activity" returns the found object, not a dictionary based on it 2019-05-25 00:31:09 +01:00
Marnanel Thurman 824c082011 Partial checkin; renaming d_k.tasks to d_k.deliver now we've
split validation away from it.
2019-05-24 20:40:02 +01:00
Marnanel Thurman 4bb225c4e8 Actor class, and crypto for it, though we don't use them yet in this branch 2019-05-24 20:37:02 +01:00
Marnanel Thurman 52f3a50444 validation goes back in django_kepi.validate 2019-05-24 20:31:51 +01:00
Marnanel Thurman 745ea99255 Remove admin for django_kepi (for now, anyway) 2019-05-24 20:22:34 +01:00
Marnanel Thurman 8e7207347e rm activity_id, which is from an old design 2019-05-22 18:27:37 +01:00
Marnanel Thurman 8a77d0f774 Task tests working again, except for validation.
We'll need to store the private keys in a separate table.
2019-05-22 18:06:20 +01:00
Marnanel Thurman c6744b0999 RemoteItem made into a subclass of dict, which makes everything simpler.
The local_only param of find() made optional.
2019-05-22 17:40:23 +01:00
Marnanel Thurman 47dfbb5d1d If a KepiView.activity() returns None, KepiView.get() treats it as a 404 2019-05-22 02:20:13 +01:00
Marnanel Thurman 155843f3c1 it's the logger 2019-05-22 02:17:45 +01:00
Marnanel Thurman 02965beef6 some stray Thing.uuids fixed to Thing.numbers 2019-05-22 02:16:38 +01:00
Marnanel Thurman 465ecbbd89 Restarting with d_k migrations because it got itself tied in knots. 2019-05-22 02:10:30 +01:00
Marnanel Thurman c7ce673b00 Primary key for a Thing is an 8-digit hex number, not a UUID. 2019-05-22 02:10:07 +01:00
Marnanel Thurman 978a7d2f15 ThingView can have id or name in kwargs 2019-05-22 00:33:58 +01:00
Marnanel Thurman d9fa99f3b5 fiddling around with imports to get things in the right modules 2019-05-22 00:23:59 +01:00
Marnanel Thurman 45e5662e78 Removed create(), which was accidentally similar to d_k.models.create().
Removed most of the type registry, since we're doing it a different way now.
2019-05-22 00:23:06 +01:00
Marnanel Thurman 3e01e3ba75 AllUsersView 2019-05-21 19:24:22 +01:00
Marnanel Thurman 1014c528d5 Include name in activity_form. Don't include fields whose value is the empty string. 2019-05-21 19:23:23 +01:00
Marnanel Thurman c42d5c8170 Remove AsyncResultView because async tasks access the db directly now. 2019-05-21 19:10:40 +01:00
Marnanel Thurman e28641d222 Following and follower views pick the correct fields out of the Following object,
and don't list pending requests.

Simplified debug logging.
2019-05-21 19:04:36 +01:00
Marnanel Thurman da617e9522 Side-effects for Follow, Accept, and Reject implemented.
Debug logging simplified somewhat.
2019-05-21 19:04:05 +01:00
Marnanel Thurman 35ae4ba5a8 Added request(), accept(), and reject().
Also, Following.__str__() had the "pending" messages backwards.
2019-05-21 19:03:07 +01:00
Marnanel Thurman d63e66259a Simplified debug logging 2019-05-21 19:02:49 +01:00
Marnanel Thurman 3ab1531f50 URL paths for objects go to ThingView, not KepiView (which is the superclass) 2019-05-21 18:10:23 +01:00
Marnanel Thurman d7453210b0 ThingObjectView renamed to ThingView 2019-05-21 18:10:12 +01:00
Marnanel Thurman 1d55d73be8 enhance error message 2019-05-21 18:05:37 +01:00
Marnanel Thurman ef246d94a8 Partial commit of Thing.__getitem__ 2019-05-19 22:16:47 +01:00
Marnanel Thurman 0306ee2abf add remote_only flag 2019-05-19 22:16:19 +01:00
Marnanel Thurman bcc67c2457 export is_local 2019-05-19 22:02:03 +01:00
Marnanel Thurman a615993695 clearer debug messages for object creation 2019-05-19 21:23:41 +01:00
Marnanel Thurman 4fdfb4d68d Persons must be "Person"s, obviously 2019-05-19 21:23:19 +01:00
Marnanel Thurman 852dd08678 Put the "name" field into Thing, as "f_name".
This means error messages can display an understandable name for a Thing.

It also makes queries a bit easier.
2019-05-19 20:56:41 +01:00
Marnanel Thurman a789aa6064 Fixed tests for following/followers collections. They currently fail. 2019-05-19 20:44:33 +01:00
Marnanel Thurman ba4e6099f8 forgot to commit migration! 2019-05-18 21:34:48 +01:00
Marnanel Thurman 91bdfcc447 added missing import 2019-05-18 21:34:38 +01:00
Marnanel Thurman a217f8795d Added the Following class back in. 2019-05-18 21:32:39 +01:00
Marnanel Thurman a9749b1ffe If values passed into create() aren't JSON-able, we stringify them.
Fixed one typo.
2019-05-18 19:04:29 +01:00
Marnanel Thurman 1c7ce88808 fix typo 2019-05-18 18:48:52 +01:00