Skip to content

Add generic API credential fallbacks to dispatch CLI - #263

Merged
Marenz merged 1 commit into
frequenz-floss:v1.x.xfrom
Marenz:rename-dispatch-api-key
Sep 2, 2026
Merged

Add generic API credential fallbacks to dispatch CLI#263
Marenz merged 1 commit into
frequenz-floss:v1.x.xfrom
Marenz:rename-dispatch-api-key

Conversation

@Marenz

@Marenz Marenz commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Adds FREQUENZ_API_KEY / FREQUENZ_API_SECRET fallbacks to dispatch-cli, following frequenz-io/rnd#187.

Explicit options take precedence over the Dispatch-specific environment pair, which takes precedence over the generic pair. Keys and signing secrets are never mixed across sources.

@Marenz
Marenz requested review from a team as code owners February 10, 2026 09:50
@Marenz
Marenz requested review from shsms and stefan-brus-frequenz and removed request for a team February 10, 2026 09:50
@github-actions github-actions Bot added part:cli Affects the command-line interface part:test-utils Affects the test utilities part:dispatcher labels Feb 10, 2026

@llucax llucax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would hold on this one too:

  1. We need to make sure we agree on whatever name you want to propose, to avoid having to change everything again (including CLI args, constructor parameters and env variables, I would align them ideally, so either --api-key/api_key=/_API_KEYor--key/key=/_KEY`, but not a mix of both).
  2. I would do the change top-down (i.e. change client-base first), so it gets more visibility and all projects get updated, otherwise it only adds more confusion if some projects use one and others the other
  3. Unrelated, but I would consider removing the env var support, at least for the client library (we can keep it as a CLI-only feature, it makes more sense there). Even when "automatic auth" can be convenient, I guess making auth explicit in code is not a crazy requirement.

@Marenz

Marenz commented Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

Unrelated, but I would consider removing the env var support, at least for the client library (we can keep it as a CLI-only feature, it makes more sense there). Even when "automatic auth" can be convenient, I guess making auth explicit in code is not a crazy requirement.

It is a CLI only feature, the client/library itself knows nothing about env vars :)

@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests labels Feb 23, 2026
@Marenz Marenz changed the title Make key the canonical parameter, deprecate auth_key Make key the canonical parameter, deprecate auth_key, and raise on invalid start_time Feb 23, 2026
@Marenz

Marenz commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

@cwasicki This includes the fix for the epoch timestamp bug you discovered in frequenz-io/frequenz-actor-electricity-trading#570 — passing a numpy.datetime64 (from TimeSeries.index) to create(start_time=...) silently produced epoch dispatches. The fix raises ValueError immediately for anything that isn't a datetime or "NOW", and the corresponding fix in the actor should convert the index timestamps to proper datetime objects before constructing BatteryPowerScheduleEntry.

@cwasicki cwasicki left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The start time fix LGTM, thank you!

@Marenz
Marenz force-pushed the rename-dispatch-api-key branch from 9c3c455 to 44e7bdf Compare February 23, 2026 13:23
@Marenz Marenz changed the title Make key the canonical parameter, deprecate auth_key, and raise on invalid start_time Make key the canonical parameter, deprecate auth_key Feb 23, 2026
@Marenz
Marenz force-pushed the rename-dispatch-api-key branch from 44e7bdf to 51a8844 Compare August 28, 2026 09:20
Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
@Marenz
Marenz force-pushed the rename-dispatch-api-key branch from 51a8844 to 07b1c97 Compare August 28, 2026 09:31
@Marenz Marenz changed the title Make key the canonical parameter, deprecate auth_key Add generic API credential fallbacks to dispatch CLI Aug 28, 2026
@Marenz
Marenz enabled auto-merge August 28, 2026 14:38
@Marenz
Marenz merged commit 6d8787f into frequenz-floss:v1.x.x Sep 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:cli Affects the command-line interface part:dispatcher part:docs Affects the documentation part:test-utils Affects the test utilities part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants