Skip to content

feat: added restrict_relay option for local mode#34

Merged
petruki merged 1 commit intomasterfrom
staging
Feb 22, 2026
Merged

feat: added restrict_relay option for local mode#34
petruki merged 1 commit intomasterfrom
staging

Conversation

@petruki
Copy link
Member

@petruki petruki commented Feb 22, 2026

This pull request introduces a new feature to restrict the use of relay when running in local mode, controlled by a new restrict_relay option (defaulting to True). The change updates the client context, Switcher behavior, resolver logic, and documentation, and adds tests to verify the new behavior.

Restrict Relay Feature:

  • Added a new restrict_relay option to ContextOptions (default: True), which restricts the use of relay when using local snapshots. This is now part of the client context and is documented in the README. [1] [2] [3] [4] [5]
  • Updated the Switcher class to include a .restrict_relay() method, allowing per-instance override of the relay restriction. The client now initializes Switcher instances with the context's restrict_relay value. [1] [2] [3]
  • Modified the resolver logic to disable configs with relay enabled when restrict_relay is True. Added a helper to check if relay is enabled for a config. [1] [2]

Testing & Utilities:

  • Added new tests to verify that relay restriction works as expected and can be overridden. Updated test helpers to support the new option. [1] [2] [3]

@petruki petruki self-assigned this Feb 22, 2026
@petruki petruki added the enhancement New feature or request label Feb 22, 2026
@sonarqubecloud
Copy link

@petruki petruki merged commit 66710b2 into master Feb 22, 2026
15 checks passed
@petruki petruki deleted the staging branch February 22, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant