-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Search Session] Control "Kibana / Search Sessions" management section by privileges #90818
Changes from 2 commits
8685270
697cba8
c0d88bc
2cccde7
e46e555
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SEARCH\_SESSIONS\_MANAGEMENT\_ID](./kibana-plugin-plugins-data-public.search_sessions_management_id.md) | ||
|
||
## SEARCH\_SESSIONS\_MANAGEMENT\_ID variable | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
SEARCH_SESSIONS_MANAGEMENT_ID = "search_sessions" | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export const SEARCH_SESSIONS_MANAGEMENT_ID = 'search_sessions'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,8 @@ export function getTimelionRequestHandler({ | |
}); | ||
|
||
try { | ||
const searchSessionOptions = | ||
searchSessionId && dataSearch.session.getSearchOptions(searchSessionId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return await http.post('/api/timelion/run', { | ||
body: JSON.stringify({ | ||
sheet: [expression], | ||
|
@@ -108,8 +110,8 @@ export function getTimelionRequestHandler({ | |
interval: visParams.interval, | ||
timezone, | ||
}, | ||
...(searchSessionId && { | ||
searchSession: dataSearch.session.getSearchOptions(searchSessionId), | ||
...(searchSessionOptions && { | ||
searchSession: searchSessionOptions, | ||
}), | ||
}), | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ export const metricsRequestHandler = async ({ | |
}); | ||
|
||
try { | ||
const searchSessionOptions = | ||
searchSessionId && dataSearch.session.getSearchOptions(searchSessionId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return await getCoreStart().http.post(ROUTES.VIS_DATA, { | ||
body: JSON.stringify({ | ||
timerange: { | ||
|
@@ -58,8 +60,8 @@ export const metricsRequestHandler = async ({ | |
filters: input?.filters, | ||
panels: [visParams], | ||
state: uiStateObj, | ||
...(searchSessionId && { | ||
searchSession: dataSearch.session.getSearchOptions(searchSessionId), | ||
...(searchSessionOptions && { | ||
searchSession: searchSessionOptions, | ||
}), | ||
}), | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that after this pr #89570 we track all searches in es and
trackId
would through in case a user doesn't have access tosearch-session
SO.To avoid this ensure we don't send
sessionId
to the server in case a user doesn't have access to work with sessions