Add authentication credential callback support#61
Open
emelialei88 wants to merge 15 commits into
Open
Conversation
c64c673 to
0663a77
Compare
0663a77 to
70c3f88
Compare
70c3f88 to
1c01ff0
Compare
a8ae7c5 to
b1aeca1
Compare
Signed-off-by: Emelia Lei <wlei29@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
`LOGGER.exception` already captures and prints the currently in-flight exception. This patch removes the unused variable binding on the exception. Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
We check this error in different layers, along with providing type annotations for use with something like mypy. The closest parallel example we have is `FakeHostHealthMonitor`, which only does runtime type checking at the highest layer, in pure Python. This patch removes the duplicate error checking from the Cython layer. Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
This type doesn’t do much of anything on its own, and only makes it harder for a user to provide their own authentication credential provider, by forcing them to wrap whatever function they have in this type. This patch removes the class and lets users just pass any `Callable` of the right signature when constructing a `Session`. Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Right now, this defaults to `None` (i.e, no authentication). Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for authentication credential callbacks in the BlazingMQ Python SDK, enabling applications to provide dynamic authentication credentials when connecting to secured brokers.
New API Components
BasicAuthnCredentialCb- Python wrapper class that accepts a callable returning (mechanism: str, data: bytes) or NoneFakeAuthnCredentialCb- Cython class that bridges Python callbacks to C++ authentication infrastructureauthn_credential_cbparameter added toSession.__init__()andSession.with_options()Implementation Details
get_credential_data()method for C++ to invoke Python callbacksExample Usage