Skip to content
New issue

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

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

Already on GitHub? # to your account

Adding Web.config schema validation to the Configuration Manager #4707

Merged
merged 2 commits into from
Jun 11, 2021

Conversation

daguiler
Copy link
Contributor

Fixes #4706

Summary

Adding Web.config schema validation to the Configuration Manager. Other config files and non-XML files are ignored.

When user clicks on the Save Changes button, the file is sent to the server for validation. If the file is the Web.config file, the server validates its contents against the DotNetConfig.xsd schema, and returns a list of validation errors. Or an empty list if no errors are found.

The browser then presents a summary of the validation errors in a popup window, and asks the user whether to continue the save operation or cancel.

I'm adding the DotNetConfig.xsd file as an embedded resource. Maybe in the future we can add more XSD files to validate other config files.

Also, I added a new unit tests project to cover this change.

Screenshots

  • Good schema, no validation errors, normal save:

image

  • Valid XML, bad schema:

image

  • More than 5 validation errors:

image

  • Bad XML:

image

@daguiler daguiler changed the title Bugfix/dnn 47653 Adding Web.config schema validation to the Configuration Manager Jun 10, 2021
Copy link
Contributor

@bdukes bdukes left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@bdukes bdukes added this to the 9.10.0 milestone Jun 11, 2021
@mitchelsellers mitchelsellers merged commit 8828bba into dnnsoftware:develop Jun 11, 2021
@valadas
Copy link
Contributor

valadas commented Jun 14, 2021

This is an awesome improvement! Thanks @bdukes

@daguiler daguiler deleted the bugfix/DNN-47653 branch June 30, 2021 00:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration Manager doesn't validate Web.config schema
4 participants