Set default xds-apikey when not set by config.
[src/xds/xds-agent.git] / lib / xdsconfig / fileconfig.go
index 3c834fc..2795206 100644 (file)
@@ -7,7 +7,7 @@ import (
        "path"
        "path/filepath"
 
-       "github.com/iotbzh/xds-agent/lib/common"
+       common "github.com/iotbzh/xds-common/golib"
 )
 
 type SyncThingConf struct {
@@ -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
 }