Skip to content
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

[data.search] Add user information to background session service #84975

Merged
merged 31 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4886819
[data.search] Move search method inside session service and add tests
lukasolson Dec 1, 2020
0de7730
Move background session service to data_enhanced plugin
lukasolson Dec 2, 2020
ec54b8b
Merge branch 'master' into search-session-search
lukasolson Dec 3, 2020
4ff6eaf
Merge branch 'search-session-search' into search-session-enhanced
lukasolson Dec 3, 2020
ea14d29
Fix types
lukasolson Dec 3, 2020
4ce9fef
Merge branch 'master' into search-session-enhanced
lukasolson Dec 3, 2020
d5a4bd0
[data.search] Add user information to background session service
lukasolson Dec 3, 2020
c0994fc
Update trackId & getId to accept user
lukasolson Dec 4, 2020
8fecf2b
Merge branch 'master' into search-session-user
lukasolson Dec 7, 2020
cc665d9
Fix remaining merge conflicts
lukasolson Dec 7, 2020
8de804b
Merge branch 'master' into search-session-user
lukasolson Jan 28, 2021
51fc5ca
Merge branch 'master' into search-session-user
lukasolson Jan 29, 2021
c3165ff
Fix test
lukasolson Jan 29, 2021
88f6d63
Merge branch 'master' into search-session-user
lukasolson Feb 1, 2021
9fefbea
Remove todos
lukasolson Feb 1, 2021
ca7956f
Merge branch 'master' into search-session-user
lukasolson Feb 1, 2021
18462ec
Merge branch 'master' into search-session-user
lukasolson Feb 2, 2021
530f41a
Merge branch 'master' into search-session-user
lukasolson Feb 3, 2021
83b640d
Merge branch 'master' into search-session-user
lukasolson Feb 4, 2021
00c564c
Merge branch 'master' into search-session-user
lukasolson Feb 5, 2021
f3abb42
Merge branch 'master' into search-session-user
lukasolson Feb 8, 2021
bc82023
Fix session service to use user
lukasolson Feb 9, 2021
879db30
Merge branch 'master' into search-session-user
lukasolson Feb 9, 2021
502b8e7
Remove user conflicts and update SO filter
lukasolson Feb 9, 2021
33d2784
Allow filter as string or KQL node
lukasolson Feb 10, 2021
993216a
Add back user checks
lukasolson Feb 11, 2021
f4d2eda
Merge branch 'master' into search-session-uset s:r
lukasolson Feb 11, 2021
0320c6e
Add API integration tests
lukasolson Feb 11, 2021
1396ff7
Merge branch 'master' into search-session-user
lukasolson Feb 11, 2021
faaeff6
Remove unnecessary get calls
lukasolson Feb 11, 2021
1905196
Merge branch 'master' into search-session-user
lukasolson Feb 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions x-pack/plugins/data_enhanced/common/search/session/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export interface SearchSessionSavedObjectAttributes {
* This value is true if the session was actively stored by the user. If it is false, the session may be purged by the system.
*/
persisted: boolean;
/**
* The realm type/name & username uniquely identifies the user who created this search session
*/
realmType?: string;
realmName?: string;
username?: string;
}

export interface SearchSessionRequestInfo {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/data_enhanced/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"kibanaVersion": "kibana",
"configPath": ["xpack", "data_enhanced"],
"requiredPlugins": ["bfetch", "data", "features", "management", "share", "taskManager"],
"optionalPlugins": ["kibanaUtils", "usageCollection"],
"optionalPlugins": ["kibanaUtils", "usageCollection", "security"],
"server": true,
"ui": true,
"requiredBundles": ["kibanaUtils", "kibanaReact"]
Expand Down
5 changes: 4 additions & 1 deletion x-pack/plugins/data_enhanced/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ import {
import { getUiSettings } from './ui_settings';
import type { DataEnhancedRequestHandlerContext } from './type';
import { ConfigSchema } from '../config';
import { SecurityPluginSetup } from '../../security/server';

interface SetupDependencies {
data: DataPluginSetup;
usageCollection?: UsageCollectionSetup;
taskManager: TaskManagerSetupContract;
security?: SecurityPluginSetup;
}

export interface StartDependencies {
data: DataPluginStart;
taskManager: TaskManagerStartContract;
Expand Down Expand Up @@ -67,7 +70,7 @@ export class EnhancedDataServerPlugin
eqlSearchStrategyProvider(this.logger)
);

this.sessionService = new SearchSessionService(this.logger, this.config);
this.sessionService = new SearchSessionService(this.logger, this.config, deps.security);

deps.data.__enhance({
search: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ export const searchSessionMapping: SavedObjectsType = {
type: 'object',
enabled: false,
},
realmType: {
type: 'keyword',
},
realmName: {
type: 'keyword',
},
username: {
type: 'keyword',
},
},
},
};
Loading