laminelam commented on code in PR #826: URL: https://github.com/apache/solr/pull/826#discussion_r867412360
########## solr/modules/aws-secret-provider/README.md: ########## @@ -0,0 +1,80 @@ +Apache Solr - AWS Secret Provider +=========================== + +An implementation of `SecretCredentialsProvider` that pulls Zookeeper credentials from an AWS Secret Manager. + +This plugin uses the [default AWS credentials provider chain](https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/credentials.html), so ensure that your credentials are set appropriately (e.g., via env var, or in `~/.aws/credentials`, etc.). + +## Usage + +- To enable this feature copy the jar files in `modules/aws-secret-provider/lib` to `SOLR_INSTALL/server/solr-webapp/webapp/WEB-INF/lib/` and add follow the below steps before restarting Solr. Review Comment: Thank you @gerlowskija for taking time to dig into this. The issue here is that ZK connection to load _solr.xml_ is [called](https://github.com/apache/solr/blob/26b29d4df41e4efe67576efd72a603818c42738e/solr/core/src/java/org/apache/solr/core/NodeConfig.java#L213) before the modules are loaded. The modules are loaded only after the above mentioned method returns a _NodeConfig_ whose constructor [calls](https://github.com/apache/solr/blob/26b29d4df41e4efe67576efd72a603818c42738e/solr/core/src/java/org/apache/solr/core/NodeConfig.java#L194) _initiModules()_. I am trying to find a clean way to load the modules before _SolrZkClient_ is instantiated. Edit: Actually there is no easy way to do this without an ugly refactoring of tons of classes. Not sure if it's really worth it. A class loader is needed to load the modules. Now, _SolrZkClient_ doesn't have access to any core functionality, and there is no way to get a _loader_ from there. One (ugly) solution would be to add a _SolrClassLoader_ to those _SolrZkClient_ constructors, but doing so you will need to inject it from all the calling classes and places (dozens), and it's not guaranteed all those classes do have a _SolrClassLoader_ ... Unfortunately, the same goes for a solution based on your 2 suggestions, a loader is always needed in _SolrZkClient_. Maybe an another solution would be to add a local custom static _SolrClassLoader_ class into _SolrZkClient_, but you don't have a _solrHome_... There is no really a good solution, maybe we just need to keep it simple (for now) and ask the admin to copy the libs, in same way it used to be for some pre-9 contribs (before this new modules loader feature has beed added)? On the other hand, if you think about it, all the hassle here makes sense because Solrj has always been maintained as a special kind of module, with client (agnostic?) side compatibility in mind, not linked to the rest of Solr modules. -- 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]
