-
Notifications
You must be signed in to change notification settings - Fork 58
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
Parse lists from configuration file #604
Conversation
c716b3d
to
0765f9b
Compare
@ansasaki Would it be reasonable to update our test so it doesn't use bundled CA certificates? |
Yes, it makes sense, I'll update the test and use a temporary commit to use a separate branch for tests |
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
|
775607e
to
03e7cd9
Compare
/// * `'a', 'b', 'c'` | ||
/// * `[a b c]` | ||
/// * `['a', "b", c]` | ||
/// |
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 interface looks a bit too generic to be exposed from the keylime
lib crate. Not necessarily in this PR, but we might eventually want to move the entire configuration handling in the lib crate with access methods to retrieve list of certs, actions, etc.
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 noticed a bug in the way I parsed the strings: I cannot remove the quotes from quoted strings. I made the changes to keep the quotes.
The parser accepts more flexible formats for the lists read from the configuration file. The lists can: * be inside square brackets or not ("[]") * be separated by comma, spaces, new line, tabs, or carriage-return * have elements single-quoted, double-quoted, or unquoted If the string is single or double quoted, the quotes are kept in the output Vec<&str>. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Make the 'trusted_client_ca' option to accept a list. The list is parsed with the keylime::list_parser. Fixes: keylime#455 Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Emulate what is performed when parsing a list of files from the configuration file. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
For functions used for testing, expose on a testing submodule. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Add unit tests for functions that manipulate certificates. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Make the accepted list format more flexible by parsing with the keylime::list_parser. Fixes: keylime#489, keylime#440 Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
14823c2
to
ec8a188
Compare
/packit retest |
I removed the temporary commit that changed the source of tests. There is an ongoing outage on packit/testing farm which made the tests to not be executed after that, but I'll merge based on the previous test results (which included the test with the workaround removed). |
Support lists for
trusted_client_ca
andrevocation_actions
in more flexible formats, including the format described in the configuration specification.The lists in
trusted_client_ca
andrevocation_actions
can be:Fixes: #440, #455, #489
NOTE: this adds pest as a new dependency