-
Notifications
You must be signed in to change notification settings - Fork 91
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
New configuration structure for C# client #79
Comments
I don't see a reason to allow un-trusted SSL; if the developer wants cant they just disable certificate validation globally (during development)? This seems out of scope to me. |
@onionhammer I tend to agree, but reading more into issue #35, @pecord might also have a valid point there, given that a server may be only using HTTPS. It's a kind of "chicken or egg" scenario. @TechnoDezi what do you think? |
@faniereynders I think it should be up to the developer, they should have the option to trust all certificates |
@TechnoDezi what about the scenario where code generation isn't even possible due to an API hosted only through HTTPS and has an untrusted self-signed certificate? Surely this behavior should be "forced" given this scenario? |
@onionhammer how does one disable the certificate validation globally? |
Something like this ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; |
In my opinion, given a scenario where the service metadata is only accessible via HTTPS, it is obviously for a reason, so whoever is generating code from the metadata needs sufficient access to a proper trusted SSL certificate. In the case where that isn't possible per se, then the proxy endpoint exposing the metadata should just simply be served over HTTP instead. Having said that, the code will be generated in both scenarios, but will endpoint execution might fail if an HTTPS API endpoint is then called via HTTP. In this scenario we could just include an optional |
If someone is hosting an Api with forced SSL and they using a a self signed cert a protocol overwrite will still break. |
Let's put this on the back burner for now and continue discussing the other tasks listed on this issue so we can going with a roadmap going forward. |
The current config file structure, as defined here is:
To accommodate multiple API services, the following suggested changes need to be made to the structure above:
This will result in this structure:
Interested in what we could differently. Your thoughts? |
I agree with this, looks good. This will give us much better flexibility for multiple services. |
Great. Furthermore we could then also include on the service level
|
Please see updated JSON schema here Note that the following properties per service are now required, to accommodate multiple API services:
|
@faniereynders |
Validations are also important. Surely the bare basic validation logic like required, numbers, regex etc will be useful on client side to prevent a chatty API. It could be generated the same way as the structure of the API gets generated |
i know it can be done though the same way , and validation are surely important. and if we give a bare basic validation support, i think more and more (CustomAttr,Description...) will come after. 😛 if the validation logic needs to be reuse in each side , they can shared them in another way. but i think the client proxy is just responsible for a http call with typed model. if we want prevent a chatty api, i think we need think some other way like API Gateway Pattern... sorry for my english, wish you can understand : ) |
Agreed. It is also definitely possible to at least expose overridable
|
Referring to features/issues mentioned in #10, #14, #35, #58 and #73 -
We need to think of a better structure for the C# client generator configuration file. Here is some of the aggregated features to serve as a starting point:
Allow for un-trusted SSL, specifically used in development scenariosThe text was updated successfully, but these errors were encountered: