iamsanjay commented on PR #3208:
URL: https://github.com/apache/solr/pull/3208#issuecomment-2677547561
Test case!
```
@Test
public void testAuth() throws Exception {
// This succeeds with auth enabled
CollectionAdminRequest.createCollection("c123", "conf", 1, 1)
.setBasicAuthCredentials(SecurityJson.USER, SecurityJson.PASS)
.process(cluster.getSolrClient());
cluster.waitForActiveCollection("c123", 1, 1);
// Configure placement plugin
PluginMeta plugin = new PluginMeta();
plugin.name = PlacementPluginFactory.PLUGIN_NAME;
plugin.klass = MinimizeCoresPlacementFactory.class.getName();
V2Request v2Request =
new V2Request.Builder("/cluster/plugin")
.forceV2(true)
.POST()
.withPayload(singletonMap("add", plugin))
.build();
v2Request.setBasicAuthCredentials(SecurityJson.USER, SecurityJson.PASS);
v2Request.process(cluster.getSolrClient());
// Now this will fail with a 401 !!
CollectionAdminRequest.createCollection("c456", "conf", 1, 1)
.setBasicAuthCredentials(SecurityJson.USER, SecurityJson.PASS)
.process(cluster.getSolrClient());
cluster.waitForActiveCollection("c456", 1, 1);
/// /////////
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]