Class DocIdValidator
java.lang.Object
org.codelibs.fess.api.v2.handlers.DocIdValidator
Shared validation for the
doc_id parameter used by the document-keyed v2
handlers (CacheHandler, ClickHandler, FavoriteGetHandler,
FavoritePostHandler).
Conservative allowlist — the search backend accepts more, but v2 surfaces
doc_id via the URL path / request body, so it is locked down to reject odd
input at the edge rather than let it reach OpenSearch as a term query (or enable
path-traversal-style abuse). Centralised here so the handlers share a single
compiled pattern instead of each declaring its own copy.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DocIdValidator
public DocIdValidator()Creates a document-id validator. Registered as the DI componentv2DocIdValidatorand obtained viaComponentUtil.getV2DocIdValidator().
-
-
Method Details
-
isValid
Checks whether a document id is acceptable for the v2 surface.- Parameters:
docId- the candidate document id- Returns:
trueif non-blank and composed only of allowed characters
-