-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORE-3092 support metadata v9 #22669
CORE-3092 support metadata v9 #22669
Conversation
security::server_first_message send_scram_client_first( | ||
kafka::client::transport& client, | ||
const security::client_first_message& client_first) { | ||
kafka::sasl_authenticate_request client_first_req; | ||
{ | ||
auto msg = client_first.message(); | ||
client_first_req.data.auth_bytes = bytes(msg.cbegin(), msg.cend()); | ||
} | ||
auto client_first_resp = client.dispatch(client_first_req).get0(); | ||
BOOST_REQUIRE_EQUAL( | ||
client_first_resp.data.error_code, kafka::error_code::none); | ||
return security::server_first_message( | ||
client_first_resp.data.auth_bytes); | ||
} | ||
|
||
security::server_final_message send_scram_client_final( | ||
kafka::client::transport& client, | ||
const security::client_final_message& client_final) { | ||
kafka::sasl_authenticate_request client_last_req; | ||
{ | ||
auto msg = client_final.message(); | ||
client_last_req.data.auth_bytes = bytes(msg.cbegin(), msg.cend()); | ||
} | ||
auto client_last_resp = client.dispatch(client_last_req).get0(); | ||
|
||
BOOST_REQUIRE_EQUAL( | ||
client_last_resp.data.error_code, kafka::error_code::none); | ||
return security::server_final_message( | ||
std::move(client_last_resp.data.auth_bytes)); | ||
} | ||
|
||
void do_sasl_handshake(kafka::client::transport& client) { | ||
kafka::sasl_handshake_request req; | ||
req.data.mechanism = security::scram_sha256_authenticator::name; | ||
|
||
auto resp = client.dispatch(req).get0(); | ||
BOOST_REQUIRE_EQUAL(resp.data.error_code, kafka::error_code::none); | ||
} | ||
|
||
void authn_kafka_client( | ||
kafka::client::transport& client, | ||
const ss::sstring& username, | ||
const ss::sstring& password) { | ||
do_sasl_handshake(client); | ||
const auto nonce = random_generators::gen_alphanum_string(130); | ||
const security::client_first_message client_first(username, nonce); | ||
const auto server_first = send_scram_client_first(client, client_first); | ||
|
||
BOOST_REQUIRE( | ||
std::string_view(server_first.nonce()).starts_with(nonce)); | ||
BOOST_REQUIRE_GE( | ||
server_first.iterations(), security::scram_sha256::min_iterations); | ||
security::client_final_message client_final( | ||
bytes("n,,"), server_first.nonce()); | ||
auto salted_password = security::scram_sha256::hi( | ||
bytes(password.cbegin(), password.cend()), | ||
server_first.salt(), | ||
server_first.iterations()); | ||
client_final.set_proof(security::scram_sha256::client_proof( | ||
salted_password, client_first, server_first, client_final)); | ||
|
||
auto server_final = send_scram_client_final(client, client_final); | ||
BOOST_REQUIRE(!server_final.error()); | ||
|
||
auto server_key = security::scram_sha256::server_key(salted_password); | ||
auto server_sig = security::scram_sha256::server_signature( | ||
server_key, client_first, server_first, client_final); | ||
|
||
BOOST_REQUIRE_EQUAL(server_final.signature(), server_sig); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot duplication with kafka/client/sasl_client
, was it too hard to extract?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know :(. That uses a shared_broker_t
rather than the raw transport to handle network I/O.
new failures in https://buildkite.com/redpanda/redpanda/builds/52317#0191095c-d1a2-4a43-aa67-cf5158cb09b1:
new failures in https://buildkite.com/redpanda/redpanda/builds/52317#0191095c-d1a3-4a66-a94d-568835d9a0df:
new failures in https://buildkite.com/redpanda/redpanda/builds/52317#01910973-7913-4972-87b2-1e2e8b8af7d7:
new failures in https://buildkite.com/redpanda/redpanda/builds/52326#01910a78-c894-43f5-a037-9b7f5a1d3db7:
new failures in https://buildkite.com/redpanda/redpanda/builds/52326#01912307-28fb-41da-95c8-8f8180506541:
new failures in https://buildkite.com/redpanda/redpanda/builds/52491#01912459-05fa-4121-a8fa-d6979efeb931:
|
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52317#0191095c-d1a2-4a43-aa67-cf5158cb09b1 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52317#0191095c-d1a3-4a66-a94d-568835d9a0df ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52326#01910a78-c894-43f5-a037-9b7f5a1d3db7 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52326#01910a78-c893-4658-851f-3ca4331a8a40 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52326#01910a79-d337-4578-aa7b-31ef0b209a1e ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/53405#01917c10-174e-4760-8f68-9606a7c6612a |
f6e5555
to
b5df3f7
Compare
Force push
|
CI Failures: |
b5df3f7
to
6631b7f
Compare
If `include_topic_authorized_operations` is not set to true in the request, the `topic_authorized_operations` field in the topic metadata response must be the expected default value of -2147483648. Signed-off-by: Michael Boquard <michael@redpanda.com>
We do not need to audit authz checks in situations when returning back a bitfield representing the operations the authenticated user is permitted to perform. Signed-off-by: Michael Boquard <michael@redpanda.com>
6631b7f
to
96c9f0c
Compare
Force push
|
Force push
|
/ci-repeat 1 |
Signed-off-by: Michael Boquard <michael@redpanda.com>
f18bd51
to
2783b87
Compare
Force push:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Michael Boquard <michael@redpanda.com>
2783b87
to
b68d8d4
Compare
Force push
|
/backport v24.2.x |
// IMPORTANT: Do not bump support to v11 (or beyond) unless DescribeCluster v0 | ||
// has been implemented. v11 drops support for the authorized operations list | ||
// and moves those lists to DCv0 | ||
// Keep this at v8. Moving to v9 appears to cause issues with the Kafka Java | ||
// Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
Adds support for metadata API version 8
Backports Required
Release Notes
Improvements