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 10 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
3 changes: 3 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 @@ -5,6 +5,9 @@
*/

export interface BackgroundSessionSavedObjectAttributes {
realmType?: string;
realmName?: string;
username?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legrego as you mentioned some security work being done in this area, are we going in the right direction here?

Copy link
Member

@legrego legrego Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a good chance that we (well, Elasticsearch) will be producing a unique user identifier that doesn't require Kibana to rely on realmType + realmName to disambiguate the username. I'm trying to think through a recommendation for you in the short term that won't collide with our future state - I'll report back here soon

/**
* User-facing session name to be displayed in session management
*/
Expand Down
6 changes: 5 additions & 1 deletion x-pack/plugins/data_enhanced/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"data",
"features"
],
"optionalPlugins": ["kibanaUtils", "usageCollection"],
"optionalPlugins": [
"kibanaUtils",
"usageCollection",
"security"
],
"server": true,
"ui": true,
"requiredBundles": ["kibanaUtils", "kibanaReact"]
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/data_enhanced/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
usageProvider,
} from '../../../../src/plugins/data/server';
import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/server';
import { SecurityPluginSetup } from '../../security/server';
import { ENHANCED_ES_SEARCH_STRATEGY, EQL_SEARCH_STRATEGY } from '../common';
import { registerSessionRoutes } from './routes';
import { backgroundSessionMapping } from './saved_objects';
Expand All @@ -24,6 +25,7 @@ import { getUiSettings } from './ui_settings';
interface SetupDependencies {
data: DataPluginSetup;
usageCollection?: UsageCollectionSetup;
security?: SecurityPluginSetup;
}

export class EnhancedDataServerPlugin implements Plugin<void, void, SetupDependencies> {
Expand Down Expand Up @@ -56,7 +58,7 @@ export class EnhancedDataServerPlugin implements Plugin<void, void, SetupDepende
deps.data.__enhance({
search: {
defaultStrategy: ENHANCED_ES_SEARCH_STRATEGY,
sessionService: new BackgroundSessionService(),
sessionService: new BackgroundSessionService(deps.security),
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ export const backgroundSessionMapping: SavedObjectsType = {
hidden: true,
mappings: {
properties: {
realmType: {
type: 'keyword',
},
realmName: {
type: 'keyword',
},
username: {
type: 'keyword',
},
name: {
type: 'keyword',
},
Expand Down
Loading