2018-01-27 00:48:30 -05:00
|
|
|
Project idpFixtureProject = xpackProject("test:idp-fixture")
|
|
|
|
evaluationDependsOn(idpFixtureProject.path)
|
|
|
|
|
2018-01-20 17:43:00 -05:00
|
|
|
apply plugin: 'elasticsearch.vagrantsupport'
|
2018-01-30 07:03:04 -05:00
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
|
|
apply plugin: 'elasticsearch.rest-test'
|
2018-01-20 17:43:00 -05:00
|
|
|
|
|
|
|
dependencies {
|
2018-01-27 00:48:30 -05:00
|
|
|
testCompile project(path: xpackModule('core'), configuration: 'runtime')
|
|
|
|
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
|
|
|
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
|
2018-01-20 17:43:00 -05:00
|
|
|
testCompile 'com.google.jimfs:jimfs:1.1'
|
|
|
|
}
|
|
|
|
|
|
|
|
task idpFixture {
|
2018-01-27 00:48:30 -05:00
|
|
|
dependsOn "vagrantCheckVersion", "virtualboxCheckVersion", idpFixtureProject.up
|
2018-01-20 17:43:00 -05:00
|
|
|
}
|
|
|
|
|
2018-01-30 07:03:04 -05:00
|
|
|
String outputDir = "generated-resources/${project.name}"
|
|
|
|
task copyIdpCertificate(type: Copy) {
|
2018-02-07 19:42:25 -05:00
|
|
|
from idpFixtureProject.file('src/main/resources/certs/ca.crt');
|
2018-01-30 07:03:04 -05:00
|
|
|
into outputDir
|
|
|
|
}
|
2018-01-20 17:43:00 -05:00
|
|
|
if (project.rootProject.vagrantSupported) {
|
2018-01-30 07:03:04 -05:00
|
|
|
project.sourceSets.test.output.dir(outputDir, builtBy: copyIdpCertificate)
|
|
|
|
integTestCluster.dependsOn idpFixture, copyIdpCertificate
|
|
|
|
integTest.finalizedBy idpFixtureProject.halt
|
2018-01-20 17:43:00 -05:00
|
|
|
} else {
|
2018-01-30 07:03:04 -05:00
|
|
|
integTest.enabled = false
|
2018-01-20 17:43:00 -05:00
|
|
|
}
|
|
|
|
|
2018-01-30 07:03:04 -05:00
|
|
|
integTestCluster {
|
2018-02-13 06:16:53 -05:00
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
2018-03-21 23:09:44 -04:00
|
|
|
setting 'xpack.security.enabled', 'true'
|
2018-01-30 07:03:04 -05:00
|
|
|
setting 'xpack.security.http.ssl.enabled', 'false'
|
|
|
|
setting 'xpack.security.authc.token.enabled', 'true'
|
|
|
|
setting 'xpack.security.authc.realms.file.type', 'file'
|
|
|
|
setting 'xpack.security.authc.realms.file.order', '0'
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.type', 'saml'
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.order', '1'
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.idp.entity_id', 'https://test.shibboleth.elastic.local/'
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.idp.metadata.path', 'idp-metadata.xml'
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.sp.entity_id', 'http://mock.http.elastic.local/'
|
|
|
|
// The port in the ACS URL is fake - the test will bind the mock webserver
|
|
|
|
// to a random port and then whenever it needs to connect to a URL on the
|
|
|
|
// mock webserver it will replace 54321 with the real port
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.sp.acs', 'http://localhost:54321/saml/acs'
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.attributes.principal', 'uid'
|
|
|
|
setting 'xpack.security.authc.realms.shibboleth.attributes.name', 'urn:oid:2.5.4.3'
|
|
|
|
setting 'xpack.ml.enabled', 'false'
|
|
|
|
|
|
|
|
extraConfigFile 'idp-metadata.xml', idpFixtureProject.file("src/main/resources/provision/generated/idp-metadata.xml")
|
|
|
|
|
|
|
|
setupCommand 'setupTestAdmin',
|
2018-04-11 11:36:12 -04:00
|
|
|
'bin/elasticsearch-users', 'useradd', "test_admin", '-p', 'x-pack-test-password', '-r', "superuser"
|
2018-01-30 07:03:04 -05:00
|
|
|
|
|
|
|
waitCondition = { node, ant ->
|
|
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
|
|
|
dest: tmpFile.toString(),
|
|
|
|
username: 'test_admin',
|
|
|
|
password: 'x-pack-test-password',
|
|
|
|
ignoreerrors: true,
|
|
|
|
retries: 10)
|
|
|
|
return tmpFile.exists()
|
|
|
|
}
|
2018-01-20 17:43:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
forbiddenPatterns {
|
|
|
|
exclude '**/*.der'
|
|
|
|
exclude '**/*.p12'
|
|
|
|
exclude '**/*.key'
|
|
|
|
}
|
|
|
|
|
|
|
|
thirdPartyAudit.excludes = [
|
2018-01-20 19:53:26 -05:00
|
|
|
// uses internal java api: sun.misc.Unsafe
|
|
|
|
'com.google.common.cache.Striped64',
|
|
|
|
'com.google.common.cache.Striped64$1',
|
|
|
|
'com.google.common.cache.Striped64$Cell',
|
|
|
|
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator',
|
|
|
|
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1',
|
|
|
|
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper',
|
|
|
|
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1',
|
|
|
|
// missing
|
|
|
|
'com.ibm.icu.lang.UCharacter'
|
2018-01-20 17:43:00 -05:00
|
|
|
]
|
|
|
|
|