61 lines
2.6 KiB
TypeScript
61 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;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
import { resolve } from 'path';
|
|
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
|
|
import { services } from './services';
|
|
|
|
// the default export of config files must be a config provider
|
|
// that returns an object with the projects config values
|
|
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');
|
|
|
|
return {
|
|
testFiles: [resolve(__dirname, './tests/session_lifespan')],
|
|
services,
|
|
servers: xPackAPITestsConfig.get('servers'),
|
|
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'),
|
|
'--xpack.security.session.lifespan=5s',
|
|
'--xpack.security.session.cleanupInterval=10s',
|
|
`--xpack.security.authc.providers=${JSON.stringify({
|
|
basic: { basic1: { order: 0 } },
|
|
saml: {
|
|
saml_fallback: { order: 1, realm: 'saml1' },
|
|
saml_override: { order: 2, realm: 'saml1', session: { lifespan: '1m' } },
|
|
saml_disable: { order: 3, realm: 'saml1', session: { lifespan: 0 } },
|
|
},
|
|
})}`,
|
|
],
|
|
},
|
|
|
|
junit: {
|
|
reportName: 'X-Pack Security API Integration Tests (Session Lifespan)',
|
|
},
|
|
};
|
|
}
|