Review interface to return collection for allowed authentication methods that allows to query for elements. (#593)

This commit is contained in:
David Kocher
2020-06-05 11:11:50 +02:00
committed by GitHub
parent 2baf51bf64
commit 0dcb4b9a7a
2 changed files with 5 additions and 2 deletions

View File

@@ -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();
}

View File

@@ -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);
}