Skip to content

Conversation

@romanett
Copy link
Contributor

@romanett romanett commented Feb 20, 2025

Proposed changes

Return StatusCode.BadIdentityTokenInvalid instead of BadUserAccessDenied if the Client sends an AnonymousIdentityToken or no identity Token at all. This makes the Server pass UA CTT SessionService -> SessionBase -> TestCases -> Err-009

Make the Client throw a ServiceResultException BadIdentityTokenInvalid instead of BadUserAccessDenied to be consistent with the response a server would send. This is relevant as our client does a "pre-check" if the endpoint supports the provided policy before sending the request to the server

Related Issues

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • [] Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

@romanett romanett added the compliance An issue was found which is not compliant with the OPC UA specification. label Feb 20, 2025
@romanett romanett requested a review from mrsuciu February 20, 2025 17:06
@romanett romanett self-assigned this Feb 20, 2025
@codecov
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 55.73%. Comparing base (38388f1) to head (06519fb).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
Libraries/Opc.Ua.Client/Session/Session.cs 0.00% 1 Missing ⚠️
Libraries/Opc.Ua.Server/Session/Session.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3012      +/-   ##
==========================================
+ Coverage   55.69%   55.73%   +0.04%     
==========================================
  Files         352      352              
  Lines       67926    67907      -19     
  Branches    13939    13918      -21     
==========================================
+ Hits        37829    37850      +21     
+ Misses      25948    25915      -33     
+ Partials     4149     4142       -7     

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

@romanett romanett changed the title [Server] Return BadIdentityTokenInvalid if use of anonymous identity token is not allowed [Server] [Client] Return BadIdentityTokenInvalid if use of anonymous identity token is not allowed Feb 21, 2025
@mrsuciu mrsuciu self-requested a review February 28, 2025 08:09
@mrsuciu mrsuciu merged commit 9dac51b into OPCFoundation:master Feb 28, 2025
76 of 77 checks passed
@romanett romanett deleted the fixAnonymousIdentityToken branch April 11, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compliance An issue was found which is not compliant with the OPC UA specification.

Projects

None yet

2 participants