Add AuthManager::CreateAccessTokenFromAuth
In case of local auth client passes Macaroon token and device exchanges
that for access token.
BUG=25768507
Change-Id: Ibf126d9ef470cf7843deed6b0b954c99aa64e78d
Reviewed-on: https://weave-review.googlesource.com/2065
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/privet/auth_manager.h b/src/privet/auth_manager.h
index 00d6e32..6a403b4 100644
--- a/src/privet/auth_manager.h
+++ b/src/privet/auth_manager.h
@@ -55,7 +55,14 @@
ErrorPtr* error);
std::vector<uint8_t> GetRootClientAuthToken() const;
- bool IsValidAuthToken(const std::vector<uint8_t>& token) const;
+ bool IsValidAuthToken(const std::vector<uint8_t>& token,
+ ErrorPtr* error) const;
+ bool CreateAccessTokenFromAuth(const std::vector<uint8_t>& auth_token,
+ base::TimeDelta ttl,
+ std::vector<uint8_t>* access_token,
+ AuthScope* access_token_scope,
+ base::TimeDelta* access_token_ttl,
+ ErrorPtr* error) const;
void SetAuthSecret(const std::vector<uint8_t>& secret,
RootClientTokenOwner owner);