Documentation
¶
Overview ¶
Package nexssflow ships the Flow bundle for local SSH setup, profile-based commands, and SFTP transfers.
Typical use:
@require github.com/nexssp/ssh/nexssflow { profiles_file: "~/.config/nexss/ssh/profiles.yml" }
{ profile: "staging", command: "uname -s" } -> ssh.run
Index ¶
- Constants
- func Bundle(rawOpts map[string]string) compiler.Bundle
- func NewBundle(cfg Config) (compiler.Bundle, error)
- func WithProfileProvider(ctx context.Context, provider ProfileProvider) context.Context
- type Config
- type ConfigRequest
- type HostRequest
- type KeygenRequest
- type ProfileProvider
- type ProfileProviderFunc
- type RunRequest
- type TestRequest
- type TransferRequest
- type TrustRequest
Constants ¶
const ID = "ssh"
Variables ¶
This section is empty.
Functions ¶
func Bundle ¶
Bundle creates the Flow extension. Local profiles are loaded on first action execution, not while the compiler or a lint harness loads the extension.
func NewBundle ¶
NewBundle validates configuration and eagerly loads an immutable profile snapshot for callers that construct the bundle directly.
func WithProfileProvider ¶ added in v0.2.0
func WithProfileProvider(ctx context.Context, provider ProfileProvider) context.Context
WithProfileProvider scopes profile resolution to one Flow execution context. When present, the provider takes precedence over profiles_file; provider failures are returned rather than silently falling back to another store.
Types ¶
type Config ¶
type Config struct {
ProfilesFile string `nflow:"profiles_file"`
KeyDirectory string `nflow:"key_dir"`
KnownHostsFile string `nflow:"known_hosts_file"`
Timeout time.Duration `nflow:"timeout" default:"2m"`
MaxBytes int64 `nflow:"max_bytes" default:"268435456"`
}
Config controls local profile loading, setup paths, and operation limits.
type ConfigRequest ¶ added in v0.2.0
type ConfigRequest struct {
Marker bool `json:"marker,omitempty"`
}
ConfigRequest is intentionally empty; host-specific config paths are bundle options.
type HostRequest ¶ added in v0.2.0
HostRequest identifies the host whose currently presented key should be inspected.
type KeygenRequest ¶ added in v0.2.0
type KeygenRequest struct {
Name string `json:"name,omitempty"`
}
KeygenRequest requests a local Ed25519 key pair. It never carries key material.
type ProfileProvider ¶ added in v0.2.0
type ProfileProvider interface {
SSHProfile(ctx context.Context, name string) (sshx.Profile, error)
}
ProfileProvider resolves a locally stored SSH profile by name or host-owned identifier. Implementations may read an existing database or settings store; this bundle does not create or persist profiles itself.
type ProfileProviderFunc ¶ added in v0.2.0
ProfileProviderFunc adapts a function to ProfileProvider.
func (ProfileProviderFunc) SSHProfile ¶ added in v0.2.0
SSHProfile implements ProfileProvider.
type RunRequest ¶
RunRequest selects only a local profile and supplies the remote command. Host, username, identity, and host-key trust are deliberately not inputs.
type TestRequest ¶ added in v0.2.0
type TestRequest struct {
Host string `json:"host"`
Port string `json:"port,omitempty"`
User string `json:"user,omitempty"`
Key string `json:"key,omitempty"`
}
TestRequest selects a remote host and local key for a batch-mode auth check.
type TransferRequest ¶
type TransferRequest struct {
Profile string `json:"profile"`
LocalPath string `json:"local_path"`
RemotePath string `json:"remote_path"`
}
TransferRequest selects a local profile and the two file paths for one SFTP transfer.
type TrustRequest ¶ added in v0.2.0
type TrustRequest struct {
Host string `json:"host"`
Port string `json:"port,omitempty"`
Keys string `json:"keys"`
}
TrustRequest carries the key lines shown in the fingerprint response. The calling UI must obtain explicit user confirmation before invoking this action.