Get identity config from JSON, not a file

Ziti identities are routinely stored as files with a standard schema that is valid input for config.NewFromFile() which is used by all of the examples I found (config package - github.com/openziti/sdk-golang/ziti/config - Go Packages), but I want to get it from JSON with the same schema that’s already stored as a variable, not a file. This is because I want to deploy my app in the cloud where it’s much easier to configure with env vars, not files.

I see config.New() but the struct of the idConfig function param tells me that it requires a ServerCert property which tells me that it’s not what I’m looking for.

I’m looking for a function like this:

func NewFromJson(confJson string) (*Config, error)

Does something like that exist in the Go SDK?

Looking at NewFromConfig, it ends up calling err = json.Unmarshal(conf, &c). I’d expect that’s what you want?

@TheLumberjack I got that working. Thanks!