Skip to content

authz/perforce: support wildcard permissions

Warren Gifford requested to merge perforce-wildcards into main

Created by: bobheadxi

Implements Perforce wildcard permissions support

Prefix queries were implemented with PostgreSQL’s LIKE, so we can leverage the % syntax currently used to support prefixes to mimic wildcards along a path. To support * wildcards, which only match a single directory, we switch the prefix queries to use PostgreSQL's SIMILAR TO, which allows us to leverage some simple regex, namely [^/]+.

To reflect the expanded functionality of XXXPrefixes and friends, prefixes are now referred to as XXXContains in relevant code.

Closes https://github.com/sourcegraph/customer/issues/416, closes https://github.com/sourcegraph/customer/issues/404

Merge request reports

Loading