mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
develop
22
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e4b9a2615b |
feat: add a shared base for integrations that connect an account through OAuth (#6810)
* feat: add a shared base for integrations that connect an account through OAuth * fix: keep OAuth account scopes current and bound provider answers * fix: share parent registration between form APIs * fix: preserve refreshed OAuth tokens when actions fail * refactor: use absolute imports for parent OAuth modules * refactor: decouple OAuth cleanup from application publication models * refactor: use common import hooks for OAuth connections * fix: keep OAuth account integrations out of the workspace --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com> |
||
|
|
c772afdb22 |
feat: show application integrations in one grouped table (#6901)
* feat: show application integrations in one grouped table * feat: show application integrations in one grouped table * test: open the integration menu to promote in the automation settings spec * refactor: share one integration row between both integrations tables |
||
|
|
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> |
||
|
|
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 |
||
|
|
5275ede481 |
fix: make SMTP and Slack integration credentials write-only (#6072)
* fix: make integration credentials write-only in the API The SMTP password and Slack bot token were returned in plain text by the integration API and broadcast to every collaborator over the websocket. * fix: record integration config changes in the undo log The exclude list used sensitive_fields, which for SMTP covers every field, so undoing an SMTP integration update restored nothing. * fix: require the SMTP password when the connection target changes Keeping the stored password while changing host, port or use_tls let a user redirect it to a server of their choosing, or downgrade the connection so it crossed the wire in the clear. * fix: refresh integration state from the update response The has_password and has_token flags are derived server side and nothing else refreshes them for the user who made the change. * feat: keep the saved SMTP password when it is not retyped The API no longer returns the password, so the form must distinguish an untouched field from a deliberate clear. * feat: keep the saved Slack bot token when it is not retyped Also mask the input, which rendered a bearer credential in plain text. * feat: explain why an integration credential must be re-entered * chore: add changelog entry for write-only integration secrets * test: cover write-only integration secrets end to end Unit tests on either side cannot see the seam between the form omitting an untouched credential and the backend reading an omitted one as keep. * fix: correct Slack integration copy and defaults for write-only tokens The summary read the token itself, so a configured bot showed as not configured, and the create warning told users the token could be read back through the API. * fix: keep every sensitive field out of the integration action log Narrowing the exclude list put the SMTP host into a replayable log while the credential stayed out, so a recorded target change could be replayed onto a password supplied later by someone else. It also wrote the AI integration's provider API keys into the action and audit logs. * fix: keep integration secrets required when there is nothing to keep Making every secret optional so an update need not retype it also made the Slack token optional on create, where no stored value can be kept. * fix: never use the instance SMTP account for an integration Django's SMTP backend replaces a None username or password with the instance's own. * fix: read has_token when checking a Slack bot in button field actions * fix: list writable credentials in the integration request schemas Also keep the blank error code for an empty token on create. * docs: correct integration secret comments and changelog * style: format button field action list spec * fix: validate integration updates as partial Keeps secrets required on create so the schema matches the server, and drops the None stripping and view-level secret check it made redundant. * docs: cross-reference the two secret_field_dependencies * docs: describe the write-only contract of integration secrets The copy stops a base serializer's extra_kwargs leaking into the type's shared dict, which made name optional on the create serializer. * docs: move integration secret reasoning into docstrings * fix: name the credential generically in the retype message * test: select the SMTP password input by type * test: expect the credential wording in the retype e2e * fix: document integration updates as partial The update validates with partial=True, but its per-type schema components still listed token and host as required. * fix: let undo restore non-credential SMTP settings Only secrets and the targets they protect stay out of the action log, so an SMTP username change can be undone. Types without secrets still exclude every sensitive field. * docs: point sensitive_fields readers to secret_fields sensitive_fields does not hide a field from API responses, so new integration credentials need secret_fields too. |
||
|
|
5459f9ecb5 |
feat[4c/6] Button field: send a Slack message (#6005)
* feat: let a database carry integrations, and take them along in an export
* feat: let a button field post to Slack through a bot of its own database
* feat: offer the Slack action in the button field editor, with the bots of its database
* docs: record where a button's external integrations live, and what an import drops
* fix: draw the button's action list the way the design does
* fix: put a Slack message's answer where its schema says it is
* test: drive the Slack action end to end, and send for real when a bot token is given
* test: let the e2e stack answer for Slack, so a click is proven in CI
* fix: charge a click for a Slack post its API refused
The refusal is raised once the post has been made, so treating it as
'nothing left the instance' handed the outbound slot back and let one row
drive unbounded requests at Slack.
* fix: read one rule for the integration a button may carry
Saving, importing and dispatching each spelled the rule out again, and
dispatch had lost the half about the field's own database. The refusal is
one answer now: three different ones let a caller walk the ids and learn
what the installation holds.
* fix: keep the Slack action standing on an answer that is not Slack's
The endpoint is configurable now, so a refusal need not carry an error
code, and a blocked address reads like the HTTP service's. The channel is
held to its column, and a half-filled form is described rather than
thrown over.
* fix: forget a database's integrations when its application is replaced
Remembering the fetch in a module-level map outlived the object it
described, so after any refetch the bot dropdown stayed empty and the only
thing offered was creating a second bot. A failed fetch is now reported
rather than left as an unhandled rejection.
* test: point the e2e suites at the renamed label and the stub's real path
The email spec picks its action by exact label, which this branch renamed,
and the stub was mounted from a path that does not exist once the recipe
has moved to the repo root.
* test: let the API guard for an unsupported application keep a type to refuse
A database accepts integrations now, so the endpoint test that used one to
prove the guard was asserting the opposite of what ships.
* fix: hold a database to the integrations its buttons can actually carry
Opening a database to integrations opened it to every type, so a Local
Baserow one, carrying an authorized_user, could be created on it and ride
along in every duplicate and snapshot. Refusing it on the action was not
enough. The list is read from the action types themselves, so the two
cannot drift.
* fix: answer a refused address and a stranger's JSON the way the HTTP action does
An address Advocate blocked was charged to the click although nothing was
sent, an answer that is not an object raised out of the service, and the
frame holding the bot token was logged with its locals. The channel form
also refused a length the API accepts.
* fix: check the integration an action carries on every save, not just the first
An edit that resent only the channel and the message skipped the read
check, so someone who may edit the field but not read the bot could
retarget it.
* fix: check who is copying an action against the integration it carries
Duplicating a field and changing a field's type both recreate the actions
without passing through the endpoint that checks the credential, so a copy
kept a bot the person asking for it may not read. The duplication hook now
carries the acting user, and a copy it cannot account for comes back
unconfigured.
* fix: hold a Slack answer to a size and a deadline, the way an HTTP one is held
The endpoint is configurable now, so its answer is not bounded by Slack's
own limits, and the request timeout restarts on every byte. A body that
drips could outlive the lock its dispatch time sizes, letting a second
click post against the same row. The reader the HTTP service already had
now lives beside the request function both of them use.
* fix: read the clicked field once, and survive an id an export made up
The dispatch guard read the field back through every action, two cold
queries apiece inside the lock, when the context already holds it. And an
integration id from an import file is not the validated integer the
endpoint's serializer produces, so a hand-edited export failed the job
with a database error.
* test: land a second click while a Slack post is still in flight
The lock that keeps two clicks off one row had no Slack coverage, which is
what the size and deadline on the answer are there to protect. The stub
holds one channel open long enough for the second click to arrive.
* docs: say what an empty integration list means, and what an authorized user does
It read as though only the row and frontend-only actions carried nothing,
when HTTP and email carry nothing either, for reasons of their own. And an
integration's authorized user does not outrank the clicker, it replaces
them: the dispatch never compares the two.
* fix: check what a duplicating user may read on every path that copies an action
The permission check only ran where a person copies an action in place, since
that was the only path carrying an actor. Duplicating a table or a database
goes through the serialized import instead, which had nobody to check, so the
copy kept a bot its owner may not read.
`ImportExportConfig` now carries who asked for the copy. An import from a file
and a template install still carry nobody, and keep what they came with.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: refuse an imported integration the application would not accept
The endpoint refuses a Local Baserow integration on a database, because its
authorized user would replace the clicker (ADR 006 section 5). The import path
never asked, so a hand written export placed one anyway, and it rode into
every duplicate and snapshot from there.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: read an integration id out of an export before keying the mapping with it
A list or a dict is not hashable, so looking one up aborted the whole import
job with a `TypeError`. `true` hashes equal to 1 and quietly picked up
whatever integration 1 was remapped to. A numeric string missed the mapping
and then resolved the id the export was written with, which is another
database's.
Coerced before the lookup rather than after, and booleans, containers and
floats refused outright.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* perf: read the bot once however many actions of a click share it
`select_related` only saves the base row. The token lives on the subtype, and
resolving that row by row cost a query per action, inside the lock that guards
the row. Three actions sharing one bot read it three times.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: hold a Slack post to the time its lock was sized for
The timeout Requests applies is per socket operation, not for the call as a
whole, and redirects were followed, thirty of them if offered. A configured
endpoint could spend a fresh timeout on every hop and outlive the lock that
guards the row, letting a second click through.
Redirects refused, since `chat.postMessage` answers directly, and the lock
sized off the socket operations the way the email service already does.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: remove only the containers the local e2e run started
A trap replaces the one before it rather than adding to it, so the Slack stub's
had to name httpbin too. It named it whether or not this run started one: point
E2E_HTTP_STUB_URL at your own stub and the block that starts httpbin never
runs, but the exit still removed whatever was using that name.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: let a fetched integration list land on the application still on screen
The fetch mutated the object it was handed, so a `forceSetAll` in flight left
the bots on an object nobody renders while the one on screen stayed empty. And
it cleared and repopulated with no ordering guard, so a bot created while the
request was open was wiped when the answer landed, with nothing to fetch it
again.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: ask again for a bot list the editor failed to fetch
The action cards are hidden rather than unmounted, so a fetch tied to a form's
own `created` ran once for the life of the editor. After a network blip the
dropdown read as a database with no bot, and the only thing offered was
creating a second one. Every form also reported the same failure, so three
Slack actions raised three toasts for one request.
The list owns the fetch now: it knows when a card opens, so reopening one asks
again, and there is one place to report from.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: make the integration dropdown selectable, editable and reachable
Every parent binds it with `v-model`, which listens for `update:modelValue`.
Creating an integration from the footer emitted `input` instead, so the bot was
created and then not selected. The auto select of a lone integration went the
same way.
The footer was an anchor with no href, so tab skipped it and no key opened it,
which left creating a first bot unreachable without a mouse.
And the footer only ever opened the modal to create. A database has no
integration settings page of its own, so an imported bot, whose token the
export stripped, could not be repaired from anywhere.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: say when a Slack action carries a bot with no token
An export strips the credential, so an imported bot arrives named and unusable
while the action still looks configured. Every click was then an outbound
request that was never going to work, and the reason only arrived after it.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* test: cover the Slack request deadline and its refused redirects
The tests for these were written with the fix and then left out of it, so the
lock sizing and the refused redirects went in uncovered.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: report a failed integrations fetch once for the request, not once per waiter
Moving the fetch to the list left the reporting with the caller, and a list can
be asked for the same request more than once. Each caller then caught the same
rejection and raised its own toast. Reported from inside the shared request
instead, so one failure is one message however many are waiting on it.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: describe the Slack answer where the dispatch actually puts it
`generate_schema` advertised `ok`, `channel` and `ts` at the root while the
dispatch kept them under `data`, so every path the data explorer offered for a
Slack node resolved to nothing. Chaining off one has never worked.
The schema describes the wrapper now, rather than the dispatch dropping it.
That leaves every sample an earlier version stored exactly as it is, so no
migration is needed. The cost is that this service describes its answer one
level deeper than the HTTP and email ones, which unwrap theirs instead.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* feat: say who else can use a Slack bot when its token is entered
A database's integrations are shared by everyone who can build in it, and nothing said
so at the moment that matters. The warning goes where the decision is made, and is
worded around reuse rather than exposure, since the token is never shown back.
It comes out again once ownership or private integrations land.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* docs: keep the integration rule in one place, and say what the new methods take
The comment on `allowed_integration_types` listed every action type's reason, which goes
stale the first time someone adds one. It now says what an empty list means and points
at the ADR, which carries the reasoning.
The methods this branch added or changed say what they take and what they answer with.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* docs: bring ADR 006 up to what phase 4c actually built
Section 5 said databases carry integrations while later sections still read as though
external actions were unbuilt: nothing to strip, nothing to reconfigure, no integrations
on a database at all.
Now recorded: which integration types an action may carry and why the list is empty for
most of them, that the database derives what it holds from those lists rather than
keeping a second one, which copy paths carry the requesting user and which deliberately
do not, what happens to a stripped token on import, and the Slack action's own
lifecycle.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* test: prove a Slack answer reaches the paths its schema offers
Three gaps found reviewing the fixes against what was asked for.
The e2e still reopened the dropdown to pick the bot it had just created, which
was the manual step the Vue 3 event was meant to remove. The dropdown now says
so on its own, and a form test covers it, asserting the selected value rather
than the item list, which holds the name either way.
And nothing exercised an automation node reading a Slack result, which is what
the shape question was really about. The new test builds the stored result with
`dispatch_transform` and walks the paths out of `generate_schema`, so moving
either side without the other fails it.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* refactor: cut the comments back to what is not already in the code
Roughly half of what this branch added restated the line below it or explained
at paragraph length what a sentence covers. Kept the ones that say why, dropped
the rest, and fixed a stale reference to an exception this service no longer
raises.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: keep the integration dropdown reaching its parent
Declaring `update:modelValue` in `emits` was half a fix. Vue keeps a declared
event's listener out of `$attrs`, so the parent's `onUpdate:modelValue` stopped
falling through to the dropdown below, which was the only thing carrying a
list selection back. Creating a bot worked; picking an existing one silently
did nothing, for the builder's data sources and user sources as much as for a
button field.
Everything now goes through `select`, and `autoSelectFirst` reads what the
parent actually bound rather than the `value` prop nobody passes.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: do not remember a load that backed off, or share one across requests
A fetch that backed off returned the list it declined to fill, which read as
success: the caller marked the database loaded, so bots that existed before
the request never appeared and nothing asked again. It answers null now, and
only a fetch that committed marks the load.
The in-flight map was also module scope, which one server process shares
across every request it renders. Keyed by store instead.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: let an action's bot be cleared without permission to read it
`get` cannot tell a key the request never sent from one sent as null, so
clearing the integration resolved to the one already carried and was refused
to anyone who could not read it. Removing a credential takes nothing away
from anyone, so it needs no such permission. An absent key still keeps and
checks what the action carries.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: stop a failed Slack request repeating the message back in its error
`except ConnectionError` caught the builtin, which requests' own
ConnectionError does not inherit from, so that branch never ran and the
failure fell through to a clause that raised `str(e)`. Requests builds that
message out of the whole URL, and this one's query string carries the channel
and the resolved message text.
`response.json()` sat in the same block, so a proxy's HTML or a redirect body,
which `allow_redirects=False` now stops following, surfaced as an opaque parse
error. Read outside it, and reported as an answer that is not Slack's.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: let a database still turn integrations off entirely
The override answered from the action types alone, so `supports_integrations`
was dead for databases. The two tests that turn it off to exercise the guard
were passing on the allow-list instead, and would have passed with the guard
deleted. Both now name a type the allow-list accepts, so only the flag can
refuse it.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* docs: say that a bot's token can be read, because it can
The warning claimed the token stays hidden. The integrations endpoint
serializes it in the clear, as it does for every other type, and this branch
is what exposes that endpoint on databases. Reworded, and the ADR with it,
noting that masking it on read is worth doing and is not scoped here.
Also finishes the comment trim, which a script gave up on halfway through, and
sources the Slack logo from the integration type that already owns it.
Claude-Session: https://claude.ai/code/session_0125wkP6wPcyQ3MZwtbDawhr
* fix: send the Slack channel and message in the body, not the query string
Both are row data. A query string is what a proxy writes to its access log, and
this PR makes the destination host configurable, so the message travelled
further than it needed to. The error path already worked around this by
refusing to repeat `str(e)`; sending the payload as form data removes the
reason for that.
* fix: keep a bot out of a duplicate made by someone who may not read it
A duplicate is taken with `exclude_sensitive_data=False`, so the bot was cloned
into the new database with its token. The action's `ReadIntegration` check then
ran against that clone, which lives in an application the duplicator owns and
can read, so it always passed. Denying read on a bot and duplicating the
database was a way to obtain its token.
The credential is left out of the export instead, and the copied action drops it
for want of one it may carry. One `check_multiple_permissions` call for the
whole list rather than one per integration.
The existing test passed only because it denied the operation by name, which
denied the clone too. The new one denies a single object, the way a per-object
role assignment does.
* perf: stop reading the same integration row three times on every save
The check resolves the integration to check it, then hands the id on and the
service type reads the same row twice more, base and subtype. It passes the
instance it already has instead. Its own checks are looser than the ones that
have just run.
The click path resolved integrations with `specific_iterator` directly, which
skips each type's `enhance_queryset`, trading one query per action for one per
related row. It goes through `IntegrationHandler.get_integrations` now.
Also says in the comment why an edit that does not resend the id is still
checked: the channel and the message are the whole of what a bot does.
* fix: skip an integration an application will not take, rather than fail the import
The gate refused the whole job. No export this instance writes can fail it
today, but a release that stops registering an action type would turn every
snapshot holding that integration into one that cannot be restored, and a
restore is the one path a user cannot work around.
The row still does not land, which is what the gate is for. An action naming a
skipped integration imports unconfigured, the same as for any integration it may
not carry. Only the database type narrows what it accepts, so nothing else can
see the None this now returns.
* refactor: tidy what the database does with its integrations
Share one cache across the integrations it exports and imports, the way builder,
automation and dashboard already do, so a type that serializes a file writes it
once. Count them in the import progress, which reported 100% before they were
done.
Keep `supports_integration_type` out of the middle of the class attributes and
read the accepted types once per call instead of scanning the registry inside a
generator. Not cached across calls: a test can register an action type.
Drop `_read_response_within_limit`, which had become a one-line pass-through to
the util the module already imports.
* fix: do not let a delayed integrations fetch undo a change made while it ran
Only a create or a delete bumped the generation the fetch reads, so an edit or a
reorder landing mid-request was overwritten by an answer written before it. For
a bot's token that reads as a missing credential on a bot that has one.
The fetch also restored the counter to what it found after writing its answer,
which dropped a bump a create had committed in the meantime and let a second
fetch write a list without the new bot. It commits the rows directly instead:
its own writes were never a change to back off from.
* fix: say when a Slack action points at a bot that is not there
An empty list read as healthy, so a bot deleted since, or one named by an import
made elsewhere, left the action looking configured until the click failed. It
now waits for the list to have been fetched rather than for it to be non-empty,
and reports a bot it cannot find.
A fetch that failed stays quiet: the list is unknown then, not empty, and the
failure already raises its own message.
* fix: offer to edit an integration only where there is nowhere else to
The edit button went into the shared dropdown, so it appeared in the builder
data source and user source forms, automation, dashboard, the AI agent form and
the SMTP form. All of those have an integration settings page; a database does
not, which is the reason the button exists.
It is behind a prop now, and the Slack form passes it only for a database.
* fix: match the slow Slack stub on the body the request now sends
Moving the payload out of the query string left this stub matching on a
`channel` query parameter that is no longer there, so it never matched and the
catch-all answered at once. The concurrent-click test lost the delay its lock
assertion depends on, and would have passed without ever holding a lock.
* fix: ask again for an integrations list that changed, rather than dropping it
Bumping the generation on an edit or a reorder made the back-off common, and
only the button field caller reads the null it returns. The builder awaits this
inside `loadExtraData` and then marks itself loaded either way, so renaming an
integration while that fetch was open left every data source and user source
dropdown empty until a reload.
It asks again instead, up to three times, and answers null only when the list
will not settle. The tests give the retry the answer a server would have by
then.
* fix: do not call a bot missing when it may only be hidden
`get_integrations` filters the list by what the caller may list, so a bot absent
from it is either deleted or invisible to this user and there is no telling
which. Someone with no list access to a colleague's bot was told a working
action was broken, and following the message would have overwritten it.
* refactor: read the accepted integration types without building a set
One membership test does not need a frozenset of every type: the generator it
replaced short-circuited and allocated nothing. Not keeping the answer was the
right call; building the set was not.
Also `or []` for the imported integrations, since a hand-edited export can name
the key with an explicit null, and two test names and a docstring that still
described the behaviour before this branch changed it.
* test: open the Slack answer's data node before reading its fields
The schema describes the wrapper the dispatch actually writes, so `ok`,
`Channel` and `Message timestamp` sit one level in. The test still expected
them beside the action, and had been failing since the schema was corrected.
Opening the node is what a user does to reach them.
* fix: mount the Slack stub from the directory the recipe actually runs in
`just --justfile e2e-tests/justfile` runs recipes from that file's own
directory, so `$(pwd)/e2e-tests/stubs/slack` pointed a level too deep. Docker
created the missing path and mounted it empty, WireMock started with no
mappings, and every Slack call answered 404. CI was unaffected: it mounts the
stub by workspace path.
* docs: say why the application type is compared as a literal here
`integrations` must not import from `database`, and the sibling forms compare
`application.type === 'automation'` the same way.
* Revert "fix: mount the Slack stub from the directory the recipe actually runs in"
This reverts commit
|
||
|
|
3fb5c3c78b |
feat: improve action selection with searchable grouped menus (#5720)
--------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com> |
||
|
|
716d43a9a8 |
Nuxt 3 migration (#4342)
Update the nuxt3 version. Co-authored-by: Jonathan Adeline <jonathan@baserow.io> Co-authored-by: Bram Wiepjes <bramw@protonmail.com> Co-authored-by: Cezary <cezary@baserow.io> Co-authored-by: Tsering Paljor <tsering@baserow.io> Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io> Co-authored-by: Bram <bram2w@users.noreply.github.com> |
||
|
|
dbb1bcdd62 |
Slack send message service (#4187)
* Initial working commit * Post rebase tweaks. * Backend tests; more moving files around; post-rebase tweaks. * Improving the experience setting up the slack bot integration. There are now instructions inside the modal to guide you. * We don't always start with an integrationType. * Small bug fixes and improvements. * Lint fix * Post-rebase lint * Forgot a comma * Address spirit-check feedback * Address feedback |
||
|
|
c02ff15aeb | Small automation QOL/UX improvements. | ||
|
|
a58e6a3300 | Vuelidate upgrade | ||
|
|
fb927e12ba | Refactor dropdown component | ||
|
|
10fec15531 | Use small/dense style for Element Panel's Fields | ||
|
|
7ec592c196 | Fix form group error and other regressions | ||
|
|
df738083a6 | FormGroup FormInput FormTextarea refactoring | ||
|
|
3dd3d98972 | Buttons refactor | ||
|
|
3c17df7fe0 | Integrations are now loaded with the application | ||
|
|
61cc89bcf1 | 4️⃣ Add user sources to the application - frontend | ||
|
|
fb710657a0 | alerts & toasts refactor | ||
|
|
d924627e80 | Restyle alert and toast components | ||
|
|
4321aaea9a | Replace icons | ||
|
|
327e197522 | Resolve "Allow to define external service integration" |