11 Commits

Author SHA1 Message Date
Bart Vries d40bc43ac1 Refactor logging to allow a loggerfactory per session (#1673)
* Refactor logging to allow a loggerfactory per session specified in the ConnectionInfo.

This commit introduces an `ILoggerFactory` to various classes, replacing the static logger factory with an instance-based approach for more flexible and session-specific logging. These changes improve the logging framework's flexibility and maintainability and allow unit testing of logging.

* Improvements bases on feedback. Fixed tests. Added documentation.

* Update src/Renci.SshNet/ConnectionInfo.cs

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2025-07-26 21:24:48 +02:00
Rob Hague 98982a931e Update docs and remove a leftover DSA certificate algorithm (#1632)
* Update docs and remove a leftover DSA certificate algorithm

* more cleanup
2025-05-04 11:39:54 +02:00
Rob Hague 429f7502ca Tweak logging.md (#1601) 2025-02-19 13:07:44 +01:00
mus65 70c12467dd Replace DiagnosticAbstration with Microsoft.Extensions.Logging.Abstractions (#1509)
* Replace DiagnosticAbstrations with Microsoft.Extensions.Logging.Abstractions

* add documentation

* reduce allocations by SessionId hex conversion

generate the hex string once instead of every log
call and optimize ToHex().

* Update docfx/logging.md

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* reduce log levels

* hook up testcontainers logging

* drop packet logs further down to trace

* add kex traces

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2024-12-02 23:15:48 +01:00
Rob Hague 3e12c96317 Add support for OpenSSH certificates (#1498)
Co-authored-by: cedricMicrovision <cedric.legoff@microvision.fr>
2024-10-19 14:36:41 +02:00
Rob Hague 8e8829ef96 Docs updates (#1432)
* Use /// <value> instead of /// <returns> for properties

* misc doc updates in SshCommand

* Update README
2024-07-04 10:31:07 +02:00
Rob Hague 56318a4e12 Make ZlibOpenSsh public (#1433) 2024-07-04 10:30:25 +02:00
Rob Hague 3bc568471e Add SshCommand.ExecuteAsync (#1426)
* Add SshCommand.ExecuteAsync

After the previous change (#1423), this basically entails swapping out the
IAsyncResult for a TaskCompletionSource and hooking up the cancellation/timeout
logic.

As with the prior Begin/End implementation, the initiation of the command
(SendExecRequest) happens synchronously, so there's a bit of room for improvement
there, but otherwise it is the Task-based async that we know and like.

I chose to make it void (Task)- returning instead of string like in the existing
overloads, so that OutputStream is not automatically consumed (and encoded as a
string) when that may not be desired. As in #650, I was initially considering
changing the other overloads to be void-returning as well, but decided that it was
not worth the break since most people will probably want to change over to
ExecuteAsync anyway.

* Update examples

---------

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2024-06-19 13:02:19 +02:00
Paulus Lucas bb51335b3b doc: Update examples.md (#1421)
* doc: Update examples.md

* tweaks

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2024-06-04 23:21:27 +02:00
Rob Hague 1de33c469e Documentation updates (#1395)
- Update README to point to https://sshnet.github.io/SSH.NET rather than the CHM file
- Add a CONTRIBUTING.md with some how-tos

For https://sshnet.github.io/SSH.NET:

- Use the repo README as the landing page to keep them in sync
- Combine the API-per-TFM pages to just one "API" page
- Add a couple more examples
- Add a GitHub link in the header.
2024-05-10 11:38:47 +02:00
Jean-Sebastien Carle dd36d5b98a Added support for GitHub pages using docfx (#1358)
* Added support for GitHub pages using docfx

* Fixed StyleCop warning.

* Fixed other StyleCop warnings.
2024-04-17 21:32:54 +02:00