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

Display enterprise license as platinum in /_xpack #58217

Merged
merged 5 commits into from
Jun 30, 2020

Conversation

tvernum
Copy link
Contributor

@tvernum tvernum commented Jun 17, 2020

The GET /_license endpoint displays "enterprise" licenses as
"platinum" by default so that old clients (including beats, kibana and
logstash) know to interpret this new license type as if it were a
platinum license.

However, this compatibility layer was not applied to the GET /_xpack/
endpoint which also displays a license type & mode.

This commit causes the _xpack API to mimic the _license API and treat
enterprise as platinum by default, with a new accept_enterprise
parameter that will cause the API to return the correct "enterprise"
value.

This BWC layer exists only for the 7.x branch.
This is bug fix is marked as a breaking change because, since 7.6,
the _xpack API has (incorrectly) returned "enterprise" for enterprise
licenses, and it is possible that some clients rely on this incorrect
behaviour.

The GET /_license endpoint displays "enterprise" licenses as
"platinum" by default so that old clients (including beats, kibana and
logstash) know to interpret this new license type as if it were a
platinum license.

However, this compatibility layer was not applied to the GET /_xpack/
endpoint which also displays a license type & mode.

This commit causes the _xpack API to mimic the _license API and treat
enterprise as platinum by default, with a new accept_enterprise
parameter that will cause the API to return the correct "enterprise"
value.

This BWC layer exists only for the 7.x branch.
This is a breaking change because, since 7.6, the _xpack API has
returned "enterprise" for enterprise liceses, but this has been found
to break old versions of beats and logstash so needs to be corrected.
@tvernum tvernum added >bug >breaking :Security/License License functionality for commercial features v7.8.1 v7.9.0 labels Jun 17, 2020
@tvernum tvernum requested review from ywangd and jkakavas June 17, 2020 05:44
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security (:Security/License)

@elasticmachine elasticmachine added the Team:Security Meta label for security team label Jun 17, 2020
tvernum added a commit to tvernum/elasticsearch that referenced this pull request Jun 17, 2020
This change introduces support for the "accept_enterprise" parameter
to the /_xpack endpoint, to match the parameter on the /_license
endpoint.

This parameter is deprecated, it does nothing, and may not be set to
any value other than true. It exists solely to support upgrades from
7.x versions where the parameter does have meaning.

Relates: elastic#58217
Copy link
Member

@jkakavas jkakavas left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 55 to 56
if ("enterprise".equals(type)) {
type = "platinum";
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to use enums here, e.g. License.LicenseType.ENTERPRISE.getTypeName()? It is rather verbose but safer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't because the existing code for the License endpoint didn't, but I think we should.

@tvernum
Copy link
Contributor Author

tvernum commented Jun 29, 2020

@elasticmachine update branch

@tvernum
Copy link
Contributor Author

tvernum commented Jun 30, 2020

@elasticsearchmachine run elasticsearch-ci/1

@tvernum tvernum merged commit dcc5a06 into elastic:7.x Jun 30, 2020
tvernum added a commit to tvernum/elasticsearch that referenced this pull request Jun 30, 2020
This commit re-enables CCR rolling upgrade tests following the
backport of elastic#58217 to 7.8 branch (7.8.1)
tvernum added a commit to tvernum/elasticsearch that referenced this pull request Jun 30, 2020
The GET /_license endpoint displays "enterprise" licenses as
"platinum" by default so that old clients (including beats, kibana and
logstash) know to interpret this new license type as if it were a
platinum license.

However, this compatibility layer was not applied to the GET /_xpack/
endpoint which also displays a license type & mode.

This commit causes the _xpack API to mimic the _license API and treat
enterprise as platinum by default, with a new accept_enterprise
parameter that will cause the API to return the correct "enterprise"
value.

This BWC layer exists only for the 7.x branch.
This is a breaking change because, since 7.6, the _xpack API has
returned "enterprise" for enterprise licenses, but this has been found
to break old versions of beats and logstash so needs to be corrected.

Backport of: elastic#58217
tvernum added a commit that referenced this pull request Jun 30, 2020
The GET /_license endpoint displays "enterprise" licenses as
"platinum" by default so that old clients (including beats, kibana and
logstash) know to interpret this new license type as if it were a
platinum license.

However, this compatibility layer was not applied to the GET /_xpack/
endpoint which also displays a license type & mode.

This commit causes the _xpack API to mimic the _license API and treat
enterprise as platinum by default, with a new accept_enterprise
parameter that will cause the API to return the correct "enterprise"
value.

This BWC layer exists only for the 7.x branch.
This is a breaking change because, since 7.6, the _xpack API has
returned "enterprise" for enterprise licenses, but this has been found
to break old versions of beats and logstash so needs to be corrected.

Backport of: #58217
tvernum added a commit that referenced this pull request Jul 1, 2020
This commit re-enables CCR rolling upgrade tests following the
backport of #58217 to 7.8 branch (7.8.1)
pgomulka added a commit that referenced this pull request Jul 27, 2021
…es (#75479)

in #50067 for _license the accept_enterprise = false was no longer supported. This
commit allows it under rest compatibility and is showing enterprise licenses as platinum
The same change had to be applied to _xpack endpoint #58217

in #50735 max_resource_units was introduced to be more accurate. For v7 requests, which do not know about enterprise license we will return max_node which will be set from max_resource_units (it assumes that one resource unit is 32GB - which corresponds to 1 node)

relates #51816
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request Jul 30, 2021
…es (elastic#75479)

in elastic#50067 for _license the accept_enterprise = false was no longer supported. This
commit allows it under rest compatibility and is showing enterprise licenses as platinum
The same change had to be applied to _xpack endpoint elastic#58217

in elastic#50735 max_resource_units was introduced to be more accurate. For v7 requests, which do not know about enterprise license we will return max_node which will be set from max_resource_units (it assumes that one resource unit is 32GB - which corresponds to 1 node)

relates elastic#51816
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking >bug :Security/License License functionality for commercial features Team:Security Meta label for security team v7.8.1 v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants