001package co.codewizards.cloudstore.ls.rest.server.auth; 002 003import co.codewizards.cloudstore.core.util.PasswordUtil; 004 005// TODO implement changing passwords - sth. similar to TransientRepoPasswordManager 006public class AuthManager { 007 008 private final String password = new String(PasswordUtil.createRandomPassword(25)); 009 010 protected AuthManager() { } 011 012 private static final class Holder { 013 public static final AuthManager instance = new AuthManager(); 014 } 015 016 public static AuthManager getInstance() { 017 return Holder.instance; 018 } 019 020 public String getCurrentPassword() { 021 return password; 022 } 023 024 public boolean isPasswordValid(String password) { 025 return this.password.equals(password); 026 } 027}