-
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
Add x-pack plugin for new platform browser licensing information #44922
Conversation
Pinging @elastic/kibana-platform |
80988dd
to
958be47
Compare
💚 Build Succeeded |
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.
Some initial things I noticed. Still need to dig into actual behavior to verify correctness.
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.
are we okay provide not backward compatible interface? if yes we can cleanup some other interfaces as well
|
💔 Build Failed |
958be47
to
3034061
Compare
💚 Build Succeeded |
3034061
to
970da28
Compare
💔 Build Failed |
970da28
to
e54f5f6
Compare
💔 Build Failed |
e54f5f6
to
8ffe6b7
Compare
💚 Build Succeeded
|
💚 Build Succeeded
|
a724142
to
de94fe1
Compare
💔 Build Failed
|
de94fe1
to
a4678bc
Compare
💔 Build Failed |
💔 Build Failed |
clusterSource, | ||
pollingFrequency | ||
try { | ||
const cluster = await this.elasticsearch.dataClient$.pipe(first()).toPromise(); |
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.
plugin config specified clusterSource
, but plugin always uses data
client.
also legacy config doesn't allow to specify client name
xpack_api_polling_frequency_millis: Joi.number().default(XPACK_INFO_API_DEFAULT_POLL_FREQUENCY_IN_MILLIS), |
const cluster = await this.elasticsearch.dataClient$.pipe(first()).toPromise(); | ||
const response = await cluster.callAsInternalUser('transport.request', { | ||
method: 'GET', | ||
path: '/_xpack', |
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.
/_xpack is deprecated and will be removed in v8
.elastic/elasticsearch#35958
we should switch to /_license
method: 'GET', | ||
path: '/_xpack', | ||
}); | ||
const rawLicense = response && response.license; |
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.
Is it a real case when the server responds with empty data?
As I can see ES returns "Not Found" error if a user has no license https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java#L76
/** | ||
* Used to trigger manual fetches of the license information from the server. | ||
*/ | ||
private refresher$ = new BehaviorSubject(true); |
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.
not connected.
/** | ||
* Generate the signature for a serialized/stringified license. | ||
*/ | ||
function sign(serialized: string) { |
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.
should be provided as a part of plugin API
); | ||
const setup = { | ||
refresh: () => this.refresher$.next(true), | ||
license$: initial$, |
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.
new subscriber causes a data refetch
superseded by #49345 |
Summary
Add x-pack plugin for new platform client licensing information. This will eventually replace the licensing information consumed via
xpack_main
.Also fixes #44560
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.This was checked for cross-browser compatibility, including a check against IE11This was checked for keyboard-only and screenreader accessibilityFor maintainers
Dev Docs
Add x-pack plugin for new platform public licensing information. This will eventually replace the licensing information consumed via
xpack_main
. Upon setup, this plugin exposes an observable API for inspecting and making checks against the license information.