phpkafka icon indicating copy to clipboard operation
phpkafka copied to clipboard

添加了基于 SCRAM-SHA512 加密方式的连接

Open wuxi889 opened this issue 2 years ago • 6 comments

Added

  • 添加了基于 SCRAM-SHA512 加密方式的连接;

前置条件为需要开启 ssl,使用时 config/autoload/kafka.php 文件的 sasl 配置为

...
'sasl' => [
    'type' => \longlang\phpkafka\Sasl\ScramSha512Sasl::class,
    'username' => env('KAFKA_SASL_USERNAME', ''),
    'password' => env('KAFKA_SASL_PASSWORD', ''),
    // 是否验证第二次握手的服务器响应消息的签名
    'verify_final_signature' => (bool) env('KAFKA_SASL_VERIFY_FINAL_SIGNATURE', true),
],
...

Changed

  • 调整心跳检测过程中获取上次检测时间为 0 时会抛出异常的问题;

wuxi889 avatar Feb 20 '24 06:02 wuxi889

@Yurunsoft @limingxinleo

wuxi889 avatar Feb 21 '24 08:02 wuxi889

有 2 个测试没有通过,建议先解决一下

Yurunsoft avatar Feb 21 '24 09:02 Yurunsoft

有 2 个测试没有通过,建议先解决一下

@Yurunsoft phpstan 我在本地(src/Sasl)未测出问题,麻烦告知下线上的测试环境。 image

还有 php-cs-fix 也是,这个错误有点奇怪 image

wuxi889 avatar Feb 21 '24 11:02 wuxi889

image image image

php cs 与 php stan 已测试通过 @Yurunsoft @limingxinleo

wuxi889 avatar Aug 29 '24 10:08 wuxi889

Any updates? Im tying to use SCRAM-SHA512 on producer too.

PedroPMS avatar Sep 13 '24 18:09 PedroPMS

Any updates? Im tying to use SCRAM-SHA512 on producer too.

Apologies, the author hasn't merged this MR yet. In the meantime, you can fork the project, modify the composer.json to point to your fork in the repositories section, and use it temporarily.

wuxi889 avatar Sep 14 '24 03:09 wuxi889