NextIteration.SpectreConsole.Auth.Providers.SoftwareOne
0.2.0
See the version list below for details.
dotnet add package NextIteration.SpectreConsole.Auth.Providers.SoftwareOne --version 0.2.0
NuGet\Install-Package NextIteration.SpectreConsole.Auth.Providers.SoftwareOne -Version 0.2.0
<PackageReference Include="NextIteration.SpectreConsole.Auth.Providers.SoftwareOne" Version="0.2.0" />
<PackageVersion Include="NextIteration.SpectreConsole.Auth.Providers.SoftwareOne" Version="0.2.0" />
<PackageReference Include="NextIteration.SpectreConsole.Auth.Providers.SoftwareOne" />
paket add NextIteration.SpectreConsole.Auth.Providers.SoftwareOne --version 0.2.0
#r "nuget: NextIteration.SpectreConsole.Auth.Providers.SoftwareOne, 0.2.0"
#:package NextIteration.SpectreConsole.Auth.Providers.SoftwareOne@0.2.0
#addin nuget:?package=NextIteration.SpectreConsole.Auth.Providers.SoftwareOne&version=0.2.0
#tool nuget:?package=NextIteration.SpectreConsole.Auth.Providers.SoftwareOne&version=0.2.0
NextIteration.SpectreConsole.Auth.Providers.SoftwareOne
SoftwareOne Marketplace credential provider for NextIteration.SpectreConsole.Auth.
Drops a ready-to-use SoftwareOneCredential, SoftwareOneToken, authentication service, Spectre.Console accounts add prompt collector, and accounts list display formatter into a CLI that already uses the core auth package.
Install
dotnet add package NextIteration.SpectreConsole.Auth.Providers.SoftwareOne
Requires the core package (NextIteration.SpectreConsole.Auth ≥ 0.4.1) — NuGet pulls it in transitively.
Quick start
using NextIteration.SpectreConsole.Auth;
using NextIteration.SpectreConsole.Auth.Providers.SoftwareOne;
services.AddCredentialStore(opts =>
{
opts.CredentialsDirectory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".my-cli", "credentials");
});
services.AddSoftwareOneAuthProvider();
// ... then hook up the accounts branch in your Spectre.Console configurator
// (from the core package):
//
// config.AddAccountsBranch();
From that point on:
my-cli accounts add # prompts for SoftwareOne (and any other registered providers)
my-cli accounts list # shows stored credentials with Actor, Base URL, masked token
my-cli accounts select <id>
my-cli accounts delete <id>
Resolving a token in consumer code:
public sealed class MarketplaceClient(SoftwareOneAuthenticationService auth, IHttpClientFactory http)
{
public async Task<string> GetOrdersAsync()
{
var token = await auth.AuthenticateAsync();
using var client = http.CreateClient();
client.BaseAddress = token.BaseUrl;
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(SoftwareOneToken.TokenType, token.ApiToken);
// ... token.Actor / token.Environment let you branch on which flow to use
return await client.GetStringAsync($"/v1/{token.Actor.ToLowerInvariant()}/orders");
}
}
What gets stored
Each accounts add run serialises a SoftwareOneCredential into the encrypted keystore:
| Field | Source | Notes |
|---|---|---|
ApiToken |
hidden prompt | Long-lived portal-issued token |
BaseUrl |
prompt (validated) | Absolute http(s) URL, default https://api.softwareone.com/ |
Environment |
selection prompt | Production / Staging / Test |
Actor |
selection prompt | Operations / Vendor |
The token never leaves the credential store unencrypted. accounts list renders a masked fingerprint (first four + last four characters) and four stars for anything shorter than 10 chars.
Authentication model
SoftwareOne tokens are long-lived and issued out-of-band via the Marketplace portal — there's no exchange or refresh flow. SoftwareOneAuthenticationService.AuthenticateAsync() is therefore a pass-through: it deserialises the selected credential and projects it into a SoftwareOneToken. IsExpired is hard-coded to false, but tokens can be revoked in the portal — a revoked token surfaces as a 401 on the first API call. Consumers should treat 401 as "prompt for a fresh credential" rather than relying on IsExpired.
Supported platforms
Whatever the core package supports (currently Windows, macOS, Linux on .NET 10).
References
- SoftwareOne Marketplace REST API — https://docs.platform.softwareone.com/developer-resources/rest-api Endpoints, request/response shapes, authentication model, and how to generate API tokens from the Marketplace portal.
License
MIT © Stuart Meeks
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- NextIteration.SpectreConsole.Auth (>= 0.5.0 && < 1.0.0)
- Spectre.Console (>= 0.55.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.