-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Implement third-party Permissions module #16414
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
base: trunk
Are you sure you want to change the base?
[dotnet] Implement third-party Permissions module #16414
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
PR Code Suggestions ✨Explore these optional code suggestions:
|
namespace OpenQA.Selenium.BiDi.Browser; | ||
|
||
public sealed class BrowserModule : Module | ||
public sealed class BrowserModule : CoreModule |
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.
But why CoreModule
?
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.
Let me remind: we made Module
class ctor
parameterless, especially for external modules.
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.
We have 2 requirements:
- Each module should maintain its own serialization
- We want the first-party modules to share the same serialization
For that reason, they need to have some shared logic.
protected Broker Broker { get; private set; } | ||
|
||
internal BiDiJsonSerializerContext JsonContext { get; private set; } | ||
internal JsonSerializerContext JsonContext { get; private set; } |
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 am not ready to generalize it in this PR. Still not clear how to move on.
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 have an example in this PR’s description, of how to move forward with these changes.
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 though making Module.Create(...)
to public would be enough, please give me time to review.
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.
Observed it is theoretical changes. Let be practicable.
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.
It is, except for the shared JSON context introduced in #16402
It is not theoretical changes.
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 came to the following:
- BiDi has new method
AsModule<T>()
- PermissionsModule creates its own context based on options (and keep it as private field)
Then changes looks simple.
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 feel introducing new AsModule<T>()
method will be good for us:
- we may introduce cached modules
- it negotiates use of internal properties
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.
All right, AsModule<T>
is required. Built-in modules are cached, third-party modules also want to be cached per bidi
instance. Let's do it (here or in separate PR).
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.
No value,. In any case thank you.
User description
🔗 Related Issues
Fixes #15329
New API surface:
PR Type
Enhancement
Description
Enable external BiDi module creation and extension
Refactor module architecture with InternalModule base class
Expose Broker and JsonOptions for external access
Simplify module creation with public static method
Diagram Walkthrough
File Walkthrough
13 files
Expose internal properties and refactor module creation
Add new base class for internal modules
Refactor to support external module creation
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule
Change inheritance to InternalModule