Commit graph libervia-backend/libervia/backend/plugins
Author SHA1 Message Date
Goffi
610eac0718 Formatting + type hints 2026-05-02 15:55:18 +02:00
Goffi
8d42a09208 core (disco), plugins identidy, XEP-0115:
- Fix data types, and use quotes data type to avoid immediate evaluation on Python < 3.14
- Better error catching folling change in `get_infos` in `memory.disco`.
- Some code modernisation (async coroutine).
2026-05-02 15:55:18 +02:00
Goffi
80e5a9e6ac memory (disco): Fix error handling for find_service_entity/find_service_entities:
- Error raised by `disco_info` where not properly handler, resulting in an exception
  instead of appropriate logging and return value.
- `async` coroutines, type hints
2026-04-24 17:38:54 +02:00
Goffi
fd58b78762 core, dependencies: update Tx-XMPP to v0.13.0:
`DiscoFeature.identities` format has evolved so `(category, map)` can be checked directly
again. The code using identities has been updated.
2026-04-21 12:49:30 +02:00
Goffi
dd79a42931 plugin XEP-0115: refactoring and complete implementation:
- the XEP-0115 implementation has been completed with validation, caps node handling in
  disco requests, hash generation fixes, and real support for xml:lang.
- the `generate_hash` method has been moved from disco where it's not used anymore to
  XEP-0115.
- Disco doesn't hash systematically, it nos use a per-jid cache for non XEP-0115
  supporting client.
- code modernisation, with use of `get_plugin_data` for Client data in XEP-0115, type
  hints, etc.
- More comments have been added to link algorithms steps to the relevant part in
  specification.
2026-04-18 01:08:01 +02:00
Goffi
f6db575ee4 core, dependencies: Update Tx-XMPP to 0.12:
Tx-XMPP 0.12 has beaking change in `discoFeature.identities` because it now supports
`xml:lang` attribute, so this update implies updating the code everywhere were this is
used.
2026-04-17 17:26:54 +02:00
Goffi
da1a5b691a plugin XEP-0473: Fix early exit when checking items:
The secrets were loaded for all items in `_items_trigger` instead of exiting early when
there is nothing to decrypt, this was inefficient, and showing annoying warnings.
2026-04-16 12:19:35 +02:00
Goffi
42c2f88b30 component pubsub: PEP presence access model and auto-subscription
- Implement `presence` access model for PEP nodes.
- Add PEP auto-subscription (`+notify` handling)
- New `get_pep_last_items` storage method to retrieve in a single query items to send to
  auto-subscribers.
- Online resource tracking.

This completes the PEP support.

rel 476
2026-04-15 20:51:51 +02:00
Goffi
81bd3dcf01 component pubsub: PEP implementation:
New implementations of XEP-0355 and XEP-0356 are integrated to handle PEP. The
implementation is not complete yet, as auto-subscribe and presence permissions are not
implemented yet.

rel 476
2026-04-14 23:16:18 +02:00
Goffi
6605e523d0 plugin XEP-0356: Privileged Entity implementation:
This is the second XEP needed to implement PEP in Pubsub Component. This implementation
should be more or less complete.

rel 476
2026-04-14 23:08:21 +02:00
Goffi
f5e0152b32 plugin XEP-0355: Namespace Delegation implementation:
The admin mode is implemented. It is needed to handle PEP with Pubsub Component.

rel 476
2026-04-14 23:04:04 +02:00
Goffi
da2c2c49ea component pubsub: Implement "max_items":
A new `max_items` field has been added to `PubsubNode`. `0` means `max`. If any >0 value
is used, items will be automatically deleted by `cache_pubsub_items`. Items are currently
discarded (i.e. no notification is sent), this is the same behaviour as in legacy Libervia
Pubsub (formerly "SàT Pubsub").

rel 476
2026-04-11 12:47:40 +02:00
Goffi
c89b91c2e9 component pubsub: Integrate XEP-0499 extended discovery:
- Added `on_extended_disco()` handler.
- Added `with_parent=True` to all `get_pubsub_node()` calls to prevent lazy load errors in
  access checks.

rel 476

Registered XEP-0499 handler in `profile_connecting()` and added it to
plugin dependencies.
2026-04-11 12:46:47 +02:00
Goffi
20bf3dffa1 plugin XEP-0499: metadata + filtering:
- Added `full_metadata` handling to return only relationship fields when requested.
- Implemented `filter_node_hierarchy_by_access` for access control filtering

