#include "middleware.hpp"
#include <middlewares/auth.hpp>
namespace sample::grpc::auth::server {
Middleware::Middleware() = default;
auto it = metadata.find(kKey);
if (it == metadata.cend() || it->second != kCredentials) {
rpc.
FinishWithError(::grpc::Status{::grpc::StatusCode::PERMISSION_DENIED,
"Invalid credentials"});
return;
}
}
}