You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We would like to configure our Quix applications with OAuth authentication through YAML files. For example:
Currently, this can easily be achieved with something like this:
# in my_module.pydefmy_oauth_cb(config: str) ->Tuple[str, float]:
# get token with configreturn"token", 1.0withopen("config.yml") asf:
config=yaml.safe_load(f)
# setting oauth_cb in the codeconfig["quix-app"]["broker_address"]["oauth_cb"] =my_oauth_cbapp=Application(
**config["quix-app"]
)
However, passing the oauth_cb function has to be done in the code. It would be beneficial if we could specify the callback via Pydantic's ImportString directly from the YAML file. For example:
Only a minor adjustment in quixstreams/kafka/configuration.py would be necessary - without impacting any existing functionality:
# file: quixstreams/kafka/configuration.py - lines: 55 - 62oauth_cb: Optional[Union[Callable[[str], Tuple[str, float]], ImportString]] = (
pydantic.Field(
# Prevent the AliasGenerator from changing the field name to "oauth.cb"default=None,
alias_priority=2,
serialization_alias="oauth_cb",
)
)
If it is OK, I would create a PR for the feature.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
We would like to configure our Quix applications with OAuth authentication through YAML files. For example:
Currently, this can easily be achieved with something like this:
However, passing the
oauth_cb
function has to be done in the code. It would be beneficial if we could specify the callback via Pydantic'sImportString
directly from the YAML file. For example:Only a minor adjustment in quixstreams/kafka/configuration.py would be necessary - without impacting any existing functionality:
If it is OK, I would create a PR for the feature.
The text was updated successfully, but these errors were encountered: