Commit Graph

7 Commits

Author SHA1 Message Date
Richard Hughes
6d35c99393 Fix 'trivial: fwupdtool security' to show sane results 2021-11-01 11:46:44 +00:00
Richard Hughes
e4b097c3dd Allow comparing two FuSecurityAttrs for equality
Based on a patch by Kate Hsuan <hpa@redhat.com>, many thanks.
2021-11-01 06:58:44 +00:00
Richard Hughes
dbdd3740a3 Add support for loading the HSI result from a JSON blob
This is how we save it to the database, and we'll need to load old
records for future functionality.
2021-10-28 15:36:13 +01:00
Kate Hsuan
db04223167 fu_history: fu_security_attr: Convert secutiry attr to json and write to DB.
1. Create hsi_history table to store the security attributes.
2. Convert all security entities to a json string and write to database.

Signed-off-by: Kate Hsuan <hpa@redhat.com>

Changes in v1:
1. Fixed typo: "his_history" to "hsi_history"
2. g_autofree all gchar pointer.
3. Removed unnecessary g_warning messages.
4. Moved the json format comment to Document comment.
5. Add an error handling for json converter.

Changes in v2:
1. Declare all pointers using g_auto_ptr.
2. The warning messages of JSON conversion and DB writing errors were added.
3. "Since: 1.7.0" was added to the document comment.

Changes in v3:
1. Fix variable declaration.
2. Remove unecessary data type casting.

Changes in v4:
1. Fix migration schema.

Changes in v5:
1. Fix hsi_history column name declaration.

Changes in v6:
Column name was modified from last to timestamp.
2021-09-03 12:03:17 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
b99df2ef93 Use the security attributes to construct a better name
Fixes https://github.com/fwupd/fwupd/issues/2184
2020-07-01 20:10:39 +01:00
Richard Hughes
b246bcaecb Allow client tools to translate the HSI attributes and results
To do this, rely on the AppStream ID to map to a translated string (providing a
fallback for clients that do not care) and switch the free-form result string
into a set of enumerated values that can be translated.

This fixes some of the problems where some things have to be enabled to "pass"
and other attributes have to be some other state. For cases where we want the
user to "do" something, provide a URL to a wiki page that we update out-of-band
of fwupd releases.
2020-05-18 17:03:49 +01:00