-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Introduce Enroll
API endpoint.
#108835
Introduce Enroll
API endpoint.
#108835
Conversation
1445639
to
6e6d439
Compare
6e6d439
to
19dc509
Compare
src/plugins/interactive_setup/server/kibana_config/kibana_config_service.ts
Outdated
Show resolved
Hide resolved
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.
Looks great, thanks for this! Couple comments below but generally happy with the approach.
src/plugins/interactive_setup/server/elasticsearch/elasticsearch_service.ts
Outdated
Show resolved
Hide resolved
src/plugins/interactive_setup/server/kibana_config/kibana_config_service.ts
Outdated
Show resolved
Hide resolved
src/plugins/interactive_setup/server/kibana_config/kibana_config_service.ts
Outdated
Show resolved
Hide resolved
19dc509
to
0ef271f
Compare
…Config to KibanaConfigWriter.
Thanks for the feedback, should be handled now.I'm moving to unit tests, will tag you once PR is ready for review. |
if (value.asSeconds() < 1) { | ||
return 'the value must be greater or equal to 1 second.'; | ||
} |
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.
note: just like with minimum value for the session cleanup interval, we set minimum to 1 seconds to prevent our users from shooting themselves in the foot.
}); | ||
}); | ||
|
||
describe('#enroll()', () => { |
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.
note: quite a bit of "testing of internal implementation" here, but I feel like it's super important to not break anything in this area.
serviceAccountToken: { name: string; value: string }; | ||
} | ||
|
||
export class ElasticsearchService { |
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.
note: I finally moved this to a "Service" since it has a clear lifetime with appropriate setup/stop hooks.
pingError instanceof errors.ConnectionError | ||
? ElasticsearchConnectionStatus.NotConfigured | ||
: ElasticsearchConnectionStatus.Configured |
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.
note: I am a bit cautious here and don't try to handle other potentially acceptable errors (e.g. Timeout), it's better to be 100% sure here that Kibana is really unable to connect to ES.
@@ -13,11 +13,18 @@ import type { CorePreboot, Logger, PluginInitializerContext, PrebootPlugin } fro | |||
|
|||
import { ElasticsearchConnectionStatus } from '../common'; |
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.
note: didn't write tests for this class yet as I think it's too early, let's stabilize implementation a bit more.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Pinging @elastic/kibana-security (Team:Security) |
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.
LGTM!
Summary
In this PR we introduce a new
Enroll
API endpoint for the Interactive Setup plugin.Part of: #104068