Commit graph libervia-backend/libervia/backend/plugins/plugin_comp_ap_gateway
Author SHA1 Message Date
Goffi
a8348576ae core: get rid of pickle:
Use of `pickle` to serialise data was a technical legacy that was causing trouble to store
in database, to update (if a class was serialised, a change could break update), and to
security (pickle can lead to code execution).

This patch remove all use of Pickle in favour in JSON, notably:
- for caching data, a Pydantic model is now used instead
- for SQLAlchemy model, the LegacyPickle is replaced by JSON serialisation
- in XEP-0373 a class `PublicKeyMetadata` was serialised. New method `from_dict` and
  `to_dict` method have been implemented to do serialisation.
- new methods to (de)serialise data can now be specified with Identity data types. It is
  notably used to (de)serialise `path` of avatars.

A migration script has been created to convert data (for upgrade or downgrade), with
special care for XEP-0373 case. Depending of size of database, this migration script can
be long to run.

rel 443
2024-02-23 13:31:04 +01:00
Goffi
05bdfe122a component AP gateway: be sure to have a string for error message. 2023-12-11 18:07:58 +01:00
Goffi
b8d00757d3 plugin XEP-053, component AP gateway: use the new trigger.add_with_check method 2023-12-09 19:20:13 +01:00
Goffi
510b6fb62c component AP gateway: log a warning instead of raising an exception in onMessage:
if something goes wrong, a warning is logged instead of raising a failing in `onMessage`'s
`get_ap_actor_id_from_account` and `sign_and_post` calls.
2023-12-01 18:22:26 +01:00
Goffi
3c35dea8b1 plugin XEP-0424: message retraction update:
- follow specification update (with namespace bump)
- retract from history on message reception for group chat
- send bridge message
2023-11-30 13:23:53 +01:00
Goffi
68c47bc78b component AP gateway: fix AP media type in GET and POST requests headers 2023-07-06 11:34:52 +02:00
Goffi
b1fc474503 compoent AP gateway: add forgotten contant 2023-06-28 14:27:05 +02:00
Goffi
713dda18d3 component AP gateway: fix webfinger content type 2023-06-28 14:24:42 +02:00
Goffi
0fa0b3a5f6 component AP gateway: fix handling of XMPP comments authors:
the gateway was supposing that comments where emitted from PEP of author. While this is
the case for most blog posts, it's not for comments. Instead the component is now using
`author_jid` which is retrieved by XEP-0277 plugin, and reject the item if the auhor is
not verified (i.e. if `publisher` attribute is not set by XMPP service).
2023-06-12 14:50:43 +02:00
Goffi
2fa4681929 component AP gateway: fix method retrieval in ap_request:
following recent refactoring to use snake_case, the former method retrieve was broken,
this patch fixes it.
2023-06-12 14:45:13 +02:00
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00