Skip to content

Provider security patches; CPM; bump core to 0.6.1#1

Merged
StuartMeeks merged 1 commit intomainfrom
provider-patches-and-cpm
May 3, 2026
Merged

Provider security patches; CPM; bump core to 0.6.1#1
StuartMeeks merged 1 commit intomainfrom
provider-patches-and-cpm

Conversation

@StuartMeeks
Copy link
Copy Markdown
Owner

@StuartMeeks StuartMeeks commented May 3, 2026

Summary

  • Security: Adobe and SoftwareOne now reject plain http for credential-bearing endpoints (https-only, with loopback as the documented exception, enforced both in the collector prompts and at runtime in the auth services). Error-body sanitisation truncates IMS/Marketplace error responses to 512 chars, and the SoftwareOne path additionally redacts the literal token value before it lands in any exception/log.
  • DI: every provider now registers IAuthenticationService<TCredential, TToken> alongside the concrete service so consumers depending on the abstraction can resolve it (forwards to the same singleton — purely additive).
  • Repo housekeeping: centralised package management in Directory.Packages.props (CentralPackageVersionOverrideEnabled=false), bumped the core library reference to [0.6.1, 1.0.0), removed the per-csproj GeneratePackageOnBuild=true and hardcoded C:\nuget-local\ output path. CI now runs dotnet pack explicitly per provider.

Versions: Adobe 0.2.0 → 0.2.1, Airtable 0.2.0 → 0.2.1, SoftwareOne 0.3.0 → 0.3.1. Test count: 119 → 155.

Test plan

  • CI is green on this branch (build + test + pack).
  • dotnet test --configuration Release passes locally on Linux (verified before opening this PR — Adobe 60, Airtable 36, SoftwareOne 59).
  • dotnet pack src/NextIteration.SpectreConsole.Auth.Providers.<Adobe|Airtable|SoftwareOne> --configuration Release --no-build --output /tmp/x produces a .nupkg and matching .snupkg for each provider with the bumped versions.
  • Directory.Packages.props resolves: dotnet restore --force succeeds with no NU1008 (CPM-violation) warnings.
  • Manual smoke: accounts add for Adobe, Airtable, SoftwareOne in a consumer app — including a deliberate http://example.com/ base URL to verify the collector now rejects it.

…o 0.6.1

Adobe 0.2.0 -> 0.2.1, Airtable 0.2.0 -> 0.2.1, SoftwareOne 0.3.0 -> 0.3.1.

Security:
- Reject plain http for credential-bearing endpoints. The Adobe and
  SoftwareOne collectors and authentication services now require https
  for the IMS URL, the Adobe API base URL, and the SoftwareOne API
  base URL. http is accepted only for loopback hosts so local mock
  servers and proxies still work during development. The same check
  runs in the auth services on every call, so a hand-edited keystore
  that downgrades a stored credential to http is rejected before any
  request is sent. Closes the specific risk that the SoftwareOne
  collector ships the API token in the URL query (eq(token,'...')) --
  over plain http that token would otherwise traverse the network in
  cleartext and land in any intermediate access log.
- Sanitise response bodies before they reach exception messages. The
  SoftwareOne lookup and the Adobe IMS exchange now truncate error
  bodies to 512 chars; the SoftwareOne path additionally redacts the
  literal token value from the body. Defends against a misbehaving
  upstream proxy that echoes the request URL (which carries the token
  in the query) into an error page that would otherwise reach
  exception aggregators and log files.

Changed:
- Register the IAuthenticationService<TCredential, TToken> interface
  mapping in all three providers' ServiceCollectionExtensions. The
  registration forwards to the same singleton as the concrete type so
  existing consumers depending on the concrete are unaffected.
- Bump core library reference from [0.5.0,1.0.0) to [0.6.1,1.0.0).
  The 0.6.x line of the core package added
  ICredentialManager.GetCredentialByIdAsync(string, string); the test
  FakeCredentialManager doubles implement it as NotSupportedException
  to match the existing "fail loudly on accidental reliance" pattern.

Repo housekeeping:
- Centralise package management in /Directory.Packages.props with
  CentralPackageVersionOverrideEnabled=false so per-project version
  pins fail the build instead of silently overriding the central
  pin. Every csproj's <PackageReference> now omits its Version
  attribute and resolves through the central manifest.
- Stop auto-packing on every build. The csprojs previously set
  GeneratePackageOnBuild=true with a hardcoded Windows-only
  PackageOutputPath (C:\nuget-local\). Both properties are removed; CI
  now invokes dotnet pack explicitly per provider.

Tests: 119 -> 155 (Adobe 60, Airtable 36, SoftwareOne 59), all green.
@StuartMeeks StuartMeeks merged commit 596dfdd into main May 3, 2026
2 checks passed
@StuartMeeks StuartMeeks deleted the provider-patches-and-cpm branch May 3, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant