Skip to content

Commit

Permalink
fix: allow users to pass nkeys_seed_str as argument for NATS broker. (
Browse files Browse the repository at this point in the history
#1908)

* fix: allow users to pass `nkeys_seed_str` as argument for NATS broker.

This would simplify the usage of applications without a need to read files.

* fix: nkeys_seed_str default None

---------

Co-authored-by: Pastukhov Nikita <[email protected]>
  • Loading branch information
Drakorgaur and Lancetnik authored Nov 8, 2024
1 parent a3d5eb9 commit 0d4c237
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faststream/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Simple and fast framework to create message brokers based microservices."""

__version__ = "0.5.29"
__version__ = "0.5.30"

SERVICE_NAME = f"faststream-{__version__}"
11 changes: 10 additions & 1 deletion faststream/nats/broker/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ class NatsInitKwargs(TypedDict, total=False):
Doc("A user credentials file or tuple of files."),
]
nkeys_seed: Annotated[
Optional[str],
Doc("Path-like object containing nkeys seed that will be used."),
]
nkeys_seed_str: Annotated[
Optional[str],
Doc("Nkeys seed to be used."),
]
Expand Down Expand Up @@ -350,7 +354,11 @@ def __init__(
] = None,
nkeys_seed: Annotated[
Optional[str],
Doc("Nkeys seed to be used."),
Doc("Path-like object containing nkeys seed that will be used."),
] = None,
nkeys_seed_str: Annotated[
Optional[str],
Doc("Raw nkeys seed to be used."),
] = None,
inbox_prefix: Annotated[
Union[str, bytes],
Expand Down Expand Up @@ -509,6 +517,7 @@ def __init__(
token=token,
user_credentials=user_credentials,
nkeys_seed=nkeys_seed,
nkeys_seed_str=nkeys_seed_str,
**secure_kwargs,
# callbacks
error_cb=self._log_connection_broken(error_cb),
Expand Down

0 comments on commit 0d4c237

Please sign in to comment.