Set default xds-apikey when not set by config.
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Tue, 29 Aug 2017 22:30:28 +0000 (00:30 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Tue, 29 Aug 2017 22:30:28 +0000 (00:30 +0200)
lib/xdsconfig/fileconfig.go

index add6ef7..2795206 100644 (file)
@@ -92,5 +92,11 @@ func updateConfigFromFile(c *Config, confFile string) (*FileConfig, error) {
                c.HTTPPort = fCfg.HTTPPort
        }
 
+       // Set default apikey
+       // FIXME - rework with dynamic key
+       if fCfg.XDSAPIKey == "" {
+               fCfg.XDSAPIKey = "1234abcezam"
+       }
+
        return &fCfg, nil
 }