mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-29 06:18:39 +02:00
Rename "private_key" to "certificate_key"
This commit is contained in:
parent
aecf64fc03
commit
d5d4cb9e63
6 changed files with 9 additions and 10 deletions
|
@ -188,12 +188,12 @@ ErrorOr<std::string> AuthInfo::getToken(const std::string& username, const std::
|
|||
jwt.setIat(now);
|
||||
jwt.setExp(now + 10h);
|
||||
jwt.setSub(username);
|
||||
std::ifstream ifs(settings_.ssl.private_key);
|
||||
std::string private_key((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
|
||||
std::ifstream ifs(settings_.ssl.certificate_key);
|
||||
std::string certificate_key((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
|
||||
if (!ifs.good())
|
||||
return ErrorCode{std::make_error_code(std::errc::io_error), "Failed to read private key file"};
|
||||
// TODO tls: eroor handling
|
||||
std::optional<std::string> token = jwt.getToken(private_key);
|
||||
std::optional<std::string> token = jwt.getToken(certificate_key);
|
||||
if (!token.has_value())
|
||||
return ErrorCode{AuthErrc::failed_to_create_token};
|
||||
return token.value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue