Skip to content

Instantly share code, notes, and snippets.

@JRWu
Created July 31, 2024 12:54
Show Gist options
  • Select an option

  • Save JRWu/912bca7512b712113cc9b7d20bb78246 to your computer and use it in GitHub Desktop.

Select an option

Save JRWu/912bca7512b712113cc9b7d20bb78246 to your computer and use it in GitHub Desktop.
deny[x] {
request_permission[_] == "apis"
request_intent = "write"
listen_path := input.request.body.api_definition.proxy.listen_path
result := regex.match("^(\/|[a-z0-9-.]+|{[a-zA-Z0-9_]+})+$", listen_path)
not result
x := sprintf("Listen path '%v' must be kebab-case. (lower-case and separated with hyphens)", [listen_path])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment