Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ async def create_actor(dispatch: DispatchInfo, receiver: Receiver[DispatchInfo])

async def run():
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
key = os.getenv("DISPATCH_API_KEY", "some-key")
auth_key = os.getenv("DISPATCH_API_AUTH_KEY", "some-key")
sign_secret = os.getenv("DISPATCH_API_SIGN_SECRET")

microgrid_id = 1

async with Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
key=key,
auth_key=auth_key,
sign_secret=sign_secret,
) as dispatcher:
await dispatcher.start_managing(
dispatch_type="EXAMPLE_TYPE",
Expand Down
7 changes: 4 additions & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

## Summary

<!-- Here goes a general summary of what this release is about -->
This is the first major version release with authentication parameter updates and dependency version expansion.

## Upgrading

* The `key` parameter in the `Dispatcher` constructor is now deprecated. Use `auth_key` instead. The `sign_secret` parameter is an additional optional parameter for signing.
* The `components` property in `DispatchInfo` is now deprecated. Use `target` instead.
Comment on lines -9 to -10
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess these were old release notes from the previous release, right? So the previous release deprecated them and this release will remove the deprecated names?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are still only deprecated , nothing is made incompatible yet

* The `key` parameter in the `Dispatcher` constructor is deprecated. Use `auth_key` instead.
* The `sign_secret` parameter is available and should be used for authentication. It will be soon required.
* The `components` property in `DispatchInfo` is deprecated. Use `target` instead.

## New Features

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
# plugins.mkdocstrings.handlers.python.import)
"frequenz-sdk >= 1.0.0-rc2100, < 1.0.0-rc2200",
"frequenz-channels >= 1.6.1, < 2.0.0",
"frequenz-client-dispatch >= 0.11.3, < 0.12.0",
"frequenz-client-dispatch >= 0.11.3, < 1.0.0",
"frequenz-client-base >= 0.11.0, < 0.12.0",
]
dynamic = ["version"]
Expand Down
6 changes: 4 additions & 2 deletions src/frequenz/dispatch/_actor_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,16 @@ def _update_dispatch_information(self, dispatch_update: DispatchInfo) -> None:

async def main():
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
key = os.getenv("DISPATCH_API_KEY", "some-key")
auth_key = os.getenv("DISPATCH_API_AUTH_KEY", "some-key")
sign_secret = os.getenv("DISPATCH_API_SIGN_SECRET")

microgrid_id = 1

async with Dispatcher(
microgrid_id=microgrid_id,
server_url=url,
key=key
auth_key=auth_key,
sign_secret=sign_secret,
) as dispatcher:
status_receiver = dispatcher.new_running_state_event_receiver("EXAMPLE_TYPE")

Expand Down