Skip to content

feat(providers): let operators restrict OAuth refresh to public IP addresses per Provider #6248

Backlog

Description

@stevenlee-oai

User story

I use OpenShell for managed OAuth credentials. When a Provider uses a token endpoint found through discovery, I want to limit its refresh requests to public IP addresses. I also want to keep supporting explicitly configured internal issuers on the same Gateway.

Problem and impact

A Provider profile specifies a token URL. A Workspace Secret can also restrict the exact URLs where the Gateway uses it. The hostname can stay the same while its DNS answers change between enrollment and renewal.

I can restrict outbound traffic for the entire Gateway or manage refresh externally. A Gateway-wide rule cannot distinguish two Providers with different requirements. External renewal gives up the Gateway’s built-in scheduling and token rotation.

Proposed workflow

Let the profile author opt into public addresses for OAuth refresh. For example, the setting could look like this.

refresh:
  strategy: oauth2_refresh_token
  token_url: https://login.example.org/oauth/token
  public_addresses_only: true

The field name is illustrative. Keep existing behavior when omitted. Apply the setting to both scheduled renewal and explicit rotation. Preserve TLS hostname verification and existing Workspace Secret endpoint restrictions.

Acceptance criteria

  • A Provider with the option enabled can refresh against a public HTTPS endpoint.
  • If the same hostname later resolves to private, loopback, link-local or reserved addresses, the Gateway refuses the attempt before sending credentials. Cover IPv4, IPv6 and mixed public and private answers.
  • The connection uses an address checked for that attempt. Any further destination must satisfy the same restriction.
  • If the transport cannot enforce the restriction, refresh status explains the failure without exposing credentials.
  • Another Provider on the same Gateway can still use an explicitly configured internal issuer.

Alternatives considered

Supervisor middleware handles Sandbox traffic. Gateway-managed refresh runs independently. An existing Gateway extension that can apply the policy per Provider would also meet this need.

I checked existing issues, the Provider profile documentation and the current implementation. This is a request for an optional policy.

Activity

  1. added
    state:triage-needed
    on Dec 4, 2026
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

    state:triage-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions