Skip to content

panoramicdata/Passbolt.Api

Repository files navigation

Passbolt.Api

NuGet License: MIT .NET 10 Codacy Badge

Typed .NET client primitives for integrating with Passbolt APIs in a safe, testable, and DI-friendly way.

Installation

dotnet add package Passbolt.Api

Quick Start

using Passbolt.Api;

var options = new PassboltClientOptions
{
    Uri = new Uri("https://passbolt.example.com"),
    Username = "user@example.com",
    Password = "password",
    PrivateKeyBlock = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n..."
};

using var client = new PassboltClient(options);

// Get server status
var status = await client.Status.GetStatusAsync(CancellationToken.None);
Console.WriteLine($"Passbolt version: {status.Body?.Version}");

// List all resources
var resources = await client.Resources.GetAllAsync(CancellationToken.None);
foreach (var resource in resources.Body ?? [])
{
    Console.WriteLine($"Resource: {resource.Name} (ID: {resource.Id})");
}

For production code, pass a real cancellation token:

using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var resources = await client.Resources.GetAllAsync(cts.Token);

Features

  • Strongly-typed PassboltClient for intuitive API access
  • Refit-backed REST API interface for seamless HTTP endpoint mapping
  • Built-in support for Passbolt's PGP authentication flow
  • Async/await support throughout
  • Dependency injection compatible design

Quality

  • Built with TreatWarningsAsErrors
  • Nullable reference types enabled
  • XML documentation generated
  • CI validates restore, build, test, and package output

Supported Endpoints

Core Entities

  • Status: Server status and healthcheck information
  • Users: CRUD operations and listing for user management
  • Groups: CRUD operations and listing for group management
  • Resources: CRUD operations, listing, searching by name/URI, and resource sharing
  • Folders: CRUD operations and listing for folder management

Related Features

  • Comments: Create, read, and delete comments on resources
  • Permissions: Query and filter permissions by resource or user
  • Roles: List available roles and retrieve role details
  • Avatars: Retrieve user profile images
  • Me: Access current authenticated user's profile information

Links

License

MIT - see LICENSE.

About

Nuget package for Passbolt

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors