Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientAuthMethod ¶
type ClientAuthMethod interface {
// PrepareRequestForAuth updated the provided request with the needed headers
// for authentication.
// The method must not alter the request method (must always be CONNECT) nor the
// Host/:origin, User-Agent or :path headers.
// The agent is the connected SSH agent if it exists, nil otherwise
// The provided roundTripper can be used to perform requests with the server to prepare
// the authentication process.
// username is the username to authenticate
// conversation is the Conversation we want to establish
PrepareRequestForAuth(request *http.Request, sshAgent agent.ExtendedAgent, roundTripper *http3.RoundTripper, username string, conversation *ssh3.Conversation) error
}
type ClientAuthPlugin ¶
type ClientAuthPlugin struct {
// A plugin can define one or more new SSH3 config options.
// A new option is defined by providing a dedicated option parser.
// The key in PluginOptions must be a unique name for each option
// and must not conflict with any existing option
// (good practice: "<your_repo_name>[-<option_name>]")
PluginOptions map[client_config.OptionName]client_config.OptionParser
PluginFunc GetClientAuthMethodsFunc
}
type GetClientAuthMethodsFunc ¶
type GetClientAuthMethodsFunc func(request *http.Request, sshAgent agent.ExtendedAgent, clientConfig *client_config.Config, roundTripper *http3.RoundTripper) ([]ClientAuthMethod, error)
returns all the suitable authentication methods to be tried against the server in the form of a slice of ClientAuthMethod. Every ClientAuthMethod will have the opportunity to prepare an HTTP request with authentication material to startup an SSH3 conversation. For instance, for pubkey authentication using the private key files on the filesystem, the GetClientAuthMethodsFunc can return a slice containing one ClientAuthMethod for each private key file it wants to try. if no SSH agent socket if found, sshAgent is nil
type RequestIdentityVerifier ¶
type RequestIdentityVerifier interface {
Verify(request *http.Request, base64ConversationID string) bool
}
In ssh3, authorized_keys are replaced by authorized_identities where a use can specify classical public keys as well as other authentication and authorization methods such as OAUTH2 and SAML 2.0
type ServerAuthPlugin ¶
type ServerAuthPlugin func(username string, identityStr string) (RequestIdentityVerifier, error)
parses an AuthorizedIdentity line (`identityStr`). Returns a new Identity and a nil error if the line was successfully parsed. Returns a nil identity and a nil error if the line format is unknown to the plugin. Returns a non-nil error if any other error that is worth to be logged occurs.
plugins are currently a single function so that they are completely stateless