4#include <sshpp/config.hpp>
8#include <sshpp/export.hpp>
24 virtual std::string_view
name() const noexcept = 0;
34 std::string_view
name() const noexcept
override {
return "none"; }
42 std::string_view
name() const noexcept
override {
return "password"; }
55 std::string_view
name() const noexcept
override {
return "publickey_auto"; }
69 std::string_view
name() const noexcept
override {
return "publickey"; }
79 std::string_view
name() const noexcept
override {
return "agent"; }
100 static Handler console_handler();
103 std::string_view
name() const noexcept
override {
return "keyboard-interactive"; }
113 Chain&
add(std::shared_ptr<Authenticator> a) { chain_.push_back(std::move(a));
return *
this; }
115 template <
class A,
class... Args>
117 return add(std::make_shared<A>(std::forward<Args>(args)...));
120#if SSHPP_WITH_CONSOLE
129 std::string_view
name() const noexcept
override {
return "chain"; }
133 std::vector<std::shared_ptr<Authenticator>> chain_;
136#if SSHPP_WITH_CONSOLE
Authentication strategy interface. See docs/design/04 §4.4.
Definition auth.hpp:21
virtual std::string_view name() const noexcept=0
virtual ~Authenticator()=default
ssh_userauth_agent.
Definition auth.hpp:77
std::string_view name() const noexcept override
Definition auth.hpp:79
Tries each authenticator in order until one succeeds.
Definition auth.hpp:111
Chain & emplace(Args &&... args)
Definition auth.hpp:116
std::string_view name() const noexcept override
Definition auth.hpp:129
Chain & add(std::shared_ptr< Authenticator > a)
Definition auth.hpp:113
Full keyboard-interactive loop.
Definition auth.hpp:84
std::function< Result< std::vector< SecureString > >(const Challenge &)> Handler
Definition auth.hpp:91
KeyboardInteractive(Handler h)
Definition auth.hpp:93
std::string_view name() const noexcept override
Definition auth.hpp:103
"none" — probes the server; sometimes succeeds outright (passwordless accounts).
Definition auth.hpp:32
std::string_view name() const noexcept override
Definition auth.hpp:34
std::string_view name() const noexcept override
Definition auth.hpp:42
Password(SecureString password)
Definition auth.hpp:40
ssh_userauth_publickey_auto: agent, then default identities, then configured identities.
Definition auth.hpp:50
std::string_view name() const noexcept override
Definition auth.hpp:55
PublicKeyAuto(SecureString passphrase)
Definition auth.hpp:53
Explicit key: try_publickey (offer) then publickey (sign).
Definition auth.hpp:63
PublicKey(Key private_key)
Definition auth.hpp:65
std::string_view name() const noexcept override
Definition auth.hpp:69
Definition session_core.hpp:17
int attempt
Definition key.ipp:70
const PassphraseCallback * cb
Definition key.ipp:68
AuthStatus
Definition auth_types.hpp:6
std::function< Result< SecureString >(const PassphraseRequest &)> PassphraseCallback
Definition key.hpp:35
std::function< Result< SecureString >()> PasswordCallback
Definition key.hpp:36
std::string instruction
Definition auth.hpp:88
std::vector< Prompt > prompts
Definition auth.hpp:89
bool echo
Definition auth.hpp:86