public String expandPasswordAlias(String alias) { String expandedPassword = null; if (alias == null) { return null; } try { expandedPassword = RelativePathResolver.getRealPasswordFromAlias(alias); } catch (Exception e) { logger.warning(StringUtils.cat(": ", alias, e.getMessage())); return null; } return expandedPassword; }
/** * Returns a resolved value of this environment property */ public String getResolvedValue() { return RelativePathResolver.resolvePath(getValue()); }
public boolean isPasswordAlias(String alias) { // Check if the passed string is specified using the alias syntax String aliasName = RelativePathResolver.getAlias(alias); return (aliasName != null); }
public static String unresolvePath(String path, String[] propNames) { return getInstance().unresolve(path, propNames); }
public static String resolvePath(String path) { return getInstance().resolve(path); }
public static void main(String[] args) { if (args[0].equalsIgnoreCase("unresolve")) { for (int i = 2; i < args.length; i++) { String result = unresolvePath(args[i], new String[] {args[1]}); System.out.println(args[i] + " " + result + " " + resolvePath(result)); } } else { for (int i = 0; i < args.length; i++) { System.out.println(args[i] + " " + resolvePath(args[i])); } } } /** Returns the actual password from the domain-wide safe password store,
break; } else { // previous property not terminated missing } fatalError( "enterprise_util.path_resolver_missing_closing_delim", path); appendChar(c, propName, result); if (foundOne) { // we have found at least one occurrence of ${ if (propName != null) { propVal = getPropertyValue(propName.toString(), bIncludingEnvironmentVariables); if (propVal != null) { fatalError( "enterprise_util.path_resolver_missing_starting_delim", path); appendChar(c, propName, result); appendChar(c, propName, result); break; fatalError( "enterprise_util.path_resolver_missing_closing_delim", path);
UnrecoverableKeyException { try { if (at == null || RelativePathResolver.getAlias(at) == null) { return ( at ); return (at); final String an = RelativePathResolver.getAlias(at); final boolean exists = getDomainPasswordAliasStore().containsKey(an); if (!exists) { final StringManager lsm = StringManager.getManager(RelativePathResolver.class); throw new IllegalArgumentException(msg); final String real = new String(getDomainPasswordAliasStore().get(an)); return ( real );
propVal = getPropertyValue(propNames[i], true); if (propVal != null) { getLogger().log(Level.SEVERE, "enterprise_util.path_unresolver_missing_property", new Object[] {propNames[i], path});
private synchronized static RelativePathResolver getInstance() { if (_instance == null) { _instance = new RelativePathResolver(); } return _instance; }
propVal = getPropertyValue(propNames[i], true); if (propVal != null) {
public static void main(String[] args) { if (args[0].equalsIgnoreCase("unresolve")) { for (int i = 2; i < args.length; i++) { String result = unresolvePath(args[i], new String[] {args[1]}); System.out.println(args[i] + " " + result + " " + resolvePath(result)); } } else { for (int i = 0; i < args.length; i++) { System.out.println(args[i] + " " + resolvePath(args[i])); } } } /** Returns the actual password from the domain-wide safe password store,
break; } else { // previous property not terminated missing } fatalError(InternalLoggerInfo.referenceMissingTrailingDelim, path); return path; //can't happen since fatalError throws RuntimeException appendChar(c, propName, result); if (foundOne) { // we have found at least one occurrence of ${ if (propName != null) { propVal = getPropertyValue(propName.toString(), bIncludingEnvironmentVariables); if (propVal != null) { fatalError(InternalLoggerInfo.referenceMissingStartingDelim, path); return path; //can't happen since fatalError throws RuntimeException appendChar(c, propName, result); appendChar(c, propName, result); break; fatalError(InternalLoggerInfo.referenceMissingTrailingDelim, path); return path; //can't happen
public static String unresolvePath(String path, String[] propNames) { return getInstance().unresolve(path, propNames); }
public static String resolvePath(String path) { return getInstance().resolve(path); }
private synchronized static RelativePathResolver getInstance() { if (_instance == null) { _instance = new RelativePathResolver(); } return _instance; }
public String getValue() { String value = super.getValue(); if(confidential){ try { return RelativePathResolver.getRealPasswordFromAlias(value); } catch (Exception e) { _logger.log(Level.WARNING,"Unable to resolve alias value [ "+value+" ] " + "for connector config-property [ "+getName()+" ]", e); } } return value; } @Override
/** * Returns a resolved value of this environment property */ public String getResolvedValue() { return RelativePathResolver.resolvePath(getValue()); }
UnrecoverableKeyException { try { if (at == null || RelativePathResolver.getAlias(at) == null) { return ( at ); return (at); final String an = RelativePathResolver.getAlias(at); final PasswordAdapter pa = masterPasswordHelper.getMasterPasswordAdapter(); // use default password store final boolean exists = pa.aliasExists(an);
bindPWD = RelativePathResolver.getRealPasswordFromAlias(bindPWD); }catch(Exception ex) { _logger.log(Level.WARNING, "ldaprealm.pwd.dealiasing.failed",ex);