Skip to content

feat: windows implementation for smartcard auth - #797

Open
adithya-nominal wants to merge 66 commits into
apatil/smartcard/smartcard_ssl_ctxfrom
apatil/smartcard/windows
Open

feat: windows implementation for smartcard auth#797
adithya-nominal wants to merge 66 commits into
apatil/smartcard/smartcard_ssl_ctxfrom
apatil/smartcard/windows

Conversation

@adithya-nominal

@adithya-nominal adithya-nominal commented May 28, 2026

Copy link
Copy Markdown
Contributor

This PR adds Windows support to the nominal-smartcard package. This implementation leans on the native Windows certificate stack; a single client-auth certificate is selected once from CurrentUser\My and shared across every transport, so all connections present the same identity and PIN prompting is handled by the built-in Windows credential UI rather than a custom prompt.

HTTP requests flow through a WindowsCacAdapter that drives the .NET HttpClient over Schannel, while gRPC traffic uses a WindowsCngSigner. Certificate selection, the cert store wrapper, and the CNG signer are factored into focused modules (_windows_cert_store, _windows_cng_signer, _windows_cac) behind the existing SmartcardTransportProvider interface, so the rest of the client is unaffected.

adithya-nominal and others added 20 commits May 22, 2026 15:44
… branch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rd/grpc

Resolves conflict in _transport.py: keep full gRPC implementation from grpc
branch while adopting TransportProvider base class and SmartcardTransportProvider
name from smartcard_ssl_ctx rename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/nominal-smartcard/nominal/smartcard/_windows_cac.py Outdated
Base automatically changed from apatil/smartcard/grpc to apatil/smartcard/smartcard_ssl_ctx June 2, 2026 15:29
adithya-nominal and others added 3 commits June 2, 2026 11:35
…rd/windows

Resolves conflicts by integrating the subclass refactoring from smartcard_ssl_ctx
with the Windows implementation from this branch.

_transport.py: replace the monolithic SmartcardTransportProvider (with
if platform.system() branches throughout) with:
  - SmartcardTransportProvider — abstract base; shared gRPC caching
  - _Pkcs11SmartcardTransportProvider — Linux/macOS PKCS#11 path
  - _WindowsSmartcardTransportProvider — Windows CNG/Schannel path

create() now dispatches to the right subclass so no platform checks
remain inside any method body. Windows identity close() calls super()
(signers) then closes the identity outside the lock.

test_transport.py: PKCS11 tests instantiate _Pkcs11SmartcardTransportProvider
directly; Windows test uses _WindowsSmartcardTransportProvider directly
(no platform.system patch needed since platform check is only in create()).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adithya-nominal
adithya-nominal force-pushed the apatil/smartcard/windows branch from 896562b to f31161b Compare June 2, 2026 16:25
@adithya-nominal adithya-nominal changed the title feat: windows channel for smartcard auth feat: windows implementation for smartcard auth Jun 2, 2026
@adithya-nominal
adithya-nominal force-pushed the apatil/smartcard/windows branch from 8b28d01 to 389826a Compare June 8, 2026 21:06
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.

2 participants