Skip to content

Utilize nitlsconfig 1.0.0a2 + nitlsconfig's new gRPC audit session connect feature and error elaboration improvement - #2207

Open
alexdubois-ni wants to merge 5 commits into
ni:masterfrom
alexdubois-ni:users/adubois/consumeLatestTLSConfigAndUtilizeAuditingAndErrors
Open

Utilize nitlsconfig 1.0.0a2 + nitlsconfig's new gRPC audit session connect feature and error elaboration improvement#2207
alexdubois-ni wants to merge 5 commits into
ni:masterfrom
alexdubois-ni:users/adubois/consumeLatestTLSConfigAndUtilizeAuditingAndErrors

Conversation

@alexdubois-ni

@alexdubois-ni alexdubois-ni commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
  • This contribution adheres to CONTRIBUTING.md.

  • I've updated CHANGELOG.md if applicable.

  • [ ] I've added tests applicable for this pull request

No system tests added as of this time, but we will make a subsequent PR to add system testing. My reasoning is:

  1. What is being added here is fairly minor changes. Both nitlsconfig entrypoints we are utilizing inside of nimi-python itself will not change or add behavior whatsoever unless a channel is created with nitlsconfig's create_grpc_device_channel. For full system tests to succeed, we need to figure out how to do certificate provisioning, and modify the gRPC device json file to utilize nitlsconfig.
  2. For now, I have opted to add unit tests though by simply creating a fake gRPC channel that is tagged with the same mechanism used in nitlsconfig to enable the auditing and error elaboration query capability and confirm the behavior. This at least gives us solid coverage of the changes proposed here.

What does this Pull Request accomplish?

We need to ensure we pull in the latest alpha version of nitlsconfig and integrate with latest changes which adds:

  1. A new audit_session_connect function. This function when called will check whether the channel passed in via gRPC options was created from nitlsconfig's create_grpc_device_channel. If it WAS, then we will perform audit logging for whether the gRPC connection succeeded and what the target address + port for it was. This means it was an NI-sanctioned NI-TLS utilizing channel and we want to add client-side logging for it.
  2. Utilize the get_tls_connection_error_elaboration function to replace the gRPC unavailable's generic message. This function returns None if the channel was not supplied by nitlsconfig's create_grpc_device_channel. The unavailable message is what gets reported when the TLS handshake fails which is VERY unhelpful otherwise. Instead, we want to tell users that they might want to verify against Hardware Manager what their TLS settings are. This matches the behavior we've encoded into our LabVIEW API.
  3. nitlsconfig 1.0.0a2 also has a breaking change to improve the API naming and parameter set. We should anchor ourselves with 1.0.0a2 as our floor as this no longer intends to change (for now)
  4. Added unit tests using a fake gRPC channel that is tagged with the same mechanism nitlsconfigtest uses to opt us into auditing and error elaborations and exercises our changes.

List issues fixed by this Pull Request below, if any.

N/A. This is new development.

What testing has been done?

Ran the unit tests locally. New tests and the pre-existing tests proceed to succeed as-is

@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.12346% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.13%. Comparing base (37a3bd1) to head (7ff791e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ated/nidcpower/nidcpower/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
...ated/nidigital/nidigital/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
generated/nidmm/nidmm/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
generated/nifgen/nifgen/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
generated/nirfsa/nirfsa/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
generated/nirfsg/nirfsg/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
...enerated/niscope/niscope/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
...erated/niswitch/niswitch/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2207      +/-   ##
==========================================
+ Coverage   88.09%   88.13%   +0.03%     
==========================================
  Files          88       88              
  Lines       22756    22819      +63     
==========================================
+ Hits        20047    20111      +64     
+ Misses       2709     2708       -1     
Flag Coverage Δ
codegenunittests 84.90% <ø> (ø)
nidcpowersystemtests 94.40% <88.88%> (+0.05%) ⬆️
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.04% <88.88%> (+0.02%) ⬆️
nidigitalunittests 68.43% <71.42%> (-0.02%) ⬇️
nidmmsystemtests 92.33% <88.88%> (+0.03%) ⬆️
nifakeunittests 86.08% <100.00%> (+0.07%) ⬆️
nifgensystemtests 94.34% <88.88%> (+0.01%) ⬆️
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
nirfsasystemtests 82.71% <88.88%> (+0.04%) ⬆️
nirfsaunittests 63.40% <11.11%> (-0.15%) ⬇️
nirfsgsystemtests 81.18% <88.88%> (+0.05%) ⬆️
niscopesystemtests 89.99% <88.88%> (+0.03%) ⬆️
niscopeunittests 43.20% <ø> (ø)
nisesystemtests 91.50% <ø> (ø)
niswitchsystemtests 81.66% <88.88%> (+0.10%) ⬆️
nitclksystemtests 94.87% <ø> (ø)
nitclkunittests 98.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexdubois-ni alexdubois-ni changed the title Utilize nitlsconfig 1.0.0a2's + new gRPC session connect feature and error elaboration improvement Utilize nitlsconfig 1.0.0a2 + nitlsconfig's new gRPC session connect feature and error elaboration improvement Aug 25, 2026
@alexdubois-ni alexdubois-ni changed the title Utilize nitlsconfig 1.0.0a2 + nitlsconfig's new gRPC session connect feature and error elaboration improvement Utilize nitlsconfig 1.0.0a2 + nitlsconfig's new gRPC audit session connect feature and error elaboration improvement Aug 26, 2026
dummy added 3 commits August 26, 2026 17:12
…ke channel that is tagged as an nitlsconfigtest channel for checking audit and error behavior
Comment thread build/templates/_grpc_stub_interpreter.py.mako
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.

3 participants