Add local_auth_info_changed -> root_client_token_owner
We are going to store owner of Root Client Authentication Token.
Information is needed to avoid claiming tokens by multiple clients
or by client and cloud simultaneously.
BUG=26156215
Change-Id: I4dae39f3e8b0cfe3667775a864d5c893710fc18e
Reviewed-on: https://weave-review.googlesource.com/1921
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/src/config.h b/src/config.h
index fc2568f..0c7ea5f 100644
--- a/src/config.h
+++ b/src/config.h
@@ -14,12 +14,18 @@
#include <weave/error.h>
#include <weave/provider/config_store.h>
-#include "src/privet/security_delegate.h"
+#include "src/privet/privet_types.h"
namespace weave {
class StorageInterface;
+enum class RootClientTokenOwner {
+ kNone,
+ kClient,
+ kCloud,
+};
+
// Handles reading buffet config and state files.
class Config final {
public:
@@ -28,7 +34,7 @@
std::string robot_account;
std::string last_configured_ssid;
std::vector<uint8_t> secret;
- bool local_auth_info_changed{true};
+ RootClientTokenOwner root_client_token_owner{RootClientTokenOwner::kNone};
};
using OnChangedCallback = base::Callback<void(const weave::Settings&)>;
@@ -92,8 +98,9 @@
void set_secret(const std::vector<uint8_t>& secret) {
settings_->secret = secret;
}
- void set_local_auth_info_changed(bool local_auth_info_changed) {
- settings_->local_auth_info_changed = local_auth_info_changed;
+ void set_root_client_token_owner(
+ RootClientTokenOwner root_client_token_owner) {
+ settings_->root_client_token_owner = root_client_token_owner;
}
void Commit();