Enum Class ConfigFile
- All Implemented Interfaces:
Serializable, Comparable<ConfigFile>, Constable
The config files the management API will write, and the only names
set-config accepts.
This enum IS the allowlist
A caller sends a logical id -bots, guard-rules - and never a path or a file name.
byId(String) maps it to the file name held here; anything unrecognized is refused. That is the
whole path-traversal defence, and it is a closed set rather than a check on a caller-supplied
string, because a check is a thing that can be written slightly wrong. There is no reason for a
caller to name a file, so it cannot.
One file per Configs screen in the console, and deliberately no more:
conf/frontcache.properties is excluded because it holds front-cache.api-key (a console editing it
could lock itself out of the node it is editing), because FCConfig has no live re-read at all, and
because a typo in it is a node that does not serve.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigFileThe name under FRONTCACHE_HOME/conf - never composed from caller input.getId()The id a caller sends, and the one the console's screens are keyed by.static Stringids()The accepted ids, for an error message that tells the caller what it should have sent.static ConfigFileReturns the enum constant of this class with the specified name.static ConfigFile[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RESILIENCE
-
GUARD_RULES
-
BOTS
-
DYNAMIC_URLS
-
FALLBACKS
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getId
The id a caller sends, and the one the console's screens are keyed by. -
getFileName
The name under FRONTCACHE_HOME/conf - never composed from caller input. -
byId
- Returns:
- the file, or null when the id is not one of ours
-
ids
The accepted ids, for an error message that tells the caller what it should have sent.
-