-
Notifications
You must be signed in to change notification settings - Fork 242
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
v2 - security - correct the proxy design implementation #1998
Comments
This is also causing bugs as we copy the values from the target, but throw away the copy all the time here.
schema = new OpenApiSchemaReference("foo", null);
// Assume foo is not nullable.
schema.Nullable = true;
// The reference to foo is still not nullable. The implementation should leverage lazy loading, and KEEP the new OpenAPI schema once created. |
Another issue is that the compiler doesn't help people know which properties are writeable for a reference since it currently inherits from OpenAPISchema. I believe that we should introduce a new interface IOpenAPISchema which ONLY has the getters for the properties. The target should probably also be a public property, in case the consumers want to walk up the reference. Lastly, the reference resolving mechanism is cumbersome for write scenarios: you need to manually register the components before they can be resolved. |
Additional details from additional internal discussions:
|
The OpenApiSchema should not clone the object. I'm not convinced about the derived base class thing. Can you add just setters in a derived class? We need to make all the references implement IOpenApiReferenceable because the walker relies on it. |
The current proxy for OpenAPISchema was implemented using inheritance, probably to save time, which forces all properties to be virtual.
Not only this is not the correct proxy design pattern implementation which requires using an interface instead, but this poses a potential security and reliability issue
The text was updated successfully, but these errors were encountered: