Skip to content

Commit

Permalink
[openhabcloud] Sensor more secrets
Browse files Browse the repository at this point in the history
Signed-off-by: Sami Salonen <[email protected]>
  • Loading branch information
ssalonen committed Mar 6, 2022
1 parent 4ce01d5 commit bf5fa1e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private void writeFile(File file, String content) {
file.getParentFile().mkdirs();
try {
Files.writeString(file.toPath(), content, StandardCharsets.UTF_8);
logger.debug("Created file '{}' with content '{}'", file.getAbsolutePath(), content);
logger.debug("Created file '{}' with content '{}'", file.getAbsolutePath(), sensored(content));
} catch (FileNotFoundException e) {
logger.error("Couldn't create file '{}'.", file.getPath(), e);
} catch (IOException e) {
Expand All @@ -318,11 +318,11 @@ private String getSecret() {

if (!file.exists()) {
newSecretString = randomString(20);
logger.debug("New secret = {}", newSecretString);
logger.debug("New secret = {}", sensored(newSecretString));
writeFile(file, newSecretString);
} else {
newSecretString = readFirstLine(file);
logger.debug("Using secret at '{}' with content '{}'", file.getAbsolutePath(), newSecretString);
logger.debug("Using secret at '{}' with content '{}'", file.getAbsolutePath(), sensored(newSecretString));
}

return newSecretString;
Expand Down

0 comments on commit bf5fa1e

Please sign in to comment.