Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review interface to return collection for allowed authentication meth… #593

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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