format: Refactor wildcard names to rewrite early
Instead of playing games with trying to format them nicely, we instead can just rewrite them right at the start to no longer be wildcards if they show up >1 time in the policy. This fixes a panic being caused if a ref had an array path segment, by making a new term we were passing along a nil Location. While we could correct this by just passing the original term from the ref we can avoid all this special handling altogether by rewriting the wildcards earlier. Fixes: #2430 Signed-off-by: Patrick East <east.patrick@gmail.com>
P
Patrick East committed
68e57b1cc172606a63ec419b9a39cb2e0eb99e97
Parent: ad57067