Skip to content

Commit

Permalink
Review interface to return collection for allowed authentication meth…
Browse files Browse the repository at this point in the history
…ods that allows to query for elements. (#593)
  • Loading branch information
dkocher committed Jun 5, 2020
1 parent 2baf51b commit 0dcb4b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/net/schmizz/sshj/userauth/UserAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
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 {

Expand Down Expand Up @@ -58,6 +60,6 @@ boolean authenticate(String username, Service nextService, AuthMethod methods, i
boolean hadPartialSuccess();

/** The available authentication methods. This is only defined once an unsuccessful authentication has taken place. */
Iterable<String> getAllowedMethods();
Collection<String> getAllowedMethods();

}
3 changes: 2 additions & 1 deletion src/main/java/net/schmizz/sshj/userauth/UserAuthImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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;
Expand Down Expand Up @@ -99,7 +100,7 @@ public boolean hadPartialSuccess() {
}

@Override
public Iterable<String> getAllowedMethods() {
public Collection<String> getAllowedMethods() {
return Collections.unmodifiableList(allowedMethods);
}

Expand Down

0 comments on commit 0dcb4b9

Please sign in to comment.