1

Official Documentation reports that link:

Rule matches requests from a list of sources that perform a list of operations subject to a list of conditions. A match occurs when at least one source, one operation and all conditions matches the request. An empty rule is always matched. Any string field in the rule supports Exact, Prefix, Suffix and Presence match:

Exact match: “abc” will match on value “abc”.
Prefix match: “abc*” will match on value “abc” and “abcd”.
Suffix match: “*abc” will match on value “abc” and “xabc”.
Presence match: “*” will match when value is not empty.

Does it mean that I can just apply * at beginning or end, so these kind of paths will not work ?

   - operation:
       methods: ["POST"]
       paths: ["/example-service/test/*/operation"]

It sounds a limitation, isn't it?

user1971444
  • 57
  • 1
  • 9

1 Answers1

2

It sounds a limitation, isn't it?

Yes, the path like this /example-service/test/*/operation is currently not supported.

You can use wildcard only at the start, end or whole string. You cannot use many wildcards or inside the string.

On the github you can find the issueSupport regex for ServiceRole spec.rules.paths, but it is currently open. The last sentence:

Is there any update for this feature? The support for /foo/id/*/bar would be a great plus.

Unfortunately, such use is not supported at the moment, though this may change in the future. Look also at this github issue and this question.

For the possible workaround see this github topic.

Mikołaj Głodziak
  • 4,775
  • 7
  • 28