buffet: Rework buffet configuration

Manufacturer supplied fields will come from the buffet configuration
file with good defaults provided by buffet itself.  This includes
a few default values for user supplied fields.

User supplied and other per device instance state will be stored in
a state file as before.

Keeping these fields separate greatly simplifies reasoning about
adding configuration settings to buffet.

BUG=brillo:658
TEST=unittests, tendo_experimental passes
CQ-DEPEND=CL:262292

Change-Id: Ib74721b9c99d11c189042aa78cc43a076072de32
Reviewed-on: https://chromium-review.googlesource.com/262296
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Anton Muhin <antonm@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
diff --git a/buffet/buffet_config.h b/buffet/buffet_config.h
new file mode 100644
index 0000000..539191e
--- /dev/null
+++ b/buffet/buffet_config.h
@@ -0,0 +1,52 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BUFFET_BUFFET_CONFIG_H_
+#define BUFFET_BUFFET_CONFIG_H_
+
+#include <string>
+
+#include <base/files/file_path.h>
+#include <chromeos/key_value_store.h>
+
+namespace buffet {
+
+class BuffetConfig {
+ public:
+  BuffetConfig() = default;
+
+  void Load(const base::FilePath& config_path);
+  void Load(const chromeos::KeyValueStore& store);
+
+  std::string client_id() const { return client_id_; }
+  std::string client_secret() const { return client_secret_; }
+  std::string api_key() const { return api_key_; }
+  std::string oauth_url() const { return oauth_url_; }
+  std::string service_url() const { return service_url_; }
+  std::string device_kind() const { return device_kind_; }
+  std::string name() const { return name_; }
+  std::string default_display_name() const { return default_display_name_; }
+  std::string default_description() const { return default_description_; }
+  std::string default_location() const { return default_location_; }
+  std::string model_id() const { return model_id_; }
+
+ private:
+  std::string client_id_{"58855907228.apps.googleusercontent.com"};
+  std::string client_secret_{"eHSAREAHrIqPsHBxCE9zPPBi"};
+  std::string api_key_{"AIzaSyDSq46gG-AxUnC3zoqD9COIPrjolFsMfMA"};
+  std::string oauth_url_{"https://accounts.google.com/o/oauth2/"};
+  std::string service_url_{"https://www.googleapis.com/clouddevices/v1/"};
+  std::string device_kind_{"vendor"};
+  std::string name_{"developer_device"};
+  std::string default_display_name_{"Developer device"};
+  std::string default_description_{"A development device"};
+  std::string default_location_{"my desk"};
+  std::string model_id_{"AAA"};
+
+  DISALLOW_COPY_AND_ASSIGN(BuffetConfig);
+};
+
+}  // namespace buffet
+
+#endif  // BUFFET_BUFFET_CONFIG_H_