Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **A third broken README snippet, missed by the first review pass.** The consumer sample —
the one showing how to use a token from a command handler, so among the most-copied code in
the file — does not compile against the Spectre.Console.Cli version this package depends on:
`AsyncCommand.ExecuteAsync` is `protected` and takes `(CommandContext, CancellationToken)`,
not a `public` `(CommandContext)`. Corrected and compiled. The install block also gained the
`Providers.GitHub` package, which the previous pass added to the table but not there, and a
version-pairing table was added: the providers cap at the major boundary, so `2.x` needs
`2.x`, and the cap exists to turn what would be a runtime `MissingMethodException` into a
restore-time resolution error.

### Fixed

- **README review ahead of 2.0.0: two broken snippets and nine stale or missing claims.**
Both broken examples were verified by running them, and both replacements verified the same
way. The DPAPI section registered the manager by type
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,25 @@ Pair it with one or more provider packages (or write your own — see [Extending
dotnet add package NextIteration.SpectreConsole.Auth.Providers.Adobe
dotnet add package NextIteration.SpectreConsole.Auth.Providers.Airtable
dotnet add package NextIteration.SpectreConsole.Auth.Providers.SoftwareOne
dotnet add package NextIteration.SpectreConsole.Auth.Providers.GitHub
```

Targets `net8.0` and `net10.0`.

**Pair matching major versions.** Each provider package depends on this one through a
major-capped range, so `2.x` providers require `2.x` of this package and NuGet will refuse to
mix them:

| This package | Provider packages |
|---|---|
| `2.x` | `2.x` |
| `1.x` | `1.0.1`+ |

That refusal is deliberate and worth understanding. `ICredentialManager` changed shape in
2.0.0, and the providers call into it — so a `1.x` provider assembly running against `2.x` of
this package would fail at *runtime* with `MissingMethodException`. The version cap turns that
into a resolution error you read at restore time instead.

---

## Quick start
Expand Down Expand Up @@ -91,7 +106,7 @@ And from inside any of your command handlers:
```csharp
public sealed class SyncCommand(AdobeAuthenticationService auth) : AsyncCommand
{
public override async Task<int> ExecuteAsync(CommandContext context)
protected override async Task<int> ExecuteAsync(CommandContext context, CancellationToken cancellationToken)
{
var token = await auth.AuthenticateAsync();
// use token.GetAuthorizationHeader() on outgoing requests
Expand Down