kibana/packages/kbn-test/index.ts
Dzmitry Lemechko e92ad772e3
[mock-idp-plugin] add end-point to fetch roles from yml (#175439)
## Summary

in #174284 we split serverless roles into individual files per project.
This PR updates mock-idp-plugin we use to simulate SAML auth in "local"
setup to fetch roles based on `projectType` from the respective yml
file:

- since we read roles from a yml file, new end point `GET
/mock_idp/supported_roles` was added to handle it.
- loginPage & rolesSwitcher hooks are updated to fetch roles via http
- hardcoded roles removed

Few other changes were made:
- move `readRolesFromResource` from `kbn-test` to `kbn-es` for
convenience: it is used to read ES resource files.
- move `system_indices_superuser` to the bottom of the file so it won't
be the first choice in UI role selector (+ we plan to remove the value
in the future)
- Change MOCK_IDP_REALM_NAME to `cloud-saml-kibana` as it is the actual
provider name we use in setup.

<img width="1026" alt="image"
src="060b3c21-9c1a-4210-8b5f-2d574a8f78e7">

<img width="1593" alt="image"
src="4afde9df-5a7e-4ae5-a9f5-ab18b871fc1b">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-01-26 13:37:16 -07:00

65 lines
2 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export { KbnClientRequesterError } from './src/kbn_client/kbn_client_requester_error';
// @internal
export { startServersCli, startServers } from './src/functional_tests/start_servers';
// @internal
export { runTestsCli, runTests } from './src/functional_tests/run_tests';
export { SamlSessionManager, type SamlSessionManagerOptions, type HostOptions } from './src/auth';
export { runElasticsearch, runKibanaServer } from './src/functional_tests/lib';
export { getKibanaCliArg, getKibanaCliLoggers } from './src/functional_tests/lib/kibana_cli_args';
export type {
CreateTestEsClusterOptions,
EsTestCluster,
ICluster,
EsClientForTestingOptions,
} from './src/es';
export {
esTestConfig,
createTestEsCluster,
createEsClientForTesting,
createEsClientForFtrConfig,
createRemoteEsClientForFtrConfig,
} from './src/es';
export { kbnTestConfig } from './kbn_test_config';
export {
kibanaServerTestUser,
kibanaTestUser,
adminTestUser,
systemIndicesSuperuser,
kibanaTestSuperuserServerless,
} from './src/kbn';
// @internal
export { setupJUnitReportGeneration, escapeCdata } from './src/mocha';
export { CI_PARALLEL_PROCESS_PREFIX } from './src/ci_parallel_process_prefix';
export * from './src/functional_test_runner';
export { getUrl } from './src/jest/get_url';
export { runCheckJestConfigsCli } from './src/jest/run_check_jest_configs_cli';
export { runCheckFtrCodeOwnersCli } from './src/functional_test_runner/run_check_ftr_code_owners';
export { runJest } from './src/jest/run';
export * from './src/kbn_archiver_cli';
export * from './src/kbn_client';
export * from './src/find_test_plugin_paths';
export { getDockerFileMountPath } from '@kbn/es';