1
1
import org.apache.tools.ant.filters.ReplaceTokens
2
2
import org.elasticsearch.gradle.internal.test.InternalClusterTestPlugin
3
+ import org.elasticsearch.gradle.internal.test.RestIntegTestTask
3
4
4
5
/*
5
6
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -24,11 +25,14 @@ dependencies {
24
25
// Microsoft
25
26
api " com.azure:azure-core-http-netty:1.15.1"
26
27
api " com.azure:azure-core:1.50.0"
28
+ api " com.azure:azure-identity:1.13.1"
27
29
api " com.azure:azure-json:1.1.0"
28
30
api " com.azure:azure-storage-blob:12.26.1"
29
31
api " com.azure:azure-storage-common:12.26.0"
30
32
api " com.azure:azure-storage-internal-avro:12.11.1"
31
33
api " com.azure:azure-xml:1.0.0"
34
+ api " com.microsoft.azure:msal4j-persistence-extension:1.3.0"
35
+ api " com.microsoft.azure:msal4j:1.16.1"
32
36
33
37
// Jackson
34
38
api " com.fasterxml.jackson.core:jackson-core:${ versions.jackson} "
@@ -53,9 +57,24 @@ dependencies {
53
57
54
58
// Others
55
59
api " com.fasterxml.woodstox:woodstox-core:6.4.0"
60
+ api " com.github.stephenc.jcip:jcip-annotations:1.0-1"
61
+ api " com.nimbusds:content-type:2.3"
62
+ api " com.nimbusds:lang-tag:1.7"
63
+ api " com.nimbusds:nimbus-jose-jwt:9.37.3"
64
+ api " com.nimbusds:oauth2-oidc-sdk:11.9.1"
56
65
api " jakarta.activation:jakarta.activation-api:1.2.1"
57
66
api " jakarta.xml.bind:jakarta.xml.bind-api:2.3.3"
67
+ api " net.java.dev.jna:jna-platform:${ versions.jna} " // Maven says 5.14.0 but this aligns with the Elasticsearch-wide version
68
+ api " net.java.dev.jna:jna:${ versions.jna} " // Maven says 5.14.0 but this aligns with the Elasticsearch-wide version
69
+ api " net.minidev:accessors-smart:2.5.0"
70
+ api " net.minidev:json-smart:2.5.0"
58
71
api " org.codehaus.woodstox:stax2-api:4.2.1"
72
+ api " org.ow2.asm:asm:9.3"
73
+
74
+ runtimeOnly " com.google.crypto.tink:tink:1.14.0"
75
+ runtimeOnly " com.google.protobuf:protobuf-java:4.27.0"
76
+ runtimeOnly " com.google.code.gson:gson:2.11.0"
77
+ runtimeOnly " org.cryptomator:siv-mode:1.5.2"
59
78
60
79
implementation project(" :modules:transport-netty4" )
61
80
implementation(" org.slf4j:slf4j-api:${ versions.slf4j} " )
@@ -151,12 +170,94 @@ tasks.named("thirdPartyAudit").configure {
151
170
' com.ctc.wstx.shaded.msv_core.driver.textui.Driver' ,
152
171
// [missing classes] SLF4j includes an optional class that depends on an extension class. see Log4jLogger#createConverter
153
172
// 'org.slf4j.ext.EventData' - bring back when https://github.com/elastic/elasticsearch/issues/93714 is done
173
+
174
+ // Optional dependency of tink
175
+ ' com.google.api.client.http.HttpHeaders' ,
176
+ ' com.google.api.client.http.HttpRequest' ,
177
+ ' com.google.api.client.http.HttpRequestFactory' ,
178
+ ' com.google.api.client.http.HttpResponse' ,
179
+ ' com.google.api.client.http.HttpTransport' ,
180
+ ' com.google.api.client.http.javanet.NetHttpTransport' ,
181
+ ' com.google.api.client.http.javanet.NetHttpTransport$Builder' ,
182
+
183
+ // Optional dependency of nimbus-jose-jwt and oauth2-oidc-sdk
184
+ ' org.bouncycastle.asn1.pkcs.PrivateKeyInfo' ,
185
+ ' org.bouncycastle.asn1.x509.AlgorithmIdentifier' ,
186
+ ' org.bouncycastle.asn1.x509.SubjectPublicKeyInfo' ,
187
+ ' org.bouncycastle.cert.X509CertificateHolder' ,
188
+ ' org.bouncycastle.cert.jcajce.JcaX509CertificateHolder' ,
189
+ ' org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder' ,
190
+ ' org.bouncycastle.crypto.InvalidCipherTextException' ,
191
+ ' org.bouncycastle.crypto.engines.AESEngine' ,
192
+ ' org.bouncycastle.crypto.modes.GCMBlockCipher' ,
193
+ ' org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider' ,
194
+ ' org.bouncycastle.jce.provider.BouncyCastleProvider' ,
195
+ ' org.bouncycastle.openssl.PEMKeyPair' ,
196
+ ' org.bouncycastle.openssl.PEMParser' ,
197
+ ' org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter' ,
198
+ ' org.bouncycastle.operator.jcajce.JcaContentSignerBuilder' ,
199
+
200
+ // OAuth servlet support is optional and not required
201
+ ' jakarta.servlet.ServletRequest' ,
202
+ ' jakarta.servlet.http.HttpServletRequest' ,
203
+ ' jakarta.servlet.http.HttpServletResponse' ,
204
+ ' javax.servlet.ServletRequest' ,
205
+ ' javax.servlet.http.HttpServletRequest' ,
206
+ ' javax.servlet.http.HttpServletResponse' ,
207
+
208
+ // OpenSAML support is optional
209
+ ' org.joda.time.DateTime' ,
210
+ ' net.shibboleth.utilities.java.support.xml.SerializeSupport' ,
211
+ ' org.opensaml.core.config.InitializationException' ,
212
+ ' org.opensaml.core.config.InitializationService' ,
213
+ ' org.opensaml.core.xml.XMLObject' ,
214
+ ' org.opensaml.core.xml.XMLObjectBuilder' ,
215
+ ' org.opensaml.core.xml.XMLObjectBuilderFactory' ,
216
+ ' org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport' ,
217
+ ' org.opensaml.core.xml.io.Marshaller' ,
218
+ ' org.opensaml.core.xml.io.MarshallerFactory' ,
219
+ ' org.opensaml.core.xml.io.MarshallingException' ,
220
+ ' org.opensaml.core.xml.io.Unmarshaller' ,
221
+ ' org.opensaml.core.xml.io.UnmarshallerFactory' ,
222
+ ' org.opensaml.core.xml.schema.XSString' ,
223
+ ' org.opensaml.core.xml.schema.impl.XSStringBuilder' ,
224
+ ' org.opensaml.saml.saml2.core.Assertion' ,
225
+ ' org.opensaml.saml.saml2.core.Attribute' ,
226
+ ' org.opensaml.saml.saml2.core.AttributeStatement' ,
227
+ ' org.opensaml.saml.saml2.core.AttributeValue' ,
228
+ ' org.opensaml.saml.saml2.core.Audience' ,
229
+ ' org.opensaml.saml.saml2.core.AudienceRestriction' ,
230
+ ' org.opensaml.saml.saml2.core.AuthnContext' ,
231
+ ' org.opensaml.saml.saml2.core.AuthnContextClassRef' ,
232
+ ' org.opensaml.saml.saml2.core.AuthnStatement' ,
233
+ ' org.opensaml.saml.saml2.core.Conditions' ,
234
+ ' org.opensaml.saml.saml2.core.Issuer' ,
235
+ ' org.opensaml.saml.saml2.core.NameID' ,
236
+ ' org.opensaml.saml.saml2.core.Subject' ,
237
+ ' org.opensaml.saml.saml2.core.SubjectConfirmation' ,
238
+ ' org.opensaml.saml.saml2.core.SubjectConfirmationData' ,
239
+ ' org.opensaml.saml.security.impl.SAMLSignatureProfileValidator' ,
240
+ ' org.opensaml.security.credential.BasicCredential' ,
241
+ ' org.opensaml.security.credential.Credential' ,
242
+ ' org.opensaml.security.credential.UsageType' ,
243
+ ' org.opensaml.xmlsec.signature.Signature' ,
244
+ ' org.opensaml.xmlsec.signature.support.SignatureException' ,
245
+ ' org.opensaml.xmlsec.signature.support.SignatureValidator' ,
246
+ ' org.opensaml.xmlsec.signature.support.Signer' ,
154
247
)
155
248
156
249
ignoreViolations(
157
250
' javax.activation.MailcapCommandMap' ,
158
251
' javax.activation.MimetypesFileTypeMap' ,
159
252
' reactor.core.publisher.Traces$SharedSecretsCallSiteSupplierFactory$TracingException' ,
253
+
254
+ ' com.google.protobuf.MessageSchema' ,
255
+ ' com.google.protobuf.UnsafeUtil' ,
256
+ ' com.google.protobuf.UnsafeUtil$1' ,
257
+ ' com.google.protobuf.UnsafeUtil$Android32MemoryAccessor' ,
258
+ ' com.google.protobuf.UnsafeUtil$Android64MemoryAccessor' ,
259
+ ' com.google.protobuf.UnsafeUtil$JvmMemoryAccessor' ,
260
+ ' com.google.protobuf.UnsafeUtil$MemoryAccessor' ,
160
261
)
161
262
}
162
263
@@ -189,6 +290,7 @@ tasks.named("processYamlRestTestResources") {
189
290
tasks. named(" internalClusterTest" ) {
190
291
// this is tested explicitly in a separate test task
191
292
exclude ' **/AzureStorageCleanupThirdPartyTests.class'
293
+ systemProperty " AZURE_POD_IDENTITY_AUTHORITY_HOST" , " 127.0.0.1:1" // ensure a fast failure
192
294
}
193
295
194
296
tasks. named(" yamlRestTest" ) {
@@ -199,6 +301,18 @@ tasks.named("yamlRestTest") {
199
301
systemProperty ' test.azure.sas_token' , azureSasToken
200
302
}
201
303
304
+ tasks. register(" managedIdentityYamlRestTest" , RestIntegTestTask ) {
305
+ testClassesDirs = sourceSets. yamlRestTest. output. classesDirs
306
+ classpath = sourceSets. yamlRestTest. runtimeClasspath
307
+ }
308
+
309
+ tasks. named(" managedIdentityYamlRestTest" ) {
310
+ systemProperty ' test.azure.fixture' , Boolean . toString(useFixture)
311
+ systemProperty ' test.azure.account' , azureAccount
312
+ systemProperty ' test.azure.container' , azureContainer
313
+ // omitting key and sas_token so that we use a bearer token from the metadata service
314
+ }
315
+
202
316
tasks. register(" azureThirdPartyUnitTest" , Test ) {
203
317
SourceSetContainer sourceSets = project. getExtensions(). getByType(SourceSetContainer . class);
204
318
SourceSet internalTestSourceSet = sourceSets. getByName(InternalClusterTestPlugin . SOURCE_SET_NAME )
@@ -219,4 +333,5 @@ tasks.register('azureThirdPartyTest') {
219
333
220
334
tasks. named(" check" ) {
221
335
dependsOn(" azureThirdPartyUnitTest" )
336
+ dependsOn(" managedIdentityYamlRestTest" )
222
337
}
0 commit comments