-
Notifications
You must be signed in to change notification settings - Fork 294
Global config "plugin_trust_level" not used #896
Comments
Doing more testing and finding unexpected behavior. Using an example task file send my way by @tjmcs, I see that
Config file used here:
|
The REST API port is not set either. Setting to |
When plugin_trust is enabled, you must also provide keyring paths through either yaml, command line, or via env variable. (yaml key is `keyrings_paths, also under the control section).
I'm not able to reproduce this either.
I tried this and was unable to reproduce. Mine correctly binds to other ports.
Using the config file:
Not sure what is different between our setups. I am working off of commit 170c8d3. |
Thanks @IRCody. These issues roll up into me misconfiguring Closing. |
Could we reopen the issue to better capture the user error instead of silently accepting it? Printing warning messages for config with bad keys is pretty easy. |
Going to go ahead and reopen the issue for that discussion. My thoughts: I'm not sure it's super easy to do that. The keys in the above example aren't really bad (as in they have incorrect values or somehow error on unmarshal), they are extra. Extra keys are ignored when unmarshaling by json.Decoder. This issue is relevant. I don't believe there is a way to treat unknown fields as an error inside json.Unmarshal (and even our yaml unmarshal goes from yaml->json->struct). We could unmarshal into a map[string]interface{} and walk through it to verify there are no keys we didn't expect in places we didn't expect. This is tedious but would work. It would give us very specific detail on where the error is. We could also write a schema, something like this and use something like this jsonschema validator to validate a schema. I'm not sure it would pinpoint the error but you would at least see that the schema was invalid and could error on that. |
Wouldn't a schema validator catch why? Seems like the cleanest path. |
I just didn't look to closely at the errors it would give you, I just figured it had to at least give valid/invalid. Looking more closely at the errors that can be returned fro the one I linked above I think it would give us plenty of context to give good errors to the user. I agree schema is the cleanest way. |
Closing this in favor of #898. |
I built snap off of 170c8d3 and I'm playing around with global configuration settings. I found that one flag,
plugin_trust_level
, does not get used. Trust level continues to require either a keyring or to be flagged at runtime.Config file in YAML
There may be other issues here.
The text was updated successfully, but these errors were encountered: