You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(providers): let operators restrict OAuth refresh to public IP addresses per Provider #6248
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.
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