Skip to content

Add dynamic isAllowed function for network policy#68

Open
ziegfried wants to merge 1 commit intovercel-labs:mainfrom
ziegfried:is-allowed-function
Open

Add dynamic isAllowed function for network policy#68
ziegfried wants to merge 1 commit intovercel-labs:mainfrom
ziegfried:is-allowed-function

Conversation

@ziegfried
Copy link
Copy Markdown
Contributor

Allow configuring network access with a custom function that dynamically
checks whether a URL/method combination is allowed. The function receives
{ method, url } and can return boolean or Promise.

This provides more flexibility than static allowedUrlPrefixes for cases
like hostname pattern matching or async authorization checks.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 30, 2026

@ziegfried is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@ziegfried ziegfried marked this pull request as ready for review January 30, 2026 03:28
Allow configuring network access with a custom function that dynamically
checks whether a URL/method combination is allowed. The function receives
{ method, url } and can return boolean or Promise<boolean>.

This provides more flexibility than static allowedUrlPrefixes for cases
like hostname pattern matching or async authorization checks.
@ziegfried ziegfried force-pushed the is-allowed-function branch from a756da6 to 8d5cf7c Compare February 6, 2026 22:15
@ziegfried
Copy link
Copy Markdown
Contributor Author

@cramforce is this an API you'd consider? It would be useful for my use of just-bash, but I might be able to work around it.

As an alternative, some sort of middleware function to handle network requests may work just as well.

@cramforce
Copy link
Copy Markdown
Contributor

I like it a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants