rishabhdaim commented on code in PR #2936:
URL: https://github.com/apache/jackrabbit-oak/pull/2936#discussion_r3369602085
##########
oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/ExternalLoginModuleFactory.java:
##########
@@ -149,18 +153,29 @@ public ExternalLoginModuleFactory(
this.syncManager = syncManager;
this.idpManager = idpManager;
+ // TODO: context cannot be null, but tests are invoked with this being
null. Tests should
+ // be adjusted accordingly, and then all these implicit and explicit
null checks should be removed.
this.osgiConfig = Optional.ofNullable(context)
.map(ctx -> ConfigurationParameters.of(ctx.getProperties()))
.orElse(ConfigurationParameters.EMPTY);
this.bundleContext =
Optional.ofNullable(context).map(ComponentContext::getBundleContext).orElse(null);
+ if (this.bundleContext != null) {
+ monitorTracker = new ServiceTracker<>(this.bundleContext,
ExternalIdentityMonitor.class, null);
Review Comment:
nits: `idpManager` and `syncManager` are injected via SCR `@Reference` on
the factory constructor, while the monitor uses a manual `ServiceTracker` with
separate activate/deactivate lifecycle.
Consider `@Reference(name = "monitor", cardinality = OPTIONAL, policy =
DYNAMIC)` bind/unbind for `ExternalIdentityMonitor` to match the existing
factory wiring style.
--
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]