Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type ClientInfo struct {
Fingerprint string // SSH public key fingerprint (e.g., "SHA256:...")
SessionID string // SSH session ID (identifies a single scp/sftp command)
}
ClientInfo contains information about the SFTP client
type PermissionChecker ¶
type PermissionChecker interface {
// CheckPermission returns the user's decision for the operation.
// For single-path operations (download, upload, delete, etc.), pass one path.
// For two-path operations (rename, symlink, link), pass source and target paths.
// Returns error if the checker is unavailable (e.g., no display).
CheckPermission(op Operation, client ClientInfo, paths ...string) (PermissionResult, error)
// ClearSession removes any cached permissions for the given session.
// Called when an SFTP session ends to prevent memory leaks.
ClearSession(sessionID string)
}
PermissionChecker is called to check if an SFTP operation is allowed. Implementations can show UI dialogs, auto-allow, or deny based on policy.
type PermissionResult ¶
type PermissionResult int
PermissionResult represents the user's response to a permission dialog
const ( PermissionDenied PermissionResult = iota PermissionAllowed PermissionAlwaysAllow )
Click to show internal directories.
Click to hide internal directories.