Skip to content

Configure Distro Energy credentials per asset #142

Open

Description

@Miggets7

The Distro credentials are environment variables, so every realm on a manager shares them: DISTRO_GOPACS_CLIENT_ID/DISTRO_GOPACS_CLIENT_SECRET for GOPACS orders and DISTRO_ENERGY_CLIENT_KEY for day-ahead submissions. Distro assigns a portfolio to each OAuth client and enforces it, so a realm cannot reach another customer's portfolio. Every realm can act under the shared client's portfolio, though, so one manager cannot serve several Distro customers. Raised in #135 (review).

Move the credentials onto the EmsDistroEnergyAsset, the way OpenRemote already stores them in Agent.OAUTH_GRANT and GatewayAsset.CLIENT_SECRET. Each realm then brings its own Distro client, and Distro's per-client portfolio check keeps the realms apart.

Scope:

  • GOPACS: OAuth client ID and secret per asset, mark the secret with MetaItemType.SECRET.
  • Day-ahead: client key per asset.
  • Keep the environment variables as a fallback for single-customer managers.
  • Update ems/docs/DistroEnergyIntegration.md and drop the "One Distro Customer per Manager" restriction.

Open points:

  • MetaItemType.SECRET only conceals the value in the UI. Any user in the realm with read access can still fetch it through the API. Decide whether that is acceptable, or whether the secret needs restricting server-side.
  • If a Distro client always maps to exactly one portfolio, the portfolio attribute is redundant once the credentials sit on the asset. Check with Distro whether a client can hold several portfolios before removing it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions