-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
127 lines (99 loc) · 4.33 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
buildscript {
ext {
pluginVersion = rootProject.properties['pluginVersion']
esVersion = rootProject.properties['esVersion']
keycloakVersion = '4.5.0.Final'
jacksonVersion = '2.8.10'
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:$esVersion"
}
}
apply plugin: 'idea'
apply plugin: 'elasticsearch.esplugin'
group 'org.elasticsearch.plugin'
version "${pluginVersion}_es${esVersion}"
ext{
project.licenseFile = project.rootProject.file('LICENSE')
project.noticeFile = project.rootProject.file('NOTICE')
}
dependencyLicenses.enabled = false
thirdPartyAudit.excludes = ['org/jboss/modules/ConcurrentClassLoader',
'org/jboss/modules/ConcurrentClassLoader$UnsafeHolder']
esplugin {
name 'keycloak-security'
description 'Elasticsearch Keycloak security plugin'
classname 'org.elasticsearch.plugin.keycloak.KeycloakSecurityPlugin'
licenseFile rootProject.file('LICENSE')
noticeFile rootProject.file('NOTICE')
version project.version
extendedPlugins = ['x-pack-security']
}
configurations.all {
//avoid conflict by force version used by elastic
resolutionStrategy {
force 'org.apache.httpcomponents:httpcore:4.4.5'
force 'commons-codec:commons-codec:1.10'
force 'commons-logging:commons-logging:1.1.3'
}
}
dependencies {
compile "org.keycloak:keycloak-common:$keycloakVersion"
compile "org.keycloak:keycloak-core:$keycloakVersion"
compile "org.keycloak:keycloak-authz-client:$keycloakVersion"
compile "org.keycloak:keycloak-adapter-spi:$keycloakVersion"
compile "org.keycloak:keycloak-adapter-core:$keycloakVersion"
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
compile 'org.bouncycastle:bcpkix-jdk15on:1.60'
compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
compile group: 'org.jboss.logging', name: 'jboss-logging', version: '3.3.2.Final'
compile group: 'org.jboss.logmanager', name: 'jboss-logmanager', version: '1.5.2.Final'
compile group: 'org.jboss.modules', name: 'jboss-modules', version: '1.1.0.GA'
compileOnly group: 'javax.activation', name: 'activation', version: '1.1.1'
compileOnly group: 'log4j', name: 'log4j', version: '1.2.16'
compileOnly group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.1'
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: '1.7.2'
compileOnly "org.elasticsearch.plugin:x-pack-core:$esVersion"
testCompile "org.elasticsearch.client:x-pack-transport:$esVersion"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
integTestRunner {
systemProperty 'tests.security.manager', 'false'
}
integTestCluster {
dependsOn buildZip
//Keycloak realm configuration
setting 'xpack.security.authc.realms.keycloak.order', '0'
setting 'xpack.security.authc.realms.keycloak.type', 'keycloak'
setting 'xpack.security.authc.realms.keycloak.config', 'keycloak.config'
setting 'xpack.security.authc.realms.esusers.order', '1'
setting 'xpack.security.authc.realms.esusers.type', 'file'
setting 'xpack.security.authc.realms.native.type', 'native'
setting 'xpack.security.authc.realms.native.order', '2'
setting 'xpack.security.enabled', 'true'
setting 'xpack.ml.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'
distribution = 'zip'
//add keycloak config file for testing
extraConfigFile 'keycloak.config',file("$rootDir/src/test/resources/config/keycloak.config")
setupCommand 'setupDummyUser',
'bin/elasticsearch-users', 'useradd', 'testor', '-p', 'password', '-r', 'superuser'
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: 'testor',
password: 'password',
ignoreerrors: true,
retries: 10)
return tmpFile.exists()
}
}
check.dependsOn integTest