[TEST] add version compatibility check for aliases resolution code that needs updating with es core 1.5.0
Original commit: elastic/x-pack-elasticsearch@fb3a48bd02
This commit is contained in:
parent
f709d4e9f0
commit
82fc8fb9bf
|
@ -81,6 +81,10 @@ public class DefaultIndicesResolver implements IndicesResolver<TransportRequest>
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO remove special treatment for IndicesAliasesRequest and GetAliasesRequest once we upgrade to 1.5.0
|
||||
* get https://github.com/elasticsearch/elasticsearch-shield/pull/669 in
|
||||
*/
|
||||
if (indicesRequest instanceof IndicesAliasesRequest) {
|
||||
//special treatment for IndicesAliasesRequest since we need to extract indices from indices() as well as aliases()
|
||||
//Also, we need to replace wildcards in both with authorized indices and/or aliases (IndicesAliasesRequest doesn't implement Replaceable)
|
||||
|
|
|
@ -61,5 +61,13 @@ public class VersionCompatibilityTests extends ElasticsearchTestCase {
|
|||
* And remove the code in Privilege.System
|
||||
*/
|
||||
assertThat("Remove workaround to allow TransportNodesSnapshotsStatus be executed by the system user", Version.CURRENT.onOrBefore(Version.V_1_4_2), is(true));
|
||||
|
||||
/**
|
||||
* see https://github.com/elasticsearch/elasticsearch-shield/pull/669
|
||||
* {@link org.elasticsearch.shield.authz.indicesresolver.DefaultIndicesResolver#resolveIndices(User, String, org.elasticsearch.action.IndicesRequest, org.elasticsearch.cluster.metadata.MetaData)}
|
||||
* The special treatment for IndicesAliasesRequest and GetAliasesRequest can become one single case, and simplified,
|
||||
* since es core 1.5.0 introduced the AliasesRequest interface.
|
||||
*/
|
||||
assertThat("Remove special treatment for IndicesAliasesRequest and GetAliasesRequest", Version.CURRENT.onOrBefore(Version.V_1_4_2), is(true));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue