-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix(gui-ubuntupro): Verify certificate files #949
Conversation
This validates files based on file extension, then, if possible, if the file contains the correct certificate delimiters.
Sometimes (notably, when going from an error state to a non-error state), the previous error will be retained on the screen. This makes sure every change of the path is validated and updated.
Existing apply config tests were missing the ssl key portion, this commits add that.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #949 +/- ##
==========================================
+ Coverage 89.03% 89.08% +0.04%
==========================================
Files 110 110
Lines 7445 7506 +61
==========================================
+ Hits 6629 6687 +58
- Misses 638 639 +1
- Partials 178 180 +2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Note that the dummy binary_cert.der file is a file of random bytes, not necessarily a real certificate.
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 think this benefits from using a third-party library instead of parsing by hand.
gui/packages/ubuntupro/lib/pages/landscape/landscape_model.dart
Outdated
Show resolved
Hide resolved
gui/packages/ubuntupro/lib/pages/landscape/landscape_model.dart
Outdated
Show resolved
Hide resolved
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.
This code is more reliable for sure. Just a little more stylish touches and we'll be good to go.
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.
Good job!
Adds verification for certificate files by first checking their file extension, and, if possible, their content. If a certificate path isn't a valid certificate, an error is shown in the UI and continuing is blocked.
Example invalid certificate file
Fixes #880
UDENG-5109