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

[Telemetry] Check permissions when requesting telemetry #126238

Merged
merged 27 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ca98c07
[Telemetry] Include `security` dependency
afharo Feb 23, 2022
da5c756
Clean usage collection types (removal of KibanaRequest context extens…
afharo Feb 23, 2022
de282e2
Fix premissions usage
afharo Feb 23, 2022
7d4aa84
Remove `home` dependency on `telemetry`
afharo Feb 23, 2022
64f6fd3
Fix types
afharo Feb 23, 2022
0342826
Merge branch 'main' of github.com:elastic/kibana into telemetry-depen…
afharo Feb 23, 2022
eea162b
Fix more types and tests
afharo Feb 23, 2022
93aaf41
Fix TS refs (no idea why it failed in this PR)
afharo Feb 23, 2022
543b712
Fix broken tests
afharo Feb 24, 2022
260aa2a
Fix translation files
afharo Feb 24, 2022
35dd344
Remove unused variable
afharo Feb 24, 2022
2a5497b
Fix `home` public API missing export
afharo Feb 24, 2022
6b200bf
Only validate the permissions on unencrypted requests
afharo Feb 24, 2022
5b48f6e
@jportner is our saviour
afharo Feb 24, 2022
738cf14
Merge branch 'main' into telemetry-depending-on-security
kibanamachine Feb 27, 2022
effa7f4
Merge branch 'main' into telemetry-depending-on-security
kibanamachine Mar 1, 2022
7f76422
Merge branch 'main' of github.com:elastic/kibana into telemetry-depen…
afharo Mar 4, 2022
6788d62
nit: test 2 different onRendered handlers
afharo Mar 4, 2022
65d7835
nit: Use `file.test.mocks.ts` + `jest.doMock`
afharo Mar 4, 2022
6f7e648
Only allow one telemetry notice renderer
afharo Mar 4, 2022
40578d1
Make `home` dependency optional
afharo Mar 4, 2022
8639532
Use security mock instead of creating our own
afharo Mar 4, 2022
b50da6b
Add functional tests
afharo Mar 4, 2022
8802cd8
try/catch externally registered handlers
afharo Mar 4, 2022
90e7bee
Merge branch 'main' of github.com:elastic/kibana into telemetry-depen…
afharo Mar 4, 2022
51b02f0
Fix type check
afharo Mar 4, 2022
d15a542
Merge branch 'main' into telemetry-depending-on-security
kibanamachine Mar 7, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createUsageCollectionSetupMock } from '../../../plugins/usage_collectio

const { makeUsageCollector } = createUsageCollectionSetupMock();

export const myCollector = makeUsageCollector<Usage, false>({
export const myCollector = makeUsageCollector<Usage>({
type: 'importing_from_export_collector',
isReady: () => true,
fetch() {
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/telemetry_collectors/stats_collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface Usage {
* We should collect them when the schema is defined.
*/

export const myCollectorWithSchema = makeStatsCollector<Usage, false>({
export const myCollectorWithSchema = makeStatsCollector<Usage>({
type: 'my_stats_collector_with_schema',
isReady: () => true,
fetch() {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/dashboard/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{ "path": "../navigation/tsconfig.json" },
{ "path": "../saved_objects_tagging_oss/tsconfig.json" },
{ "path": "../saved_objects/tsconfig.json" },
{ "path": "../screenshot_mode/tsconfig.json" },
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why it failed in this PR. But dashboard is importing types from screenshot_mode and it was missing this line.

@elastic/kibana-operations probably a bug in the type_check script that didn't catch it earlier in main?

Copy link
Contributor

Choose a reason for hiding this comment

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

We're not totally sure how TypeScript validates that projects have the references they need, it seems to validate it most of the time but there are edge cases where you can import from another project even when it's not listed in the projects deps. We are on the cusp of moving away from relative plugin imports to imported based on global module IDs for packages which will make this a non-problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a strange situation, but I'm glad we'll be moving away from it in the future. Thanks for adding the project to our tsconfig though!

{ "path": "../ui_actions/tsconfig.json" },
{ "path": "../charts/tsconfig.json" },
{ "path": "../discover/tsconfig.json" },
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"server": true,
"ui": true,
"requiredPlugins": ["dataViews", "share", "urlForwarding"],
"optionalPlugins": ["usageCollection", "telemetry", "customIntegrations"],
"optionalPlugins": ["usageCollection", "customIntegrations"],
afharo marked this conversation as resolved.
Show resolved Hide resolved
"requiredBundles": ["kibanaReact"]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading