Change interface of ClaimRootClientAuthToken and ConfirmAuthToken
Add RootClientTokenOwner argument to check if this owner can claim
device.
Add ErrorPtr to return error in privet response.
BUG=25766815
Change-Id: I508c934e23092514e37b1f4790f0f1e693583ae1
Reviewed-on: https://weave-review.googlesource.com/1939
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/src/privet/auth_manager.h b/src/privet/auth_manager.h
index 62a1606..ce406ce 100644
--- a/src/privet/auth_manager.h
+++ b/src/privet/auth_manager.h
@@ -44,16 +44,17 @@
base::Time Now() const;
- std::vector<uint8_t> ClaimRootClientAuthToken(RootClientTokenOwner owner);
- bool ConfirmAuthToken(const std::vector<uint8_t>& token);
+ std::vector<uint8_t> ClaimRootClientAuthToken(RootClientTokenOwner owner,
+ ErrorPtr* error);
+ bool ConfirmAuthToken(const std::vector<uint8_t>& token, ErrorPtr* error);
std::vector<uint8_t> GetRootClientAuthToken() const;
bool IsValidAuthToken(const std::vector<uint8_t>& token) const;
- private:
void SetSecret(const std::vector<uint8_t>& secret,
RootClientTokenOwner owner);
+ private:
Config* config_{nullptr};
base::DefaultClock default_clock_;
base::Clock* clock_{&default_clock_};