Skip to content

Commit 16a062f

Browse files
committed
Update documentation to use new auth parameters
- Replace deprecated 'key' parameter with 'auth_key' in examples - Add 'sign_secret' parameter to examples - Update environment variable names from DISPATCH_API_KEY to DISPATCH_API_AUTH_KEY - Add DISPATCH_API_SIGN_SECRET environment variable Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 4cea8eb commit 16a062f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
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",

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)