mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Remove unused license check result from LP Security plugin (#66966)
* remove unused license check result * remove outdated test * update licensing tests
This commit is contained in:
parent
dfa22d17b9
commit
a9234ef034
4 changed files with 1 additions and 22 deletions
|
@ -72,14 +72,6 @@ export const security = (kibana: Record<string, any>) =>
|
|||
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)),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue