OPA球模式不包括在其路径中具有特定部分的URL
我正在尝试写一个 opa glob tatter 没有字符串/Special-part/{whywhing}/callback
的URL路径,其中{whywhing}
是一个路径参数,此路径可能有可能具有字符之前和之后。
我的车轮旋转了很多,但我已经一无所获(现在!),所以我想知道是否有人可以帮助我。
以下是一些匹配/不匹配的案例:
// match
/signup/activate-account
/v1/signup/activate-account
/v2/signup/activate-account
/signup/hello/world
/signup/hello-world
/something/else
// no match
/special-part/abc123/callback
/special-part/xyz/callback
/v1/special-part/abc123/callback
/v2/special-part/abc123/callback/123
I'm trying to write an OPA glob pattern that matches any URL path that does NOT have the string /special-part/{whatever}/callback
in it, where {whatever}
is a path parameter, and this path can potentially have characters before and after it.
I've spun my wheels a good deal and I've gotten nowhere (yet!), so I was wondering if someone could help me out.
Here are some match/no-match cases:
// match
/signup/activate-account
/v1/signup/activate-account
/v2/signup/activate-account
/signup/hello/world
/signup/hello-world
/something/else
// no match
/special-part/abc123/callback
/special-part/xyz/callback
/v1/special-part/abc123/callback
/v2/special-part/abc123/callback/123
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许是这样的:
可在
Something like this perhaps:
Executable on the Rego playground