Skip to content

proposal: x/crypto/ssh: add SequentialsAuthMethods #73767

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

Open
drakkan opened this issue May 18, 2025 · 0 comments
Open

proposal: x/crypto/ssh: add SequentialsAuthMethods #73767

drakkan opened this issue May 18, 2025 · 0 comments
Labels
Milestone

Comments

@drakkan
Copy link
Member

drakkan commented May 18, 2025

Proposal Details

I propose adding this new auth method

// SequentialAuthMethods is a wrapper for multiple authentication methods. It
// attempts each method in sequence, stopping immediately on the first failure.
// If all methods succeed, the result of the last one is returned. This is
// useful for enforcing multi-step authentication sequences where all steps must
// succeed. Note that a partial success is not treated as a failure, even if
// returned by the final method but only the final method is allowed to return a
// successfull authentication. If a method other than the last one succeeds, the
// connection will be closed, and no further authentication methods combined
// with this one will be attempted.
func SequentialsAuthMethods(auths []AuthMethod) AuthMethod

Currently, multiple authentication methods can be defined, and multi-step authentication is supported. However, there is no built-in way to enforce that all specified methods are executed. For example, if both public key and password methods are configured, authentication may succeed either because the public key method returned partial success and the password method completed successfully, or simply because the password method succeeded after the public key method failed.
SequentialAuthMethods enforces that all configured methods are executed in order, and authentication only succeeds if each step completes successfully.

@gopherbot gopherbot added this to the Proposal milestone May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants