kibana/docs/user/security
Jonathan Buttner a78fece18b
[Cases] Adding _find API for user actions (#148861)
This PR adds a new find API for retrieving a subset of the user actions
for a case.

Issue: https://github.com/elastic/kibana/issues/134344

```
GET /api/cases/<case_id>/user_actions/_find
Query Paramaters
{
  types?: Array of "assignees" | "comment" | "connector" | "description" | "pushed" | "tags" | "title" | "status" | "settings" | "severity" | "create_case" | "delete_case" | "action" | "alert" | "user" | "attachment"
  sortOrder?: "asc" | "desc"
  page?: number as a string
  perPage?: number as a string
}
```

<details><summary>Example request and response</summary>

Request
```
curl --location --request GET 'http://localhost:5601/api/cases/8df5fe00-96b1-11ed-9341-471c9630b5ec/user_actions/_find?types=create_case&sortOrder=asc' \
--header 'kbn-xsrf: hello' \
--header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \
--data-raw ''
```


Response
```
{
    "userActions": [
        {
            "created_at": "2023-01-17T21:54:45.527Z",
            "created_by": {
                "username": "elastic",
                "full_name": null,
                "email": null,
                "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
            },
            "owner": "cases",
            "action": "create",
            "payload": {
                "title": "Awesome case",
                "tags": [],
                "severity": "low",
                "description": "super",
                "assignees": [],
                "connector": {
                    "name": "none",
                    "type": ".none",
                    "fields": null,
                    "id": "none"
                },
                "settings": {
                    "syncAlerts": false
                },
                "owner": "cases",
                "status": "open"
            },
            "type": "create_case",
            "id": "8e121180-96b1-11ed-9341-471c9630b5ec",
            "case_id": "8df5fe00-96b1-11ed-9341-471c9630b5ec",
            "comment_id": null
        }
    ],
    "page": 1,
    "perPage": 20,
    "total": 1
}
```

</details>

## Notable Changes
- Created the new `_find` route
- Created a new `UserActionFinder` class and moved the find* methods
from the `index.ts` file into there as well as the new find logic
- Extracted the transform logic to its own file since its shared between
multiple files now
- Extracted the user action related integration test functions to the
`user_action.ts` utility file

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
2023-01-23 13:25:41 -05:00
..
api-keys Allow users to Update API Keys (#146237) 2022-12-14 07:50:07 -05:00
authentication Fixing es template string and programmatic typo (#139014) 2022-08-17 12:17:57 -04:00
authorization Removing docs about multi-tenancy (#143698) 2022-10-24 16:01:43 -04:00
images [DOCS] Updates the screenshots for Reporting and sharing (#106435) 2021-07-26 10:55:26 -05:00
role-mappings [Docs] Update security and spaces docs/screenshots (#105652) 2021-07-15 16:04:33 -04:00
securing-communications [DOCS] Fix link and add redirect for removed security page (#119966) 2021-11-30 12:35:25 -05:00
tutorials [DOCS] Fixes inconsistency with role management link (#121351) 2021-12-15 14:45:23 -08:00
access-agreement.asciidoc Adding Global Access Agreement (#139217) 2022-09-06 11:54:57 -04:00
audit-logging.asciidoc [Cases] Adding _find API for user actions (#148861) 2023-01-23 13:25:41 -05:00
index.asciidoc [DOCS] Moves encryption key doc to tools section (#121021) 2021-12-14 13:28:35 -08:00
secure-saved-objects.asciidoc [docs] Improve Secure saved objects and kibana-encryption-keys docs (#132828) 2022-05-25 06:27:37 +02:00
securing-kibana.asciidoc [DOCS] Update security configuration for security ON by default (#118088) 2021-11-15 10:37:42 -05:00
session-management.asciidoc [+DOC] Add Session Settings Link (#126026) 2022-02-23 07:43:30 -07:00