-
Notifications
You must be signed in to change notification settings - Fork 946
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
reuse the identity policy in the reconnect that has been used in the connect #2526
reuse the identity policy in the reconnect that has been used in the connect #2526
Conversation
I also added passing the cancellationtoken to the factory method but I can also undo it if you want - just noticed that the cancellationtoken exists and is not passed. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2526 +/- ##
==========================================
- Coverage 53.81% 46.52% -7.30%
==========================================
Files 334 284 -50
Lines 64409 58025 -6384
Branches 13235 11852 -1383
==========================================
- Hits 34663 26994 -7669
- Misses 25990 27829 +1839
+ Partials 3756 3202 -554 ☔ View full report in Codecov by Sentry. |
@mrsuciu had been looking into policyId issues recently, please code review as well. |
Libraries/Opc.Ua.Client/Session.cs
Outdated
// check that the user identity is supported by the endpoint. | ||
UserTokenPolicy identityPolicy = endpoint.FindUserTokenPolicy(m_identity.TokenType, m_identity.IssuedTokenType); | ||
UserTokenPolicy identityPolicy = m_endpoint.Description.FindUserTokenPolicy(m_identity.PolicyId); | ||
if (identityPolicy == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KircMax Does the second "FindUserTokenPolicy(m_identity.TokenType, m_identity.IssuedTokenType)" make any difference (is it ever going to get executed) ? If its purpose is to take into account a PolicyId change on the server side during the disconnect time, I still cannot see a renewal of the m_endpoint.Description being made in the reconnect scenario path...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not really sure...
I am not too familiar with the codebase and wanted to keep the changes 'defensive' but my feeling was it should never be necessary...
I'd also not really expect a server that had PolicyId changes during the disconnect time be able to reactivate a session that has been before that change, therefore I think we could also get rid of that second "FindUserTokenPolicy(m_identity.TokenType, m_identity.IssuedTokenType)" either way.
Of course that feeling might be wrong for some certain servers but as you said we are not updating the m_endpoint.Description anyways...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--> I'll remove the second one and push the update.
Proposed changes
Describe the changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
Related Issues
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.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.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...