diff --git a/README.md b/README.md index 08fbb9a..f1bd7e7 100644 --- a/README.md +++ b/README.md @@ -39,14 +39,18 @@ pip install frequenz-client-reporting==$VERSION ```python from datetime import datetime, timedelta +import os from frequenz.client.common.metric import Metric from frequenz.client.reporting import ReportingApiClient # Change server address SERVER_URL = "grpc://replace-this-with-your-server-url:port" -API_KEY = open('api_key.txt').read().strip() -client = ReportingApiClient(server_url=SERVER_URL, key=API_KEY) +AUTH_KEY = os.environ['REPORTING_API_AUTH_KEY'].strip() +# It is recommended to use a proper secret store to get the secret +# For local development, make sure not to leave it in the shell history +SIGN_SECRET= os.environ['REPORTING_API_SIGN_SECRET'].strip() +client = ReportingApiClient(server_url=SERVER_URL, auth_key=AUTH_KEY, sign_secret=SIGN_SECRET) ``` Besides the `microgrid_id`, `component_id`s, `metrics`, start, and end time, @@ -157,7 +161,8 @@ microgrid component data from the reporting API. ```bash reporting-cli \ --url localhost:4711 \ - --key=$( +* The `key` parameter of the client has been renamed to `auth_key` ## New Features * Add HMAC generation capabilities. - * The new CLI option "key" can be used to provide the server's key. - * The client itself now has a "key" argument in the constructor. + * The new CLI option "sign_secret" can be used to provide the server's HMAC secret. + * The client itself now has a "sign_secret" argument in the constructor. + * Update documentation describing how to use the above options. ## Bug Fixes diff --git a/src/frequenz/client/reporting/cli/__main__.py b/src/frequenz/client/reporting/cli/__main__.py index 6f0563b..9085055 100644 --- a/src/frequenz/client/reporting/cli/__main__.py +++ b/src/frequenz/client/reporting/cli/__main__.py @@ -102,7 +102,7 @@ def main() -> None: states=args.states, bounds=args.bounds, service_address=args.url, - auth_key=args.key, + auth_key=args.auth_key, fmt=args.format, sign_secret=args.sign_secret, )