UserAuthPublicKey: make creating the key iterator overrideable
Introduce a protected factory method.
@@ -89,7 +89,7 @@ public class UserAuthPublicKey extends AbstractUserAuth implements SignatureFact
releaseKeys(); // just making sure in case multiple calls to the method
try {
- keys = new UserAuthPublicKeyIterator(session, this);
+ keys = createPublicKeyIterator(session, this);
} catch (Error e) {
warn("init({})[{}] failed ({}) to initialize session keys: {}",
session, service, e.getClass().getSimpleName(), e.getMessage(), e);
@@ -97,6 +97,11 @@ public class UserAuthPublicKey extends AbstractUserAuth implements SignatureFact
}
}
+ protected Iterator<PublicKeyIdentity> createPublicKeyIterator(ClientSession session, SignatureFactoriesManager manager)
+ throws Exception {
+ return new UserAuthPublicKeyIterator(session, manager);
+ }
+
@Override
protected boolean sendAuthDataRequest(ClientSession session, String service) throws Exception {
boolean debugEnabled = log.isDebugEnabled();