rel 476
2026-04-11 02:03:22 +02:00
Goffi
3492baaa65 component pubsub: integrate pubsub relationships:
Pubsub relationships from XEP-0496 are now handled. They can be set in config as explained
in the specification, and access are checked with parents when they are set.

Deletion cascade as specified in the XEP.

rel 476
2026-04-11 01:55:15 +02:00
Goffi
0c6921aad0 plugin XEP-0496: Pubsub Relationships implementation:
Add methods to handles the relationships which were already present in storage.
This plugins add methods to handle validation and rules from the specs.

`get_pubsub_node_children` helper method has been added to storage.
2026-04-11 01:55:15 +02:00
Goffi
09bef94ffe plugin XEP-0373, tests (unit/XEP-0373): Make rpad size >= 50:
XEP-0420 bounds starts at 0 but 0-length rpad defeats its purpose (the XEP actually says
"TODO: sane boundaries?"). Furthermore, some tests where failing randomly due to 0-lenght
rpad sometimes happening. This patch makes rpad minimum size at 50.
2026-04-09 21:47:53 +02:00
Goffi
1013266cc5 component pubsub: remove node creation restriction to local user only:
External users should be able to create nodes, it is necessary for many feature such as
blog comments.

rel 476
2026-04-09 21:47:06 +02:00
Goffi
e7917b1b63 component pubsub: Implement remaining methods:
- `retract`, `purge` and `delete` are now implemented
- `features` list has been added
- `publish` now returns the Item ID when it is generated
- `subscribers` publish model is handled.

rel 476
2026-04-09 21:46:31 +02:00
Goffi
572662653f component pubsub: implement default configuration:
rel 476
2026-04-09 10:26:08 +02:00
Goffi
6b2c34190e component pubsub: implement notifications
rel 476
2026-04-09 10:11:29 +02:00
Goffi
5038fdb8f0 component pubsub: Implement subscription handling methods:
rel 476
2026-04-09 10:11:29 +02:00
Goffi
34d6032cf5 component pubsub: Handle affiliations setting/retrieval:
Let retrieve affiliations for the whole service or a specific node, and set affiliations
for a node.

rel 476
2026-04-08 16:16:20 +02:00
Goffi
8ebf5360a2 component pubsub: publish and items retrieval implementation:
rel 476
2026-04-07 15:00:37 +02:00
Goffi
57d3d8e07e memory (sqla): Improve handling of RSM in get_items:
- update queries to handle correctly the `before=""` case and RSM order (older to newer)
  while having correct order when `max_items` without RSM is used (then order it newer to
  older).
- put RSM code path in a separated method for better readability.
- check values of `max_items` and `from_index` and raise exception is they are not
  positive
- when using `before` or `after`, check that the item ID used as reference exists, and
  raise an exception otherwise.
- updated docstring to reflect the new behaviour.
- update pubsub cache use of `get_items` with RSM, to adapt to new behaviour.

rel 476
2026-04-07 14:58:42 +02:00
Goffi
9cf71f2119 component Pubsub: initial implementation:
Base component implementation, handle node creation, listing, configuration and metadata.

