Skip to content

feat(kafka-logger): support sasl config in brokers#8050

Merged
spacewander merged 45 commits intoapache:masterfrom
starsz:kafka_sasl
Oct 11, 2022
Merged

feat(kafka-logger): support sasl config in brokers#8050
spacewander merged 45 commits intoapache:masterfrom
starsz:kafka_sasl

Conversation

@starsz
Copy link
Copy Markdown
Contributor

@starsz starsz commented Oct 9, 2022

Description

Fixes #8046

Thanks to @biubiue and the original PR #7782.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@biubiue
Copy link
Copy Markdown
Contributor

biubiue commented Oct 9, 2022

I think it is not good to put sasl_config under borkers node, if more than one borker node, you need to configure duplicate sasl_config

@biubiue
Copy link
Copy Markdown
Contributor

biubiue commented Oct 9, 2022

I'm glad you continue this feat PR

@starsz
Copy link
Copy Markdown
Contributor Author

starsz commented Oct 10, 2022

I think it is not good to put sasl_config under borkers node, if more than one borker node, you need to configure duplicate sasl_config

Hi, @biubiue .I think we can put the sasl_config under brokers first so that we can support configuring different sasl_config under different brokers.

Then we can add sasl_config besides sasl_config as global sasl_config, if the broker doesn't configure sasl_config then it will use global sasl_config instead.

@starsz starsz marked this pull request as ready for review October 10, 2022 05:55
properties = {
mechanism = {
type = "string",
default = "PLAIN"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use enum to make sure the passing mechanism is legal? Although only PLAIN is currently supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Let me add the enum and add a test case to cover it.

@tzssangglass
Copy link
Copy Markdown
Member

LGTM

starsz and others added 5 commits October 10, 2022 14:33
Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
tzssangglass
tzssangglass previously approved these changes Oct 10, 2022
volumes:
- ./ci/pod/kafka/kafka-server/kafka_jaas.conf:/opt/bitnami/kafka/config/kafka_jaas.conf:ro
- ./ci/pod/kafka/kafka-server/selfsigned.jks:/opt/bitnami/kafka/config/certs/kafka.keystore.jks:ro
- ./ci/pod/kafka/kafka-server/selfsigned.jks:/opt/bitnami/kafka/config/certs/kafka.truststore.jks:ro
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selfsigned.jks file is only generated when the last test is executed, look: https://github.com/apache/apisix/blob/master/.github/workflows/build.yml#L117-L120, and should not exist when the plugin test is executed. Why can CI still pass, very puzzled.....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry.My fault.

Why can CI still pass, very puzzled....

The file or directory does not need to exist on the Docker host already. It is created on demand if it does not yet exist.
So it wouldn't influence the CI.

refer: https://docs.docker.com/storage/bind-mounts/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it ~~~

@spacewander spacewander merged commit c201d72 into apache:master Oct 11, 2022
@starsz starsz deleted the kafka_sasl branch October 11, 2022 05:45
Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request Nov 4, 2022
Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
Co-authored-by: biubiue <hichuanbiao@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: As a user, I want to support sasl_config in kafka-logger plugin, so that we can send logs to brokers that enable authentication

5 participants