diff --git a/x-pack/legacy/plugins/security/index.ts b/x-pack/legacy/plugins/security/index.ts index b1dec2ce82c520..577b23f3418e85 100644 --- a/x-pack/legacy/plugins/security/index.ts +++ b/x-pack/legacy/plugins/security/index.ts @@ -72,14 +72,6 @@ export const security = (kibana: Record) => auditLogger: new AuditLogger(server, 'security', server.config(), xpackInfo), }); - // Legacy xPack Info endpoint returns whatever we return in a callback for `registerLicenseCheckResultsGenerator` - // and the result is consumed by the legacy plugins all over the place, so we should keep it here for now. We assume - // that when legacy callback is called license has been already propagated to the new platform security plugin and - // features are up to date. - xpackInfo - .feature(this.id) - .registerLicenseCheckResultsGenerator(() => securityPlugin.license.getFeatures()); - server.expose({ getUser: async (request: LegacyRequest) => securityPlugin.authc.getCurrentUser(KibanaRequest.from(request)), diff --git a/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js b/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js index ae929045cf5709..cb70a7cb446a98 100644 --- a/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js +++ b/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js @@ -177,16 +177,6 @@ describe('replaceInjectedVars uiExport', () => { }, }); }); - - it('sends the originalInjectedVars if the license check result is not available', async () => { - const originalInjectedVars = { a: 1 }; - const request = buildRequest(); - const server = mockServer(); - server.plugins.xpack_main.info.feature().getLicenseCheckResults.returns(undefined); - - const newVars = await replaceInjectedVars(originalInjectedVars, request, server); - expect(newVars).to.eql(originalInjectedVars); - }); }); // creates a mock server object that defaults to being authenticated with a diff --git a/x-pack/legacy/plugins/xpack_main/server/lib/replace_injected_vars.js b/x-pack/legacy/plugins/xpack_main/server/lib/replace_injected_vars.js index 403bb4e2b334c3..f09f97d44bfe8b 100644 --- a/x-pack/legacy/plugins/xpack_main/server/lib/replace_injected_vars.js +++ b/x-pack/legacy/plugins/xpack_main/server/lib/replace_injected_vars.js @@ -20,7 +20,7 @@ export async function replaceInjectedVars(originalInjectedVars, request, server) } // not enough license info to make decision one way or another - if (!xpackInfo.isAvailable() || !xpackInfo.feature('security').getLicenseCheckResults()) { + if (!xpackInfo.isAvailable()) { return originalInjectedVars; } diff --git a/x-pack/test/licensing_plugin/legacy/updates.ts b/x-pack/test/licensing_plugin/legacy/updates.ts index 03b61b9db87f89..10661ec529dec5 100644 --- a/x-pack/test/licensing_plugin/legacy/updates.ts +++ b/x-pack/test/licensing_plugin/legacy/updates.ts @@ -31,7 +31,6 @@ export default function(ftrContext: FtrProviderContext) { } = await supertest.get('/api/xpack/v1/info').expect(200); expect(legacyInitialLicense.license?.type).to.be('basic'); - expect(legacyInitialLicense.features).to.have.property('security'); expect(legacyInitialLicenseHeaders['kbn-xpack-sig']).to.be.a('string'); await scenario.startTrial(); @@ -42,7 +41,6 @@ export default function(ftrContext: FtrProviderContext) { .expect(200); expect(legacyTrialLicense.license?.type).to.be('trial'); - expect(legacyTrialLicense.features).to.have.property('security'); expect(legacyTrialLicenseHeaders['kbn-xpack-sig']).to.not.be( legacyInitialLicenseHeaders['kbn-xpack-sig'] ); @@ -52,7 +50,6 @@ export default function(ftrContext: FtrProviderContext) { const { body: legacyBasicLicense } = await supertest.get('/api/xpack/v1/info').expect(200); expect(legacyBasicLicense.license?.type).to.be('basic'); - expect(legacyBasicLicense.features).to.have.property('security'); // banner shown only when license expired not just deleted await testSubjects.missingOrFail('licenseExpiredBanner');