com.atlassian.bamboo.util
Class PasswordMaskingUtils

java.lang.Object
  extended by com.atlassian.bamboo.util.PasswordMaskingUtils

public class PasswordMaskingUtils
extends java.lang.Object


Field Summary
static java.lang.String PASSWORD_FIELD_NAME
           
static java.lang.String PASSWORD_MASK
           
static com.google.common.base.Predicate<VariableDefinitionContext> SHOULD_VARIABLE_BE_MASKED
           
 
Method Summary
static java.lang.Iterable<java.lang.String> findPossiblePasswordValues(java.util.Collection<VariableDefinitionContext> variables)
           
static boolean isMasked(java.lang.String value)
           
static java.lang.String mask(java.lang.String string, java.lang.String password)
          Mask a password portion of a larger string.
static
<T extends VariableDefinitionContext>
java.util.Collection<? extends T>
maskPasswordValues(java.util.List<T> variables, com.google.common.base.Function<T,? extends T> clone)
           
static java.lang.String maskPossiblePasswordValues(java.lang.String text, java.util.Collection<VariableDefinitionContext> variables)
           
static boolean shouldBeMasked(java.lang.String variableName)
           
static boolean shouldBeMasked(VariableDefinition variableDefinition)
           
static boolean shouldBeMasked(VariableDefinitionContext variableDefinition)
           
static boolean shouldBeMasked(VariableSubstitutionContext variableSubstitutionContext)
           
static boolean shouldIgnoreValue(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PASSWORD_MASK

public static final java.lang.String PASSWORD_MASK
See Also:
Constant Field Values

PASSWORD_FIELD_NAME

public static final java.lang.String PASSWORD_FIELD_NAME
See Also:
Constant Field Values

SHOULD_VARIABLE_BE_MASKED

public static com.google.common.base.Predicate<VariableDefinitionContext> SHOULD_VARIABLE_BE_MASKED
Method Detail

isMasked

public static boolean isMasked(@Nullable
                               java.lang.String value)

shouldBeMasked

public static boolean shouldBeMasked(@Nullable
                                     java.lang.String variableName)

shouldBeMasked

public static boolean shouldBeMasked(@NotNull
                                     VariableDefinition variableDefinition)

shouldBeMasked

public static boolean shouldBeMasked(@NotNull
                                     VariableDefinitionContext variableDefinition)

shouldBeMasked

public static boolean shouldBeMasked(@NotNull
                                     VariableSubstitutionContext variableSubstitutionContext)

shouldIgnoreValue

public static boolean shouldIgnoreValue(java.lang.String key,
                                        java.lang.String value)

maskPasswordValues

public static <T extends VariableDefinitionContext> java.util.Collection<? extends T> maskPasswordValues(@NotNull
                                                                                                         java.util.List<T> variables,
                                                                                                         @NotNull
                                                                                                         com.google.common.base.Function<T,? extends T> clone)

mask

public static java.lang.String mask(@NotNull
                                    java.lang.String string,
                                    @Nullable
                                    java.lang.String password)
Mask a password portion of a larger string. e.g. passwords in git urls.

Parameters:
string - to find and replace the password in
password - to find in the given string
Returns:
string with the password replaced with a mask

findPossiblePasswordValues

public static java.lang.Iterable<java.lang.String> findPossiblePasswordValues(java.util.Collection<VariableDefinitionContext> variables)

maskPossiblePasswordValues

public static java.lang.String maskPossiblePasswordValues(java.lang.String text,
                                                          java.util.Collection<VariableDefinitionContext> variables)


Copyright © 2014 Atlassian Software Systems Pty Ltd. All Rights Reserved.