From 359a17974f46b22983042b5b41d2a6cccf9800c7 Mon Sep 17 00:00:00 2001 From: veeso Date: Thu, 19 Dec 2024 10:14:03 +0100 Subject: [PATCH] feat: breaking 0.3 --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a686a3e..b83a803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog - [Changelog](#changelog) + - [0.3.0](#030) + - [0.2.3](#023) - [0.2.2](#022) - [0.2.1](#021) - [0.2.0](#020) @@ -14,6 +16,32 @@ --- +## 0.3.0 + +Released on 19/12/2024 + +- thiserror `2.0` +- ‼️ **BREAKING CHANGE**: Added support for unsupported fields: + + `AddressFamily, BatchMode, CanonicalDomains, CanonicalizeFallbackLock, CanonicalizeHostname, CanonicalizeMaxDots, CanonicalizePermittedCNAMEs, CheckHostIP, ClearAllForwardings, ControlMaster, ControlPath, ControlPersist, DynamicForward, EnableSSHKeysign, EscapeChar, ExitOnForwardFailure, FingerprintHash, ForkAfterAuthentication, ForwardAgent, ForwardX11, ForwardX11Timeout, ForwardX11Trusted, GatewayPorts, GlobalKnownHostsFile, GSSAPIAuthentication, GSSAPIDelegateCredentials, HashKnownHosts, HostbasedAcceptedAlgorithms, HostbasedAuthentication, HostKeyAlias, HostbasedKeyTypes, IdentitiesOnly, IdentityAgent, Include, IPQoS, KbdInteractiveAuthentication, KbdInteractiveDevices, KnownHostsCommand, LocalCommand, LocalForward, LogLevel, LogVerbose, NoHostAuthenticationForLocalhost, NumberOfPasswordPrompts, PasswordAuthentication, PermitLocalCommand, PermitRemoteOpen, PKCS11Provider, PreferredAuthentications, ProxyCommand, ProxyJump, ProxyUseFdpass, PubkeyAcceptedKeyTypes, RekeyLimit, RequestTTY, RevokedHostKeys, SecruityKeyProvider, SendEnv, ServerAliveCountMax, SessionType, SetEnv, StdinNull, StreamLocalBindMask, StrictHostKeyChecking, SyslogFacility, UpdateHostKeys, UserKnownHostsFile, VerifyHostKeyDNS, VisualHostKey, XAuthLocation` + + If you want to keep the behaviour as-is, use `ParseRule::STRICT | ParseRule::ALLOW_UNSUPPORTED_FIELDS` when calling `parse()` if you were using `ParseRule::STRICT` before. + + Otherwise you can now access unsupported fields by using the `unsupported_fields` field on the `HostParams` structure like this: + + ```rust + use ssh2_config::{ParseRule, SshConfig}; + use std::fs::File; + use std::io::BufReader; + + let mut reader = BufReader::new(File::open(config_path).expect("Could not open configuration file")); + let config = SshConfig::default().parse(&mut reader, ParseRule::ALLOW_UNSUPPORTED_FIELDS).expect("Failed to parse configuration"); + + // Query attributes for a certain host + let params = config.query("192.168.1.2"); + let forwards = params.unsupported_fields.get("dynamicforward"); + ``` + ## 0.2.3 Released on 05/12/2023 diff --git a/Cargo.toml b/Cargo.toml index 54d1d09..6dbb99a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "ssh2-config" readme = "README.md" repository = "https://github.com/veeso/ssh2-config" -version = "0.2.4" +version = "0.3.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html