mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 15:20:54 +03:00
Review interface to return collection for allowed authentication methods that allows to query for elements. (#593)
This commit is contained in:
@@ -19,6 +19,8 @@ import net.schmizz.sshj.Service;
|
||||
import net.schmizz.sshj.transport.TransportException;
|
||||
import net.schmizz.sshj.userauth.method.AuthMethod;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/** User authentication API. See RFC 4252. */
|
||||
public interface UserAuth {
|
||||
|
||||
@@ -58,6 +60,6 @@ public interface UserAuth {
|
||||
boolean hadPartialSuccess();
|
||||
|
||||
/** The available authentication methods. This is only defined once an unsuccessful authentication has taken place. */
|
||||
Iterable<String> getAllowedMethods();
|
||||
Collection<String> getAllowedMethods();
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.schmizz.sshj.transport.TransportException;
|
||||
import net.schmizz.sshj.userauth.method.AuthMethod;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -99,7 +100,7 @@ public class UserAuthImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> getAllowedMethods() {
|
||||
public Collection<String> getAllowedMethods() {
|
||||
return Collections.unmodifiableList(allowedMethods);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user