mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
The location of plugins was previously somewhat irrelevant, but as we move into packages it's more important that we can find all plugins in the repository, and we would like to be able to do that without needing to maintain a manifest somewhere to accomplish this. In order to make this possible we plan to find any plugin/package by spotting all kibana.json files which are not "fixtures". This allows plugin-like code (but not actual plugin code) to exist for testing purposes, but it must be within some form of "fixtures" directory, and any plugin that isn't in a fixtures directory will be automatically pulled into the system (though test plugins, examples, etc. will still only be loaded when the plugin's path is passed via `--plugin-path`, the system will know about them and use that knowledge for other things). Since this is just a rename Operations will review and merge by EOD Jan 12th unless someone has a blocking concern. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
66 lines
2.8 KiB
TypeScript
66 lines
2.8 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
* 2.0.
|
|
*/
|
|
|
|
import { resolve } from 'path';
|
|
import { FtrConfigProviderContext } from '@kbn/test';
|
|
import { services } from './services';
|
|
|
|
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|
const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts'));
|
|
|
|
const kibanaPort = xPackAPITestsConfig.get('servers.kibana.port');
|
|
const idpPath = resolve(__dirname, './fixtures/saml/idp_metadata.xml');
|
|
|
|
const testEndpointsPlugin = resolve(__dirname, '../security_functional/plugins/test_endpoints');
|
|
|
|
const auditLogPath = resolve(__dirname, './fixtures/audit/saml.log');
|
|
|
|
return {
|
|
testFiles: [require.resolve('./tests/saml')],
|
|
servers: xPackAPITestsConfig.get('servers'),
|
|
security: { disableTestUser: true },
|
|
services,
|
|
junit: {
|
|
reportName: 'X-Pack Security API Integration Tests (SAML)',
|
|
},
|
|
|
|
esTestCluster: {
|
|
...xPackAPITestsConfig.get('esTestCluster'),
|
|
serverArgs: [
|
|
...xPackAPITestsConfig.get('esTestCluster.serverArgs'),
|
|
'xpack.security.authc.token.enabled=true',
|
|
'xpack.security.authc.token.timeout=15s',
|
|
'xpack.security.authc.realms.saml.saml1.order=0',
|
|
`xpack.security.authc.realms.saml.saml1.idp.metadata.path=${idpPath}`,
|
|
'xpack.security.authc.realms.saml.saml1.idp.entity_id=http://www.elastic.co/saml1',
|
|
`xpack.security.authc.realms.saml.saml1.sp.entity_id=http://localhost:${kibanaPort}`,
|
|
`xpack.security.authc.realms.saml.saml1.sp.logout=http://localhost:${kibanaPort}/logout`,
|
|
`xpack.security.authc.realms.saml.saml1.sp.acs=http://localhost:${kibanaPort}/api/security/saml/callback`,
|
|
'xpack.security.authc.realms.saml.saml1.attributes.principal=urn:oid:0.0.7',
|
|
],
|
|
},
|
|
|
|
kbnTestServer: {
|
|
...xPackAPITestsConfig.get('kbnTestServer'),
|
|
serverArgs: [
|
|
...xPackAPITestsConfig.get('kbnTestServer.serverArgs'),
|
|
`--plugin-path=${testEndpointsPlugin}`,
|
|
`--xpack.security.authc.providers=${JSON.stringify(['saml', 'basic'])}`,
|
|
'--xpack.security.authc.saml.realm=saml1',
|
|
'--xpack.security.authc.saml.maxRedirectURLSize=100b',
|
|
'--xpack.security.audit.enabled=true',
|
|
'--xpack.security.audit.appender.type=file',
|
|
`--xpack.security.audit.appender.fileName=${auditLogPath}`,
|
|
'--xpack.security.audit.appender.layout.type=json',
|
|
`--xpack.security.audit.ignore_filters=${JSON.stringify([
|
|
{ actions: ['http_request'] },
|
|
{ categories: ['database'] },
|
|
])}`,
|
|
],
|
|
},
|
|
};
|
|
}
|