Skip to content

Commit 1ca50fd

Browse files
Update Readme for HMAC
Signed-off-by: Florian Wagner <[email protected]>
1 parent 8de3818 commit 1ca50fd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ pip install frequenz-client-reporting==$VERSION
3939

4040
```python
4141
from datetime import datetime, timedelta
42+
import os
4243

4344
from frequenz.client.common.metric import Metric
4445
from frequenz.client.reporting import ReportingApiClient
4546

4647
# Change server address
4748
SERVER_URL = "grpc://replace-this-with-your-server-url:port"
4849
API_KEY = open('api_key.txt').read().strip()
49-
client = ReportingApiClient(server_url=SERVER_URL, key=API_KEY)
50+
# It is recommended to use a proper secret store to get the secret
51+
# For local development, make sure not to leave it in the shell history
52+
SIGN_SECRET= os.environ['REPORTING_API_SIGN_SECRET']
53+
client = ReportingApiClient(server_url=SERVER_URL, auth_key=API_KEY, sign_secret=SIGN_SECRET)
5054
```
5155

5256
Besides the `microgrid_id`, `component_id`s, `metrics`, start, and end time,
@@ -158,6 +162,7 @@ microgrid component data from the reporting API.
158162
reporting-cli \
159163
--url localhost:4711 \
160164
--key=$(<api_key.txt)
165+
--sign_secret=$SIGN_SECRET
161166
--mid 42 \
162167
--cid 23 \
163168
--metrics AC_ACTIVE_POWER AC_REACTIVE_POWER \

RELEASE_NOTES.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
9+
* The `key` parameter of the client has been renamed to `auth_key`
1010

1111
## New Features
1212

1313
* Add HMAC generation capabilities.
14-
* The new CLI option "key" can be used to provide the server's key.
15-
* The client itself now has a "key" argument in the constructor.
14+
* The new CLI option "sign_secret" can be used to provide the server's key.
15+
* The client itself now has a "sign_secret" argument in the constructor.
16+
* Update documentation describing how to use the above options.
1617

1718
## Bug Fixes
1819

0 commit comments

Comments
 (0)