* 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>
* 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.
* 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