Skip to content
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

Add kpro_auth_backend:auth/8 to support passing handshake vsn #102

Merged
merged 3 commits into from
Jun 10, 2022

Conversation

starbelly
Copy link
Contributor

This PR changes kpro_auth_backend to export auth/8 vs auth/7 to support passing the handshake version to a callback module. auth/8 will check to see CallbackModule exports auth/7, if it does not auth/6 on the callback module will be called for backwards compat.

As for the placement of the handshake vsn arg in function head, no strong feelings. I would even go so far as to suggest passing a map or a record to the callback module, but that doesn't have to be done in this PR either, unless we're open to the idea and would like to avoid future churn. An example of what the might look like can be seen here : https://github.com/kafka4beam/brod_gssapi/blob/51be03dcbcaa48cd77edcda3e8e75ca5e20123e8/src/brod_gssapi.erl#L94. However, we'd want to support a private key where callback modules can stuff in k/vs relevant to their context.

Copy link
Contributor

@kjellwinblad kjellwinblad left a comment

Choose a reason for hiding this comment

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

Looks good to me. I agree that passing the version in a map would be more future safe so I think we can go for that option. Let @zmstone have a look as well before you merge as he is more familiar with the code.

@zmstone
Copy link
Contributor

zmstone commented Jun 9, 2022

Looks good to me. I agree that passing the version in a map would be more future safe so I think we can go for that option. Let @zmstone have a look as well before you merge as he is more familiar with the code.

I think this is good.

@starbelly
Copy link
Contributor Author

Looks good to me. I agree that passing the version in a map would be more future safe so I think we can go for that option. Let @zmstone have a look as well before you merge as he is more familiar with the code.

I think this is good.

To be clear, are we in favor of add auth/1 here?

@zmstone
Copy link
Contributor

zmstone commented Jun 10, 2022

Looks good to me. I agree that passing the version in a map would be more future safe so I think we can go for that option. Let @zmstone have a look as well before you merge as he is more familiar with the code.

I think this is good.

To be clear, are we in favor of add auth/1 here?

Sorry. I meant this current impl looks good.
However if we can foresee now there will be more args in the future (like the private key mentioned in pr description) then maybe a map makes sense
— note though, SaslOpts was designed to be an opaque term for extra args passing through kafka_protocol

@starbelly
Copy link
Contributor Author

@zmstone sounds good. I think all changes that need to be made have been made, but let me know if other wise. Will squash and merge on your approval.

@starbelly starbelly merged commit 4bb7a63 into kafka4beam:master Jun 10, 2022
@zmstone
Copy link
Contributor

zmstone commented Jun 10, 2022

released 4.1.0

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.

3 participants