Skip to content

(feature) relayproxy -> implement OpenFeature ADR0008 "Server-Sent Events (SSE) for bulk evaluation changes" #5675

Description

@vi-verrone

Requirements

Current behaviour
The relayproxy seems to not include the eventStreams field into the OFREPBulkEvaluationSuccess response model when using OFREP endpoint ofrep/v1/evaluate/flags.

Expected behaviour
The relayproxy should implement OpenFeature ADR0008 to let OFREP providers use the eventStreams field and eventually read for flag changes, without the needs of polling.

Proposals and Considerations
The relayproxy already expose am SSE endpoint /stream/v1/sse/flag/change that can be included in BulkEvaluationSuccess responses, for example:
{ "flags": [...], "eventStreams": [{ "type": "sse", "url": "${RESOLVED_SSE_HOST}/stream/v1/sse/flag/change", "inactivityDelaySec": ${RESOLVED_INACTIVITY_DELAY} } ] }

RESOLVED_SSE_HOST may be:

  • resolved automatically from the incoming request, by using an internal context property in the payload like gofeatureflag.sseEndpoint or some request header like x-gofeatureflag-sse-endpoint
  • resolved from a mapping configuration in the config file. For example a new sse.endpoint or eventStream.endpoint property.

The same may be applied to RESOLVED_INACTIVITY_DELAY.

NOTE: The feature may be initially considered opt-in through a flag in the config file like sse.ofrepEnabled or something else that fits better. This will let unchanged config files to make relayproxy to behave as-is.

Eventual work to be done

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions