Skip to content

Change report from Azbil Corporation. #2991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Toshihisa-Fujii
Copy link

Proposed changes

Our company would like to make the following changes as requirements for incorporating the product when using UA Stack .NET Standard. As stipulated by the RCL license, we will communicate the changes in this pull request.

  • Add a validity period check for authentication using certificates.
  • Ensure that DateTime data exchanged in request and response messages can only be used in UTC by the user.

Related Issues

  • Fixes #
    (None.)

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • 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

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • 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.

Further comments

In addition to the above changes, our company has locally modified following file.
Stack/Opc.Ua.Core/Types/Utils/Utils.cs
The purpose of this modification is to align the log output format with our company's standards. However, since this change does not provide any benefits to the OPCF, it is excluded from this pull request. If it is necessary to push the changes to that file as well, please let us know.

Unify the time zone of DateTime handled in requests and responses to UTC.
Add a new method 'Find' to find a certificate within the validity period.
@CLAassistant
Copy link

CLAassistant commented Feb 10, 2025

CLA assistant check
All committers have signed the CLA.

@EthanChangAED EthanChangAED self-assigned this Feb 26, 2025
@EthanChangAED
Copy link

Hello @Toshihisa-Fujii , thank you for submitting this PR. We will review it.

Copy link
Contributor

@mregen mregen left a comment

Choose a reason for hiding this comment

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

please see my comment, it is not quite right to comment out the conversion to UTC time.

@@ -509,7 +509,8 @@ public void WriteString(string fieldName, string value)
/// </summary>
public void WriteDateTime(string fieldName, DateTime value)
{
value = Utils.ToOpcUaUniversalTime(value);
// Azbil: Comment out the line below to unify the time zone of DateTime handled in requests and responses to UTC.
//value = Utils.ToOpcUaUniversalTime(value);

Copy link
Contributor

@mregen mregen Mar 17, 2025

Choose a reason for hiding this comment

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

This line should not be removed. It makes sure only UTC normalized timestamps are sent over the wire. If there is a timestamp off, there is maybe an application error, that a DateTime is created without Utc kind.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your comment. I understand that my coding regarding DateTime class was insufficient. I agree.

@marcschier
Copy link
Contributor

@Toshihisa-Fujii , Can you provide more information as to what the change fixes or brings as valuable additions to the stack, so we better can judge whether breaking compatibility (see checkbox) is justified.

@Toshihisa-Fujii
Copy link
Author

As for the change item 'Ensure that DateTime data exchanged in request and response messages can only be used in UTC by the user.', I noticed that I misunderstood because of the comment from https://github.com/mregen. So please ignore it.
As for 'Add a validity period check for authentication using certificates.', I added a method to retrieve only non-expired certificates from the certificate store. The reason for this is that my company required a specification to check the validity period of certificates in the authentication process using certificates.

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.

5 participants