Class SecretValue
java.lang.Object
org.cloudburstmc.netty.util.nethernet.SecretValue
A secret a host configured, which may be the value itself or a file holding it.
A configuration file is read by anyone who can read the directory, gets copied between machines and ends up in support requests. A file reference keeps the secret out of it and leaves the protection to the filesystem.
-
Method Summary
-
Method Details
-
resolve
Resolves a configured value, reading it from a file when it names one.A value is a file reference when it begins with
file:or looks like a path. The file's trailing line terminator is dropped, because a file written byechoor an editor has one and it is never part of the secret.- Parameters:
value- The configured value, which may be emptydirectory- The directory a relative path is resolved against- Returns:
- The secret itself, or the value unchanged when it names no file
- Throws:
IOException- If the value names a file that cannot be read
-