-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Closed
Description
Currently Go's SSH package doesn't permit a server to conditionally permit auth type "none" at runtime. There's a NoClientAuth bool flag to globally enable it, but you can't decide as a function of the ConnMetaData (username, IPs, etc) whether to permit it.
I propose adding a ServerConfig.NoClientAuthCallback auth hook, with a signature like the existing auth hooks:
// NoClientAuthCallback, if non-nil, is called when a user
// attempts to authenticate with auth method "none".
// NoClientAuth must also be set to true for this be used, or
// this func is unused.
NoClientAuthCallback func(ConnMetadata) (*Permissions, error)I sent https://go-review.googlesource.com/c/crypto/+/395314 which @rolandshoemaker approved, but this is the proposal for the API change.
/cc @maisem