* [kbn/test] move types/ftr into src * Apply eslint updates * fix import of Lifecycle type Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
72 lines
2.6 KiB
TypeScript
72 lines
2.6 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 { CA_CERT_PATH, KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils';
|
|
import { services } from './services';
|
|
|
|
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|
const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts'));
|
|
|
|
const servers = {
|
|
...xPackAPITestsConfig.get('servers'),
|
|
elasticsearch: {
|
|
...xPackAPITestsConfig.get('servers.elasticsearch'),
|
|
protocol: 'https',
|
|
},
|
|
kibana: {
|
|
...xPackAPITestsConfig.get('servers.kibana'),
|
|
protocol: 'https',
|
|
},
|
|
};
|
|
|
|
return {
|
|
testFiles: [require.resolve('./tests/pki')],
|
|
servers,
|
|
security: { disableTestUser: true },
|
|
services,
|
|
junit: {
|
|
reportName: 'X-Pack Security API Integration Tests (PKI)',
|
|
},
|
|
|
|
esTestCluster: {
|
|
...xPackAPITestsConfig.get('esTestCluster'),
|
|
ssl: true,
|
|
serverArgs: [
|
|
...xPackAPITestsConfig.get('esTestCluster.serverArgs'),
|
|
'xpack.security.authc.token.enabled=true',
|
|
'xpack.security.authc.token.timeout=15s',
|
|
'xpack.security.http.ssl.client_authentication=optional',
|
|
'xpack.security.http.ssl.verification_mode=certificate',
|
|
'xpack.security.authc.realms.native.native1.order=0',
|
|
'xpack.security.authc.realms.pki.pki1.order=1',
|
|
'xpack.security.authc.realms.pki.pki1.delegation.enabled=true',
|
|
`xpack.security.authc.realms.pki.pki1.certificate_authorities=${CA_CERT_PATH}`,
|
|
],
|
|
},
|
|
|
|
kbnTestServer: {
|
|
...xPackAPITestsConfig.get('kbnTestServer'),
|
|
serverArgs: [
|
|
...xPackAPITestsConfig.get('kbnTestServer.serverArgs'),
|
|
'--server.ssl.enabled=true',
|
|
`--server.ssl.key=${KBN_KEY_PATH}`,
|
|
`--server.ssl.certificate=${KBN_CERT_PATH}`,
|
|
`--server.ssl.certificateAuthorities=${JSON.stringify([
|
|
CA_CERT_PATH,
|
|
resolve(__dirname, './fixtures/pki/kibana_ca.crt'),
|
|
])}`,
|
|
`--server.ssl.clientAuthentication=required`,
|
|
`--elasticsearch.hosts=${servers.elasticsearch.protocol}://${servers.elasticsearch.hostname}:${servers.elasticsearch.port}`,
|
|
`--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`,
|
|
`--xpack.security.authc.providers=${JSON.stringify(['pki', 'basic'])}`,
|
|
],
|
|
},
|
|
};
|
|
}
|