readFields reads the low-level jsonconfig fields using the jsonconfig package and copies them into c. This marks them as known fields before a future call to InstallerHandlers
()
| 571 | // readFields reads the low-level jsonconfig fields using the jsonconfig package |
| 572 | // and copies them into c. This marks them as known fields before a future call to InstallerHandlers |
| 573 | func (c *Config) readFields() error { |
| 574 | c.listenAddr = c.jconf.OptionalString("listen", "") |
| 575 | c.baseURL = strings.TrimSuffix(c.jconf.OptionalString("baseURL", ""), "/") |
| 576 | c.httpsCert = c.jconf.OptionalString("httpsCert", "") |
| 577 | c.httpsKey = c.jconf.OptionalString("httpsKey", "") |
| 578 | c.https = c.jconf.OptionalBool("https", false) |
| 579 | |
| 580 | _, explicitHTTPS := c.jconf["https"] |
| 581 | if c.httpsCert != "" && !explicitHTTPS { |
| 582 | return errors.New("httpsCert specified but https was not") |
| 583 | } |
| 584 | if c.httpsKey != "" && !explicitHTTPS { |
| 585 | return errors.New("httpsKey specified but https was not") |
| 586 | } |
| 587 | return nil |
| 588 | } |
| 589 | |
| 590 | func (c *Config) checkValidAuth() error { |
| 591 | authConfig := c.jconf.OptionalString("auth", "") |
no outgoing calls
no test coverage detected