swoole / phpkafka

PHP Kafka client is used in PHP-FPM and Swoole. PHP Kafka client supports 50 APIs, which might be one that supports the most message types ever.
https://longlang.org/
Apache License 2.0
271 stars 47 forks source link

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

Open wuxi889 opened 9 months ago

wuxi889 commented 9 months ago

Added

前置条件为需要开启 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

wuxi889 commented 9 months ago

@Yurunsoft @limingxinleo

Yurunsoft commented 9 months ago

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

wuxi889 commented 9 months ago

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

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

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

wuxi889 commented 3 months ago

image image image

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

PedroPMS commented 2 months ago

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

wuxi889 commented 2 months ago

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.