Commit Graph
17 Commits
Author SHA1 Message Date
Tsering PaljorandJeremie Pardou 250748c8dc feat: Workspace level integrations (#6547)
* Add ADR-013 for workspace level integrations

* Add implementation

* Improve context section and remove technical points

* Move bulk replacement point to v2

* Remove workspace-level ownership on import since manual promotion should handle this.

* Add a glossary section

* Do Lazy creation + Celery migration

* Remove demotion

* Tighten the Options considered section

* Add Decision describing where the integrations are managed

* Update implementation plan after changes to ADR

* Sync plan and adr

* Rename adr and implementation

* Add the shared application that owns workspace integrations

* Create the shared application of every workspace

* Let only workspace admins manage workspace integrations

* Let applications use the integrations of their workspace.

* Trash workspace integrations in their workspace.

* Copy workspace integrations into exports and keep them in duplicates.

* Workspace admins can share integrations with every application in the workspace.

* Load the shared application of each workspace in the frontend and keep it out of application lists.

* Manage workspace integrations from an Integrations page in workspace settings.

* Offer workspace integrations in the integration dropdowns of every application.

* Move promoted integrations to the workspace list in other open tabs.

* Let admins make an app's integration available to the whole workspace from its integration settings.

* Preselect a workspace integration for new nodes and data sources when the app has none of its own.

* fix tests

* Delete implementation file

* More fixes after rebase

* Fix tests

* Let builders of an application see and use the workspace integrations from it.

* Show the workspace integrations, read-only, in the integration settings of applications.

* Keep a dashboard's integration out of promotion to the workspace.

* Leave the shared applications out of the admin dashboard's application count.

* Create the shared application of the workspaces made by the fill commands.

* Say in the promotion modal that an integration nobody authorized will run as the promoting admin.

* Say in the promotion modal that undoing it won't make the integration run as the previous person again.

* Ignore integration ids in sample data when publishing copies the workspace integrations an app uses.

* Let only undoing a promotion move an integration out of the workspace.

* Let the shared application backfill stop itself after 5 minutes and skip workspaces another transaction has locked.

* Say in the workspace integrations settings that published applications and workflows keep their own copy until they're published again.

* Leave the shared application out of the assistant evals' application counts.

* Refresh the workspace integrations when the Builder's data, events, users and integrations panels open.

* Say that anything new using a promoted integration blocks undoing the promotion, even from its own application.

* Warn when a database button sends through a workspace integration with no host or token.

* Refuse roles and invitations on the shared application.

* Fix tests

* Show an application only the workspace integrations of types it can use.

* Say in the promotion modal what builders of other applications can do as the integration.

* Leave the shared application type out of the API docs for creating and updating applications.

* Check who receives a workspace integration event in one permission call.

* Say which workspaces have a shared application and who creates it.

* Let a redone promotion record what uses the integration again.

* Update docstrings

* Stop template visitors from listing the integrations of the template's workspace.

* Let database buttons find their own copy of a workspace integration after an import.

* Say what holds the workspace row lock while a shared application is created.

* Fix tests

* Stop the workspace integration form component from being made reactive.

* Make test runs use a new copy of the workflow after an integration it uses changes.

* Hide the Members settings tab from members who can't list the workspace members.

* Add changelog

* Fix migration conflict

* Fix migration conflict

* Fix test

* Update comments and ADR number

* Link to the workspace integrations from the sidebar's Settings menu.

* fix: refresh agent action errors when workspace integrations change

* fix: move workspace integrations into workspace settings

* fix: use share icon for workspace integration promotion

* refactor: use explicit shared application relations

* feat: centralize default integration selection

* refactor: share integration change notifications

* refactor: prepare integration mappings before import

* refactor: collect integration references during export

* refactor: prepare integration ownership changes without a new hook

* test: restore registered service model after mocking

* test: cover shared integration defaults in Builder

* test: include Slack in Agent workspace integration choices

* Fix migrations

* Stop template visitors from listing the workspace integrations through an application of the template.

* Only offer integrations of the user source's integration type when updating a user source.

* Say the workspace integration copy means published Application Builder apps and automation workflows.

* Use the same spacing under both integration settings sections and enlarge their headings.

* Keep the shared application out of automatic snapshot schedules.

* Fix test after rebase

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-11-27 15:49:32 +04:00
Peter EvansandJeremie Pardou c152a16f92 feat: let Kuma create, change and remove data source filters from the filter form, the chat and MCP (#6544)
* feat: let Kuma create, change and remove data source filters from the filter form, the chat and MCP

* fix: allow earlier data sources in Kuma builder filters

* refactor: share targeted Kuma action endpoint

* refactor: derive service filter validation from filter types

* fix: reuse shared boolean values in service filters

* refactor: expose filter deprecation on backend types

* refactor: delegate formula examples to application types

* fix: allow Kuma to edit summary widget filters

* test: include summary widgets in filter tool contract

* fix: allow dashboard service filter groups

* test: allow dashboard filter groups in assistant prompts

* feat: enable inline Kuma for summary widget filters

* test: initialize roles for transactional synced table copies

* fix: reject table changes during Kuma filter generation

* fix: reject current node formulas in service filters

* perf: batch filterable data source discovery

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-11-24 18:08:58 +00:00
Davide Silvestri 5169076065 feat: introduce User-backed workspace identities (#6556)
* feat: introduce User-backed workspace identities

Replaces workspace core.Agent subjects with identities stored as Django
Users, so permissions, execution and attribution use the same record.

- User.objects and WorkspaceUser.objects are human-only; permission and
  identity code opts in through objects_and_identities. is_human and
  is_identity classify a user at runtime.
- Login, tokens, seats, notification recipients, personal views and
  last-admin checks stay human-only. Roles, teams and field grants work
  for identities unchanged.
- Agent applications run as an identity, never as a person. Every shared
  tool rechecks the identity's authority on each call, and MCP refuses a
  tool that skips that boundary.
- Migrations add the profile metadata and index, remove the Agent model
  and delete or clear legacy Agent data: trash entries, role assignments,
  team memberships, integration authorizations and run-as bindings.
- Rename the management API, UI, events and feature flag to identity.

Squashed and rebased onto develop; the previous history is kept on
backup/6556-before-develop-rebase.

* refactor: remove generic subject options endpoint

* refactor: simplify identity selection and Agent run-as options

* feat: distinguish identity notification senders

* fix: restrict identity bindings to identity managers

* docs: record users and identities verification

* fix: restore snapshots as the person restoring

A restore checked the snapshot creator's permission and used the creator
to decide whether an Agent keeps its identity binding. It now checks the
person restoring, passed to the import as `restored_by`. `copied_by` stays
unset on restore, so credential checks keyed on it behave as on develop.

Restoring a snapshot whose creator was deleted works again. The copy rule
for identity bindings covers Agent run-as only; a copied Local Baserow
integration keeps its authorized subject.

* fix: leave settings pages the user may not open

A settings route without a permitted tab rendered an empty page, as the
Identities page did with its feature flag off. It now opens the first
page the user may see.

* fix: renumber the legacy Agent cleanup migrations

Develop added agent 0016 and integrations 0043, so the migrations that
clear legacy Agent run-as bindings and integration authorizations move to
agent 0017 and integrations 0044.

* test(agent): run the trigger self-event test as an identity

The test added on develop created a `core.Agent`, which this branch
removes. It now uses an identity user as the Agent's run-as subject.

* perf: load user types once per batched permission check

* refactor: state the stored subjects in each subject type

* fix: give every user a profile

* fix: keep identity attribution on rows copied in their workspace

* refactor: give people and identities their own subject type

UserSubjectType stays the type both are registered and stored under. It forwards what differs to HumanSubjectType and IdentitySubjectType, so get_specific_type is the only place in subject code that inspects the user type. The registry returns the specific type on request and get_by_model keeps returning the stored type, which never reads the profile.

An identity's membership is checked in one query instead of two.

* fix: keep the roles of identities when a database is duplicated

The role import read subjects through the model's default manager, which only returns people, so duplicating or restoring a database failed when an identity held a role on it. It now resolves the subject through the subject registry.

A subject that no longer exists is skipped instead of failing the whole duplicate or restore.

* refactor: look up a subject type from its content type in one place

* fix: reload a cached token whose profile is incomplete

A token cached by the previous release has a profile without the user type, which reads as not a person, so its requests were refused until the entry expired. The token cache now treats it as a miss, with the check the user cache already used.

* refactor: check the user type once where the check was repeated

The MCP endpoint loader, the personal view permission manager and the identity trash type each asked the same question several times. The rule that an identity is never selected by email moves from the team handler to the identity subject type.

* refactor: leave trashed workspaces out of the identity membership manager

WorkspaceUser.objects_and_identities was named after objects but also returned memberships of trashed workspaces, so callers filtered them by hand. It now follows the existing pair: it leaves trashed workspaces out, and objects_and_identities_and_trash includes them, as objects_and_trash does for people.

* test: state the behaviour of every user type

The table fails when a user type is added and says what has to be decided first. An unknown type is checked to be denied.

* refactor: refuse to say whether a stored user subject is interactive

The answer differs between a person and an identity, so reading it from the stored type would be wrong for one of them. It now raises and points to the specific type.

* refactor: lock the person in membership writes instead of checking the type

Leaving a workspace, removing a member and adding a user lock the user through the people manager, which refuses an identity or an unknown type in the same query. Nothing adds an identity through add_user_to_workspace, so its branch for identities goes. The last admin check compares the membership with the people who are admin, which needs no type check.

* test: leave no rows behind in the legacy authorization migration test

The test left an integration that pointed at a user that didn't exist and a workspace, in the database the migration tests share. Tests that ran after it then failed on the foreign key or on the workspace id. It now uses a real user and empties the two tables.

* docs: describe the subject types and compare the Subject table alternative

ADR 013 is shorter and states that people and identities each have a specific subject type under the stored auth.User type. It compares shared User storage with a Subject table that users and identities would both point to.

* chore: run the legacy run-as cleanup after the agent actions migration

Develop added agent migration 0017, so the cleanup becomes 0018 and depends on it.

* test: leave no rows behind in the legacy agent migration tests

Like the legacy authorization test, these left a workspace in the database the migration tests share, which a later test that creates workspaces with fixed ids collides with.

* fix: write and read the workspace role of an identity in one place

The role assignment API wrote the role of an identity through the membership update of people, which told every member of the workspace about it and stored Builder as MEMBER, while the identities API stored BUILDER and returned the stored value. Both now write through the identity handler, which stores the role like the role of a person, and the role is read with the resolver the workspace members use.

* fix: take no row lock in the membership writes of a person

Leaving a workspace locked the user before the membership while removing or updating a member locks the membership first, so the two could deadlock. The user type never changes and these operations refuse an identity, so the lock protected nothing: they now only check that the user is a person. Leaving no longer locks the admin memberships and removing a member no longer checks for the last admin, as before identities.

* fix: find an identity by its name only in the subject options

The search also matched the email and username, which for an identity hold an internal key, so searching a part of that key returned every identity.

* chore: run the identity migrations after the new ones on develop

Develop added core 0138, integrations 0044 and enterprise 0073, so the identity migrations become core 0139 and 0140, integrations 0045 and enterprise 0074 and depend on them.

* fix: keep the identity of a copied integration only for identity managers

A duplicated application or a restored snapshot kept the identity its Local Baserow integration acts as, without checking the person who made the copy. Restoring a snapshot could so bring back a binding an admin had removed. The copy now keeps the identity only when that person may bind identities, as the Agent application already did, and is otherwise authorized as that person.

* docs: follow the renumbered migrations and the copy rule in the test plan

The test plan named the identity migrations and their tests by their old numbers and still said a copied integration keeps its subject.

* test(agent): run the row trigger tests as an identity

The row trigger tests added on develop created a `core.Agent`, which this
branch removes. They now use an identity user as the Agent's run-as
subject, and the e2e fixture creates it through the identities endpoint.
2026-11-18 08:44:31 +00:00
Jérémie Pardou 93eeb19dcb feat: run Local Baserow integrations as Agents (#6064)
* Run Local Baserow integrations as Agents

* fix tests

* feat(core): add reusable subject options endpoint

* Add beta badge

* fix(audit-log): require actor type with actor id

* fix(audit-log): avoid duplicate actor export columns

* fix(audit-log): guard deprecated actor fields

* Restore the feature flag

* fix tab alignement

* fix(integrations): reject trashed authorized agents

* Fix migration conflict

* fix(audit-log): assert structured validation error

* fix(database): support agent row deletion trash entries

* fix(database): support agent row notifications

* fix(core): enforce subject option permissions

* chore: fix formatting after rebase

* fix(core): include agents in member totals

* fix(database): batch row history actor migration

* fix(integrations): handle trashed authorized agents

* fix(core): remove untranslated subject labels

* chore: move nodes around

* test: mock integration registry in AI agent service tests

* fix: resolve database migration conflict

* Add changelog entry

* feat: use typed subjects for local Baserow integrations

* fix: make audit actor migration retry-safe

* fix: retain historical audit actors

* Please linting

* fix: use canonical local integration subjects

* fix: order listed workspaces

* fix: validate current user integration authorization

* fix: preserve integration authorization on update

* docs: clarify migration deployment compatibility

* fix: paginate local baserow agent selection

* fix: validate selectable subject options

* fix: preserve integration authorization on update

* fix: show saved integration user in subject dropdown

* fix(enterprise): protect team subject options

* fix(builder): redispatch data sources for trashed agents

* fix(database): split row history actor backfill

* fix(enterprise): require audit log actor type

* fix(enterprise): use audit log actor options

* fix(core): prevent blank agent names

* fix(integrations): resolve migration conflict

* fix(integrations): pass SMTP preparation context

* docs: clarify migration rollout guidance

* fix: handle trashed integration subjects

* fix: reuse local integration authorization column

* fix: allow unconfigured local integrations

* fix: only update changed integration values

* fix: cache local integration subjects

* fix: sort field permission subjects by name

* fix: include historical audit log actors

* fix: center grow tab labels

* chore: remove unused AI providers flag

* fix: support agent file uploads

* Please linter

* fix: initialize integration edit values

* fix: preserve integration authorization updates

* fix: bound audit log actor pagination

* fix: support legacy local integration fixtures
2026-10-19 10:38:57 +02:00
Peter Evans 00dc3ad544 feature: introduce further undo/redo support in builder (#5691) 2026-09-08 13:55:09 +01:00
Peter EvansandJeremie Pardou b70bc968db chore: (1/2) implement the graph system in the builder backend (#4706)
Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-06-25 10:09:24 +01:00
Davide Silvestri 3e774f88f1 fix(realtime): Realtime updates for data sources and workflow actions (#4587)
* Add realtime signals for data-sources and workflow-actions

* Address feedback for data sources and other handlers

* Add realtime update for theme

* apply Peter's patch

* Fix flaky test
2026-02-03 10:54:20 +01:00
Jérémie Pardou dc5ac46146 Fix sentry bug BASEROW-SAAS-WEB-FRONTEND-59P 2025-08-06 15:39:43 +02:00
Jérémie Pardou b199b2cc02 Fix some sentry bugs 2025-06-16 10:26:08 +02:00
Davide Silvestri 845d4677db Resolve "Row enters view webhook event type" 2025-03-14 15:06:52 +01:00
Jeremie Pardou 44ba650275 Fix store issue on selected element in templates 2025-02-05 15:40:11 +01:00
Jérémie Pardou 6c6f1774bd Allow shared data sources 2024-10-17 15:49:51 +00:00
Jérémie Pardou b744b1a809 Resolve "Optimize AB data flow for data source and integrations" 2023-08-11 10:02:53 +00:00
Alexander Haller 5fc28f50c8 Resolve "Container Elements - Column Element" 2023-08-08 13:28:03 +00:00
Alexander Haller cd68fb99a5 Resolve "Add realtime update for element" 2023-08-03 08:35:25 +00:00
Jrmi 08af8e4676 Use move method instead of ordering every element in a page 2023-03-29 09:42:52 +00:00
Alexander Haller cd9a541efe Resolve "I can add Pages to a Builder application" 2023-02-27 14:33:19 +00:00