Commit graph

4,761 commits

Author SHA1 Message Date
Goffi
f03939e2af doc (components/pubsub): Pubsub component documentation:
fix 476
2026-04-15 22:15:46 +02:00
Goffi
e7c508b11c doc (components): Update Tigase doc URL (former was a dead link) 2026-04-15 22:15:18 +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
3aa58e73dc memory (sqla): new pep column in PubsubNode:
This column can be used for quick filtering on PEP nodes.

rel 476
2026-04-14 23:10:19 +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
ba9a2fc6d5 tests (unit/XEP-0338): Fix async call to xep_0338._jingle_handler_trigger 2026-04-14 23:06:12 +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
c10c34304a tests (unit/email gateway): Fix tests 2026-04-11 12:46:47 +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
f1ceb7db8e memory (sqla): Add with_parent and with_link to get_pubsub_nodes():
Added `with_parent` and `with_link` parameters for eager loading of parent and linked_node
relationships.

Fixed CTE to include all children (not just base nodes) and use `selectinload` for parent
to avoid cartesian products.

rel 476
2026-04-11 02:08:15 +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
31b55fbbe7 tests (unit/component pubsub): Fix tests
rel 476
2026-04-11 01:55:15 +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
4b91ea873e memory (sqla): New node_id, with_parent and with_link argument for get_pubsub_node:
- A node can now be retrieve directly by its ID.
- `with_parent` and `with_link` let load `parent_node` and `linked_node`.

rel 476
2026-04-10 22:02:53 +02:00
Goffi
2c3d11e7ff tests (unit): Pubsub component tests:
rel 476
2026-04-09 21:47:53 +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
73b410aa97 tests (unit/cli/calls): Skip tests in case of missing media or webrtc:
Test were raising exceptions when optional modules were missing (GStreamer related modules
for `webrtc`). Those are now catched so the tests are simply skipped in this case.

`MissingModule` is now inheriting from `ImportError`, as it's a natural subclass, and it
makes import error catching easier.
2026-04-09 21:47:46 +02:00
Goffi
72d7868eb5 tests (unit/conftests): Add a reset_storage autouse fixture:
Storage can be modified by tests, and it is kept for the whole session, this may have side
effect resulting in other tests failing. This fixture avoid this problem by reseting
`storage` between each test.
2026-04-09 21:47:43 +02:00
Goffi
0cfeea8203 tests (unit/conftest): bridge is now a read-only property, update _bridge instead. 2026-04-09 21:47:07 +02:00
Goffi
378c6e3fef memory (sqla): docstrings/type hints improvements 2026-04-09 21:47:06 +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
0a0735ec4c memory (sqla): Add methods to handle pubsub node subscriptions:
Add `get_pubsub_subscriptions` and `set_pubsub_subscriptions`.

rel 476
2026-04-09 10:11:29 +02:00
Goffi
753623e934 cli (pubsub/node/subscription/set): Fix bridge call 2026-04-08 16:16:20 +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
cba0e388b6 core (types): fix name conflict with xmlstream + docstring for is_local. 2026-04-04 00:48:19 +02:00
Goffi
7af89d3abd core (memory/param): Replace warning sign in ASCII by emoji:
The warning sign in ASCII should be escaped, but that doesn't play well with docstrings.
Emoji is a better option.
2026-03-31 13:00:31 +02:00
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
346c640f75 cli (config): add default verbosity config (verbosity) 2026-03-31 12:49:39 +02:00
Goffi
c4954ab508 cli: Set default verbosity for missing import messages:
Missing import messages now only display when verbosity is >= 2, this is to avoid
polluting the output. Dependency may be missing because user has not installed all
optional packages, the display should not show that every time.
2026-03-31 12:46:53 +02:00
Goffi
60753f4d71 tools (config): QoL improvements:
- correct the case of `dynamicSettingsRegister` and `dynamicSettings` which are `dict`, not
  classes.
- Use new `DynamicSettingsCollection` as base class for classes dynamically built during
  parsing, to avoid name conflict.
- Use `DynamicSettingsCollection` instead of `dict` in dynamic field (`plugin` and
  `component`). This correct inconsistency, and make linters happy.
- Catch `TOMLDecodeError` when parsing config, to show a more readable error message
  instead of full backtrace.
2026-03-30 12:05:47 +02:00
Goffi
685193602e cli (profile): fix profile check for create and delete:
When checking existing profiles with `bridge.profiles_list_get`, all profiles have to be
retrieved, including components.
2026-03-30 12:05:13 +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
c634204ac7 core (main): log errors during post_init. 2026-03-30 11:37:17 +02:00
Goffi
b9762ce474 core (launcher): log configuration filenames. 2026-03-30 11:37:17 +02:00
Goffi
80944e7a62 core (constants): Fix path for hidden config files in $HOME:
Config file can be hidden in $HOME (`~/.libervia.toml`), and the path was wrongly handled
probably following a change to use `Path`.
2026-03-30 11:37:17 +02:00
Goffi
a9fa2eeed4 core (main, config): Component auto-configuration:
New `jid`, `secret` and `autoconnect` field are used for component settings. When used,
backend will automatically create the profile and set its relevant parameters, or check
that existing profile is in sync (and update it if necessary).

This make component installation easier to Libervia, as it is not
necessary anymore to use the CLI frontend to install a component.

rel 476
2026-03-30 11:37:17 +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
9fb5912567 install (dependencies): use tx-xmpp from PyPI 2026-03-22 13:18:00 +01:00