Skip to content

Commit

Permalink
Remove deprecated accept_enterprise query param from licence API
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf committed Dec 6, 2021
1 parent a296f6b commit 10a37cc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions x-pack/plugins/licensing/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ export class LicensingPlugin implements Plugin<LicensingPluginSetup, LicensingPl
private fetchLicense = async (clusterClient: MaybePromise<IClusterClient>): Promise<ILicense> => {
const client = isPromise(clusterClient) ? await clusterClient : clusterClient;
try {
const { body: response } = await client.asInternalUser.xpack.info({
// @ts-expect-error `accept_enterprise` is not present in the client definition
accept_enterprise: true,
});
const { body: response } = await client.asInternalUser.xpack.info();
const normalizedLicense =
response.license && response.license.type !== 'missing'
? normalizeServerLicense(response.license)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@ export class TelemetryReceiver {
path: '/_license',
querystring: {
local: true,
// For versions >= 7.6 and < 8.0, this flag is needed otherwise 'platinum' is returned for 'enterprise' license.
accept_enterprise: 'true',
},
})
).body as Promise<{ license: ESLicense }>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ let cachedLicense: ESLicense | undefined;
async function fetchLicense(esClient: ElasticsearchClient, local: boolean) {
const { body } = await esClient.license.get({
local,
// For versions >= 7.6 and < 8.0, this flag is needed otherwise 'platinum' is returned for 'enterprise' license.
accept_enterprise: true,
});
return body;
}
/**
* Get the cluster's license from the connected node.
*
* This is the equivalent of GET /_license?local=true&accept_enterprise=true.
* This is the equivalent of GET /_license?local=true.
*
* Like any X-Pack related API, X-Pack must installed for this to work.
*
Expand Down

0 comments on commit 10a37cc

Please sign in to comment.