Skip to content

filter tag: enforce bans during parsing - #384

Open
codexagents wants to merge 1 commit into
flosch:masterfrom
tokenmaxed:sandbox@ns1029703/upstream-filter-tag-ban
Open

filter tag: enforce bans during parsing#384
codexagents wants to merge 1 commit into
flosch:masterfrom
tokenmaxed:sandbox@ns1029703/upstream-filter-tag-ban

Conversation

@codexagents

Copy link
Copy Markdown

Summary

  • resolve {% filter %} tag filters when the template is parsed
  • enforce the TemplateSet.BanFilter registry on that syntax
  • reject missing filter names before execution, matching expression-filter behavior

Why

Expression filters are checked against bannedFilters and bound during parsing. The filter tag currently stores only a name and calls TemplateSet.ApplyFilter at execution time; that API intentionally looks only at the filter registry, so {% filter random %} still executes after BanFilter("random").

Binding the function in the tag parser closes that sandbox bypass and makes both filter syntaxes follow the same lifecycle.

Verification

  • go test ./...
  • go test -race ./...
  • go vet ./...

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant