README

jingmo653/sshconfig-resolve/resolve does not have a README file

#
ResolveError

pub(all) suberror ResolveError {
InvalidPort(value~ : String, source~ :
SourceLocation
)
UnsupportedToken(token~ : String, keyword~ : String, source~ :
SourceLocation
)
MissingTokenContext(token~ : String, keyword~ : String, source~ :
SourceLocation
)
InvalidDirectiveValue(keyword~ : String, value~ : String, message~ : String, source~ :
SourceLocation
)
UnsupportedMatchCondition(name~ : String, source~ :
SourceLocation
)
} derive(Eq,
Debug
)

#
DirectiveSpec

pub(all) struct DirectiveSpec {
keyword : String
merge : MergeKind
value_kind : ValueKind
allowed_tokens : Array[String]
sensitive : Bool
} derive(Eq,
Debug
)

#
MergeKind

pub(all) enum MergeKind {
FirstSet
Append
SetEnv
} derive(Eq,
Debug
)

The cardinality and merge rule used for a supported OpenSSH directive.

#
ResolveContext

pub(all) struct ResolveContext {
host : String
original_host : String
port : Int
remote_user : String?
local_user : String?
home : String?
local_hostname : String?
tags : Array[String]
} derive(Eq,
Debug
)

#
ResolveContext::new

fn ResolveContext::new(host : String, port? : Int, remote_user? : String, local_user? : String, home? : String, local_hostname? : String, tags? : Array[String]) -> ResolveContext

#
ResolveOutcome

pub(all) struct ResolveOutcome {
config : ResolvedConfig
trace : ReadOnlyArray[TraceEvent]
} derive(Eq,
Debug
)

#
ResolveOutcome::events

#
ResolveOutcome::has_rejections

fn ResolveOutcome::has_rejections(self : ResolveOutcome) -> Bool

Return whether evaluation recorded an invalid supported directive. Unknown directives are intentionally Unsupported, not errors, so callers can choose a compatibility or lint policy without losing the parsed config.

#
ResolvedConfig

pub struct ResolvedConfig {
values : Map[String, ResolvedValue]
ordered : Array[ResolvedValue]
} derive(Eq,
Debug
)

#
ResolvedConfig::contains

fn ResolvedConfig::contains(self : ResolvedConfig, keyword : String) -> Bool

Return true when at least one final value is present for keyword.

#
ResolvedConfig::entries

#
ResolvedConfig::get

fn ResolvedConfig::get(self : ResolvedConfig, keyword : String) -> ResolvedValue?

#
ResolvedConfig::get_all

fn ResolvedConfig::get_all(self : ResolvedConfig, keyword : String) -> Array[ResolvedValue]

Return every final value for a directive. Append directives keep source order; scalar directives return at most one value.

#
ResolvedConfig::hostname

fn ResolvedConfig::hostname(self : ResolvedConfig) -> String?

Return the final effective host name, if the configuration set one.

#
ResolvedConfig::identity_files

fn ResolvedConfig::identity_files(self : ResolvedConfig) -> Array[ResolvedValue]

Return all effective identity file values in their configuration order.

#
ResolvedConfig::port

fn ResolvedConfig::port(self : ResolvedConfig) -> Int?

Return the selected port after the resolver's P0 range validation.

#
ResolvedConfig::set_env

fn ResolvedConfig::set_env(self : ResolvedConfig) -> Map[String, ResolvedValue]

Project active SetEnv entries to their environment variable names. The returned map contains immutable result values with source provenance; callers cannot mutate resolver state by changing it.

#
ResolvedConfig::user

fn ResolvedConfig::user(self : ResolvedConfig) -> String?

Return the final remote user selected by a supported User directive.

#
ResolvedValue

pub(all) struct ResolvedValue {
keyword : String
value : String
raw : String
expanded : String
source :
SourceLocation

matched_patterns : ReadOnlyArray[String]
} derive(Eq,
Debug
)

#
TraceDecision

pub(all) enum TraceDecision {
Accepted
Appended
Shadowed
Rejected
Unsupported
} derive(Eq,
Debug
)

The result of applying one directive candidate. The trace is ordered by source order and is suitable for explain and lint without re-running the resolver.

#
TraceEvent

pub(all) struct TraceEvent {
keyword : String
raw : String
expanded : String?
source :
SourceLocation

matched_patterns : ReadOnlyArray[String]
decision : TraceDecision
message : String?
} derive(Eq,
Debug
)

#
ValueKind

pub(all) enum ValueKind {
Text
Boolean
Port
NonNegativeInt
Duration
StrictHostKeyChecking
AddressFamily
LogLevel
AddKeysToAgent
} derive(Eq,
Debug
)

The validation class for a directive value. The resolver deliberately keeps this small: values that it cannot validate are never executed.

#
canonical_keyword

fn canonical_keyword(value : String) -> String

Canonical OpenSSH directive spelling used by all resolver maps and lookup APIs. OpenSSH directive names are ASCII case-insensitive.

#
directive_spec

fn directive_spec(keyword : String) -> DirectiveSpec?

Return the P0 specification for keyword. Unknown directives are kept in the syntax tree and appear as an Unsupported trace event instead of being silently treated as a scalar setting.

#
expand_tokens

fn expand_tokens(value : String, specification : DirectiveSpec, context : ResolveContext) -> String raise ResolveError

Expand only the documented P0 % tokens. This is a single scan: a token introduced by an expansion is data, not another expansion request.

Direct callers do not have a configuration source location, so errors use the stable synthetic <value>:1:1 location. The resolver's internal call path uses the directive's real source location.

#
resolve

Resolve without retaining the explain trace. It shares exactly the same evaluator as resolve_explained, preventing drift between both APIs.

#
resolve_explained

Resolve an already parsed configuration. The pure resolver has no file or environment access; callers supply every context value explicitly.

#
resolve_strict

Resolve in validation-strict mode. It shares the same evaluator and trace as the lenient API, then promotes the first rejected supported directive to a checked error. Unsupported directives stay observable through lint and explain rather than changing the default compatibility policy.

#
validate_directive_arguments

fn validate_directive_arguments(keyword : String, arguments : Array[String]) -> String?

Validate argument cardinality and directive-specific grammar independently of Host/Match selection. This is shared by the resolver and static lint so invalid values cannot hide in an unselected block.

#
validate_value

fn validate_value(specification : DirectiveSpec, value : String) -> String?

Validate a directive's joined textual representation.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io