mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-08 08:10:55 +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.transport.TransportException;
|
||||||
import net.schmizz.sshj.userauth.method.AuthMethod;
|
import net.schmizz.sshj.userauth.method.AuthMethod;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
/** User authentication API. See RFC 4252. */
|
/** User authentication API. See RFC 4252. */
|
||||||
public interface UserAuth {
|
public interface UserAuth {
|
||||||
|
|
||||||
@@ -58,6 +60,6 @@ public interface UserAuth {
|
|||||||
boolean hadPartialSuccess();
|
boolean hadPartialSuccess();
|
||||||
|
|
||||||
/** The available authentication methods. This is only defined once an unsuccessful authentication has taken place. */
|
/** 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 net.schmizz.sshj.userauth.method.AuthMethod;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -99,7 +100,7 @@ public class UserAuthImpl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<String> getAllowedMethods() {
|
public Collection<String> getAllowedMethods() {
|
||||||
return Collections.unmodifiableList(allowedMethods);
|
return Collections.unmodifiableList(allowedMethods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user