-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch existing entities in
POST /bundle/import
(#1383)
<!-- Specify linked issues and REMOVE THE UNUSED LINES --> **Epic** advthreat/iroh#7341 Related advthreat/iroh#8207 Current behavior of bundle import on existing entities is to ignore them. This PR changes behavior to patch in this case, and loosens the schema for bundle import so then partial entities are allowed if patching. <!-- UNCOMMENT THIS SECTION IF NEEDED <a name="iroh-services-clients">[§](#iroh-services-clients)</a> IROH Services Clients ===================================================================================== Put all informations that need to be communicated to IROH Services Clients. Typically IROH-UI, ATS Integration, Orbital, etc... --> <a name="qa">[§](#qa)</a> QA ============================ This PR adds the ability for `POST /bundle/import` to patch entities. The following steps test if this procedure works. 1. Create an existing entity (for example an Indicator) and note its id. 2. Patch this entity using `POST /bundle/import`. For example, patching the `:producer` field of the indicator: ``` POST /bundle/import?patch-existing=true {:indicators [{:id "<id-from-step-1>" :producer "PATCHED"}]} ``` 3. Verify that the result looks something like this (the `"updated"` part is the most important part): ``` {:results [{:result "updated" :id "<id-from-step-1>"}]} ``` 4. Look up the indicator via `GET /ctia/indicator` to verify that the `producer` field was updated. <!-- UNCOMMENT THIS SECTION IF NEEDED <a name="ops">[§](#ops)</a> Ops =============================== Specify Ops related issues and documentation - Config change needed: threatgrid/tenzin# - Migration needed: threatgrid/tenzin# - How to enable/disable that feature: (ex remove service from `bootstrap.cfg`, add scope to org) --> <!-- UNCOMMENT THIS SECTION IF NEEDED <a name="documentation">[§](#documentation)</a> Documentation ============================================================= Public Facing documentation section; - Public documentation updated needed: threatgrid/iroh-ui# See internal [doc file](./services/iroh-auth/doc/public-doc.org) --> <a name="release-notes">[§](#release-notes)</a> Release Notes ============================================================= <!-- REMOVE UNUSED LINES --> ``` intern: Patch existing entities in POST /bundle/import ``` <a name="squashed-commits">[§](#squashed-commits)</a> Squashed Commits ======================================================================
- Loading branch information
Showing
16 changed files
with
1,122 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.