I should be able to use a string with == in it and it still pass validation
Adding a string with == results in validation failing. Consider the following:
- API_TOKEN=bobsyouruncle==
Will cause validation to fail.
Currently, I cannot use an API token with == in it as an env_var inside of my config.
Our validation is a bit too strict, here's where it's failing: https://github.com/sensu/sensu-go/blob/a786ceeb603601f89a39276824de346b098ad5e4/api/core/v2/env_vars.go#L10-L12
We should probably simply split on the first occurrence of = and make sure we have two parts.
The issue needs to be fixed around there:
https://github.com/sensu/sensu-go/blob/a786ceeb603601f89a39276824de346b098ad5e4/api/core/v2/env_vars.go#L8-L17
This code claims that an environment variable is always of the form FOO=BAR; this is inaccurate, or at least misleading. There are no restrictions on the value of environment variables, and they are allowed to contain =s. See the relevant POSIX section.
Most helpful comment
The issue needs to be fixed around there:
https://github.com/sensu/sensu-go/blob/a786ceeb603601f89a39276824de346b098ad5e4/api/core/v2/env_vars.go#L8-L17
This code claims that an environment variable is always of the form
FOO=BAR; this is inaccurate, or at least misleading. There are no restrictions on the value of environment variables, and they are allowed to contain=s. See the relevant POSIX section.