Class: SensitiveDataConfigType

Inherits:
Object
  • Object
show all
Defined in:
lib/AuthenticationSDK/logging/sensitive_logging.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSensitiveDataConfigType

Returns a new instance of SensitiveDataConfigType.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/AuthenticationSDK/logging/sensitive_logging.rb', line 16

def initialize
@sensitiveTags = Array.new([
        SensitiveTag.new("securityCode", "[0-9]{3,4}", "XXX", false),
        SensitiveTag.new("number", "(\\s*\\p{N}\\s*)+(\\p{N}{4})(\\s*)", "XXXX-\\2", false),
        SensitiveTag.new("cardNumber", "(\\s*\\p{N}\\s*)+(\\p{N}{4})(\\s*)", "XXXX-\\2", false),
        SensitiveTag.new("expirationMonth", "[0-1][0-9]", "XXXX", false),
        SensitiveTag.new("expirationYear", "2[0-9][0-9][0-9]", "XXXX", false),
        SensitiveTag.new("account", "(\\s*\\p{N}\\s*)+(\\p{N}{4})(\\s*)", "XXXX-\\2", false),
        SensitiveTag.new("routingNumber", "[0-9]+", "XXXXX", false),
        SensitiveTag.new("email", "[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", "XXXXX", false),
        SensitiveTag.new("firstName", "([a-zA-Z]+( )?[a-zA-Z]*'?-?[a-zA-Z]*( )?([a-zA-Z]*)?)", "xxxxx", false),
        SensitiveTag.new("lastName", "([a-zA-Z]+( )?[a-zA-Z]*'?-?[a-zA-Z]*( )?([a-zA-Z]*)?)", "xxxxx", false),
        SensitiveTag.new("phoneNumber", "(\\+[0-9]{1,2} )?\\(?[0-9]{3}\\)?[ .-]?[0-9]{3}[ .-]?[0-9]{4}", "xxxxx", false),
        SensitiveTag.new("type", "[-A-Za-z0-9 ]+", "xxxxx", false),
        SensitiveTag.new("token", "[-.A-Za-z0-9 ]+", "xxxxx", false),
        SensitiveTag.new("signature", "[-.A-Za-z0-9 ]+", "xxxxx", false),
        SensitiveTag.new("prefix", "(\\p{N}{6})(\\p{N}*)", "\\2-XXXXX", false),
        SensitiveTag.new("prefix", "(\\s*)(\\p{N}{4})(\\s*)(\\p{N}{2})(\\s*\\p{N}*\\s*)", "\\2-XXXX", false),
        SensitiveTag.new("bin", "(\\s*)(\\p{N}{4})(\\s*)(\\p{N}{2})(\\s*\\p{N}*\\s*)", "\\2-XXXX", false)
    ]).freeze

@sensitiveStringRegexes = [
        "4\\p{N}{3}([\\ \\-]?)\\p{N}{4}\\1\\p{N}{4}\\1\\p{N}{4}",
        "4\\p{N}{3}([\\ \\-]?)(?:\\p{N}{4}\\1){2}\\p{N}(?:\\p{N}{3})?",
        "5[1-5]\\p{N}{2}([\\ \\-]?)\\p{N}{4}\\1\\p{N}{4}\\1\\p{N}{4}",
        "6(?:011|22(?:1(?=[\\ \\-]?(?:2[6-9]|[3-9]))|[2-8]|9(?=[\\ \\-]?(?:[01]|2[0-5])))|4[4-9]\\p{N}|5\\p{N}\\p{N})([\\ \\-]?)\\p{N}{4}\\1\\p{N}{4}\\1\\p{N}{4}",
        "35(?:2[89]|[3-8]\\p{N})([\\ \\-]?)\\p{N}{4}\\1\\p{N}{4}\\1\\p{N}{4}",
        "3[47]\\p{N}\\p{N}([\\ \\-]?)\\p{N}{6}\\1\\p{N}{5}"
    ].freeze
end

Instance Attribute Details

#sensitiveStringRegexesObject

Returns the value of attribute sensitiveStringRegexes.



14
15
16
# File 'lib/AuthenticationSDK/logging/sensitive_logging.rb', line 14

def sensitiveStringRegexes
  @sensitiveStringRegexes
end

#sensitiveTagsObject

Returns the value of attribute sensitiveTags.



14
15
16
# File 'lib/AuthenticationSDK/logging/sensitive_logging.rb', line 14

def sensitiveTags
  @sensitiveTags
end