Skip to content

Commit

Permalink
Merge pull request #5401 from graphcareful/strip-license-key
Browse files Browse the repository at this point in the history
Strip license key of whitespace and newlines
  • Loading branch information
Rob Blafford committed Jul 8, 2022
2 parents 0aa6828 + a3cd095 commit c15cb93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/v/cluster/feature_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ ss::future<> feature_manager::do_maybe_update_active_version() {

ss::future<std::error_code>
feature_manager::update_license(security::license&& license) {
static const auto timeout = model::timeout_clock::now() + 5s;
const auto timeout = model::timeout_clock::now() + 5s;

auto cmd = cluster::feature_update_license_update_cmd(
cluster::feature_update_license_update_cmd_data{
Expand Down
2 changes: 2 additions & 0 deletions src/v/redpanda/admin_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/lexical_cast/bad_lexical_cast.hpp>
#include <fmt/core.h>
Expand Down Expand Up @@ -1586,6 +1587,7 @@ void admin_server::register_features_routes() {
}

try {
boost::trim_if(raw_license, boost::is_any_of(" \n"));
auto license = security::make_license(raw_license);
if (license.is_expired()) {
throw ss::httpd::bad_request_exception(
Expand Down

0 comments on commit c15cb93

Please sign in to comment.