docs: add AGENTS.md, CLAUDE.md, and expand README (#12) Co-authored-by: Maia <maia@noreply>
This module is part of the Apache Sling project.
The Apache Sling Security module provides:
This OSGi bundle can be used as a standalone bundle outside of Apache Sling. In that case, only the Referrer Filter functionality is available, as the Content Disposition Filter depends on the Apache Sling API.
mvn clean installmvn clean install -DskipTestsmvn testThe Referrer Filter is registered as an OSGi HTTP Whiteboard Preprocessor and checks modification requests from browsers.
Configuration PID: org.apache.sling.security.impl.ReferrerFilter
Main configuration options:
allow.empty)allow.hosts)allow.hosts.regexp)filter.methods)exclude.agents.regexp)exclude.paths){ "allow.empty": false, "allow.hosts": ["mysite.com", "localhost"], "allow.hosts.regexp": [], "filter.methods": ["POST", "PUT", "DELETE", "COPY", "MOVE"], "exclude.agents.regexp": [], "exclude.paths": [] }
It is also possible to amend this configuration with factory configurations for:
org.apache.sling.security.impl.ReferrerFilterAmendmentImpl{ "allow.hosts": ["mysite.com", "localhost"], "allow.hosts.regexp": [], "exclude.agents.regexp": [], "exclude.paths": [] }
The Content Disposition Filter adds Content-Disposition: attachment for configured Sling resource paths (for GET and HEAD requests), with support for explicit path includes, prefix includes, exclusions, and optional all-path mode.
Configuration PID: org.apache.sling.security.impl.ContentDispositionFilter
Main configuration options:
sling.content.disposition.paths)sling.content.disposition.excluded.paths)sling.content.disposition.all.paths){ "sling.content.disposition.paths": [ "/content/secure/*", "/content/files/report.pdf:text/html,text/plain" ], "sling.content.disposition.excluded.paths": [ "/content/secure/preview" ], "sling.content.disposition.all.paths": false }