rel 476
2026-04-07 11:48:53 +02:00
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
d3113ed2d8 core: fix failure raising with exception classes:
When raising a `Failure` with an exception, the `Exception` class can't be used, it must
be an instance.
2026-03-30 12:03:16 +02:00
Goffi
90c6f11415 plugin XEP-0198: Fix disconnecting of component profile:
- There is not need to use stream management with component, so we set mode to `client`
only.
- `_disconnecting_trigger` was causing an exception when disconnecting a component, it is
now disabled in this case.
2026-03-30 12:01:17 +02:00
Goffi
5c1326c8e4 iplugin app manager: remove forgotten breakpoint 2026-03-30 11:58:39 +02:00
Goffi
51776603e0 depdencies, core: update Tx-XMPP to be version >= 10.0:
This version changes the package name, so all `wokkel` imports habe been replaced by
`tx_xmpp`
2026-03-24 16:42:27 +01:00
Goffi
eaa49911a6 core (xmpp): Don't use Tx-XMPP deprecated attributes:
Some deprecated attribute from `Tx-XMPP` (`Wokkel`) were still used.
This patch also remove some legacy `inlineCallbacks`.
2026-03-21 12:24:39 +01:00
Goffi
78d72304d5 core: bye bye sat_tmp :)
After 11 years of "temporary" monkey patches, I've finally made a friendly fork of Wokkel
at https://www.goffi.org/forge/goffi/tx-xmpp with all needed PRs merged and changes from
`sat_tmp`, using the same license as Wokkel (with agreement from contributors). No more
monkey patching, and it will also stop the deprecation warning due to outdated packages
used in Wokkel. Last but not least, it should unblock the move to the latest Twisted and
Python versions.
2026-03-20 18:32:36 +01:00
Goffi
04d53ebe10 plugin forge: Check that repository exist before returning counters. 2026-03-18 10:54:59 +01:00
Goffi
bc95840d46 plugin (forge): add bridge methods to handle clone counters:
A counter of clones (i.e.; Git clones as Git is currently the only backend) can be incremented or retrieved.
Counters are stored per day.
2026-03-18 10:42:15 +01:00
Goffi
ea52ebe434 plugin (XEP-0059): fix max handling:
since the move to the new model, the `_` suffix must not be used any more with `max`.
2026-03-17 16:08:37 +01:00
Goffi
82e2c6efac apply black to the whole codebase. 2026-03-09 09:22:04 +01:00
Goffi
c31b6e207c applicactions: fix applications:
This patch fix application configuration parsing. Peertube and Weblate can be started
again.
2026-03-04 15:49:47 +01:00
Goffi
f17fee4802 plugin forge/git: Implement diff retrieval:
Add models and parser to get diff from commits or branch references.
2026-03-04 12:32:48 +01:00
Goffi
48d197459a plugin forge: add tickets to settings:
Those settings are used to set the tickets node.
2026-03-04 12:32:48 +01:00
Goffi
9e10176914 plugin XEP-0060: cast types of plugins used internally. 2026-03-04 12:32:48 +01:00
Goffi
df2a9ba8e8 plugin android: only media on Android only:
Importing `media` on desktop was causing trouble as it may not be installed.
2026-02-24 09:43:32 +01:00
Goffi
55e16c3db5 plugin pubsub contacts: Implementation of the new contacts handling XEP.
This patch implements Pubsub Contacts (currently named "End-to-End Encrypted Contacts
Metadata" but it will be most probably renamed soon as following council discussion, e2e
encryption won't be mandatory anymore).

It adds 2 bridge method `ps_contacts_get` and `ps_contact_set`, and handles retrieving
large contacts or groups lists using RSM.

rel 475
2026-02-23 13:15:16 +01:00
Goffi
0bc56134ad plugin XEP-0473: Decrypt items events when received:
The items events need to be decrypted too for plugin to handle correctly items updated or
retracted. When an event is decrypted, and `encrypted` attribute is added to the decrypted
<item> elements.

rel 475
2026-02-23 13:15:14 +01:00
Goffi
c21ac3af16 plugin XEP-0060: add_managed_node now do strict matching by default:
`add_managed_node` now match node when they are exactly the same by default, but if the
new `strict_match` argument is set to `False`, the old behaviour of matching all node
which start with the given `node` argument is used.

rel 475
2026-02-23 13:07:59 +01:00
Goffi
8805f63b1f plugins XEP-0473, XEP-0475, XEP-0477: rename plugins from prototype name to XEP number + doc update:
Plugin for pubsub encryption and signing were named using prototype name as the
specifications where not yet published at the time. Since, those specifications have been
accepted, so we can rename those plugins using the corresponding XEP numbers.

Doc has been updated to remove old mention saying that the XEP was still being evaluated.

rel 475
2026-02-23 12:56:42 +01:00
Goffi
1745f1e520 plugin XEP-0373: refactor and implement python-gnupg backend:
- split the plugin in several classes, with models, exceptions, and backends separated.
- add a backend for `python-gnupg`, as it can be pip installed without having to use
  `--system-site-packages` in the virtual environment.
- use modern syntax for type hints.

rel 475
2026-02-23 12:56:42 +01:00
Goffi
314b741cf6 plugin XEP-0060: fix extra passing when publishing an item. 2026-02-23 12:56:42 +01:00
Goffi
c297da7ec9 plugin (forge, forge_git): forge plugin first draft:
This plugin implements the base for the forge feature in Libervia.

The "forge" plugin introduces configuration to set repositories to expose with the forge
(per profile), and the default repository to show.
In the future, this may be done dynamically from frontends, so users can create/import
repositories themselves.

The "forge_git" plugin implements methods to handle Git repositories. In the future, other
types of repositories may be managed (e.g.; Mercurial), but for now the focus is on Git.
2026-02-18 17:49:36 +01:00
Goffi
77e2c9ce11 plugin (android): add missing import. 2026-02-18 17:44:23 +01:00