Skip to content

Commit adb6451

Browse files
authored
Prepare for v1: Update auth parameters and client version (#202)
## Summary - Update documentation to use new `auth_key` and `sign_secret` parameters instead of deprecated `key` parameter - Update environment variable names from `DISPATCH_API_KEY` to `DISPATCH_API_AUTH_KEY` and add `DISPATCH_API_SIGN_SECRET` - Update dispatch client version constraint from < 0.12.0 to < 1.0.0 to prepare for v1 release
2 parents 754d9bd + d179a39 commit adb6451

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ async def create_actor(dispatch: DispatchInfo, receiver: Receiver[DispatchInfo])
3131

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

3637
microgrid_id = 1
3738

3839
async with Dispatcher(
3940
microgrid_id=microgrid_id,
4041
server_url=url,
41-
key=key,
42+
auth_key=auth_key,
43+
sign_secret=sign_secret,
4244
) as dispatcher:
4345
await dispatcher.start_managing(
4446
dispatch_type="EXAMPLE_TYPE",

RELEASE_NOTES.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
## Summary
44

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

77
## Upgrading
88

9-
* 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.
10-
* The `components` property in `DispatchInfo` is now deprecated. Use `target` instead.
9+
* The `key` parameter in the `Dispatcher` constructor is deprecated. Use `auth_key` instead.
10+
* The `sign_secret` parameter is available and should be used for authentication. It will be soon required.
11+
* The `components` property in `DispatchInfo` is deprecated. Use `target` instead.
1112

1213
## New Features
1314

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies = [
4040
# plugins.mkdocstrings.handlers.python.import)
4141
"frequenz-sdk >= 1.0.0-rc2100, < 1.0.0-rc2200",
4242
"frequenz-channels >= 1.6.1, < 2.0.0",
43-
"frequenz-client-dispatch >= 0.11.3, < 0.12.0",
43+
"frequenz-client-dispatch >= 0.11.3, < 1.0.0",
4444
"frequenz-client-base >= 0.11.0, < 0.12.0",
4545
]
4646
dynamic = ["version"]

src/frequenz/dispatch/_actor_dispatcher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,16 @@ def _update_dispatch_information(self, dispatch_update: DispatchInfo) -> None:
181181
182182
async def main():
183183
url = os.getenv("DISPATCH_API_URL", "grpc://dispatch.url.goes.here.example.com")
184-
key = os.getenv("DISPATCH_API_KEY", "some-key")
184+
auth_key = os.getenv("DISPATCH_API_AUTH_KEY", "some-key")
185+
sign_secret = os.getenv("DISPATCH_API_SIGN_SECRET")
185186
186187
microgrid_id = 1
187188
188189
async with Dispatcher(
189190
microgrid_id=microgrid_id,
190191
server_url=url,
191-
key=key
192+
auth_key=auth_key,
193+
sign_secret=sign_secret,
192194
) as dispatcher:
193195
status_receiver = dispatcher.new_running_state_event_receiver("EXAMPLE_TYPE")
194196

0 commit comments

Comments
 (0)