SftpGo 0.0.5

dotnet add package SftpGo --version 0.0.5                
NuGet\Install-Package SftpGo -Version 0.0.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SftpGo" Version="0.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SftpGo --version 0.0.5                
#r "nuget: SftpGo, 0.0.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SftpGo as a Cake Addin
#addin nuget:?package=SftpGo&version=0.0.5

// Install SftpGo as a Cake Tool
#tool nuget:?package=SftpGo&version=0.0.5                

SftpGo

CI NuGet License: MIT

.NET client for SftpGo, an SFTP server, written in C#.

Functionality

The SftpGoClient supports the following objects (and methods):

  • ApiKeys (List, Create, Delete)
  • Users (List, Get, Create, Update, Delete, Enable, Disable)
  • Event Rules (List, Get, Create, Update, Delete, Enable, Disable)
  • Event Actions (List, Get, Create, Update, Delete)
  • Version (Get)
  • Service Status (Get)

Installing via NuGet

Package is published in the NuGet gallery.

From the command-line:

> dotnet add package SftpGo

From within Visual Studio using Package Manager Console:

PM> Install-Package SftpGo

Getting started

In the startup of your application, configure the DI container as follows:

using SftpGo;

builder.Services.AddOptions();
builder.Services.AddHttpClient<SftpGoClient>();
builder.Services.Configure<SftpGoClientOptions>( o =>
{
    o.ApiUrl = Environment.GetEnvironmentVariable( "SFTPGO_APIURL" )!;
    o.ApiKey = Environment.GetEnvironmentVariable( "SFTPGO_APIKEY" );
} );
builder.Services.AddTransient<ISftpGo, SftpGoClient>()

Auth: Mostly API key, but sometimes AuthToken

Most objects in the REST API can use an API key, but there are a few objects (namely API Keys) which can only be invoked using an Access Token. Moreover, the SFTPGo admin web application does not currently implement any UI to manage API keys. The only manner is through the REST API.

As such, the necessary flow is as follows:

  • In SFTPGo admin web, go to the admin user and check the "API key authentication" option. This will allow the use of API keys associated with that admin user
  • Authenticate as an admin (using username/password/OTP), using Authenticate
  • Set the access token on the client instance, using UseAuthToken
  • Create an API key, using ApiKeyCreate
  • Persist the API key: it is only visible once -- as a result of key create operation
  • Set the API key on the client instance, using UseApiKey
  • Use the rest of the API (e.g. users, services, etc)
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.5 0 2/20/2025
0.0.4 29 2/20/2025
0.0.3 44 2/19/2025