Skip to content

Commit

Permalink
Do not serialize basic license exp in x-pack info (#30848)
Browse files Browse the repository at this point in the history
This is a bug that was identified by the kibana team. Currently on a
get-license call we do not serialize the hard-coded expiration for basic
licenses. However, the kibana team calls the x-pack info route which
still does serialize the expiration date. This commit removes that
serialization in the rest response.
  • Loading branch information
Tim-Brooks committed May 25, 2018
1 parent b32a30a commit dea702f
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ public License.Status getStatus() {

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return builder.startObject()
.field("uid", uid)
.field("type", type)
.field("mode", mode)
.field("status", status.label())
.timeField("expiry_date_in_millis", "expiry_date", expiryDate)
.endObject();
builder.startObject()
.field("uid", uid)
.field("type", type)
.field("mode", mode)
.field("status", status.label());
if (expiryDate != LicenseService.BASIC_SELF_GENERATED_LICENSE_EXPIRATION_MILLIS) {
builder.timeField("expiry_date_in_millis", "expiry_date", expiryDate);
}
return builder.endObject();
}

public void writeTo(StreamOutput out) throws IOException {
Expand Down

0 comments on commit dea702f

Please sign in to comment.