Resolves an API scope rule's ResourcePattern to the single entity name it targets, normalized for
lookup (trimmed and lowercased), or null when it cannot be resolved to exactly one entity.
null is the FAIL-CLOSED answer, and callers must treat it as "this rule may name any entity"
rather than "this rule names nothing" — a pattern we cannot map may well name the very entity the
caller is about to mirror into an unscoped snapshot. Refusing to materialize is recoverable and
loud; mirroring restricted rows is neither.
Normalization matches the way scope rules are authored and resolved: IsExactResourceName gates
the pattern at save time and Metadata.EntityByName resolves it, both case-insensitively.
Parameters
pattern: string|null|undefined
the rule's raw ResourcePattern (null/undefined/blank all resolve to null).
Returns string|null
the trimmed, lowercased entity name, or null when the pattern is not a single exact name.
Resolves an API scope rule's
ResourcePatternto the single entity name it targets, normalized for lookup (trimmed and lowercased), ornullwhen it cannot be resolved to exactly one entity.nullis the FAIL-CLOSED answer, and callers must treat it as "this rule may name any entity" rather than "this rule names nothing" — a pattern we cannot map may well name the very entity the caller is about to mirror into an unscoped snapshot. Refusing to materialize is recoverable and loud; mirroring restricted rows is neither.Normalization matches the way scope rules are authored and resolved:
IsExactResourceNamegates the pattern at save time andMetadata.EntityByNameresolves it, both case-insensitively.