Skip to content

NCO-59: Add JWT credential support with runtime credential hot-swap#53

Closed
davidkelly wants to merge 3 commits into
masterfrom
dk/59
Closed

NCO-59: Add JWT credential support with runtime credential hot-swap#53
davidkelly wants to merge 3 commits into
masterfrom
dk/59

Conversation

@davidkelly
Copy link
Copy Markdown
Collaborator

@davidkelly davidkelly commented Apr 2, 2026

Redesign ICredential as a single-property interface (AuthorizationHeader) and add JwtCredential for Bearer token auth alongside the existing Credential record. Both credential types pre-compute their auth header at construction.

Add Func<ICredential> provider pattern through AuthenticationHandler to enable credential hot-swap without rebuilding the HTTP pipeline. Cluster.UpdateCredential() performs a thread-safe volatile swap with a same-type guard.

Preserve backward compatibility:

  • Add Credential-typed forwarding overloads on Cluster.Create() for binary compat with existing compiled applications
  • Override PrintMembers on credential records to prevent leaking passwords, tokens, and auth headers into ToString() output

Add unit tests for credentials, AuthenticationHandler, and UpdateCredential. Added simple functional tests for Jwt as well.

Redesign ICredential as a single-property interface (AuthorizationHeader) and add
JwtCredential for Bearer token auth alongside the existing Credential record. Both
credential types pre-compute their auth header at construction.

Add Func<ICredential> provider pattern through AuthenticationHandler to enable
credential hot-swap without rebuilding the HTTP pipeline. Cluster.UpdateCredential()
performs a thread-safe volatile swap with a same-type guard.

Preserve backward compatibility:
* Add Credential-typed forwarding overloads on Cluster.Create() for binary compat
  with existing compiled applications
* Override PrintMembers on credential records to prevent leaking passwords, tokens,
  and auth headers into ToString() output

Add unit tests for credentials, AuthenticationHandler, and UpdateCredential.
@davidkelly
Copy link
Copy Markdown
Collaborator Author

NOTE: in the next PR we will have mTLS support. That one will insure that we don't have pooled connections using old credentials when creds are changed during a cluster's lifecycle. So ignore that shortcoming here.

@davidkelly
Copy link
Copy Markdown
Collaborator Author

did this combined with nco-60 in #54, as it was built on top of this PR.

@davidkelly davidkelly deleted the dk/59 branch April 8, 2026 23:18
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