"""
raven.core.processors
~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""

class Processor(object):
    def __init__(self, client):
        self.client = client

    def process(self, data, **kwargs):
        resp = self.get_data(data)
        if resp:
            data = resp
        return data

class SantizePasswordsProcessor(Processor):
    """
    Asterisk out passwords from password fields in frames.
    """
    def process(self, data, **kwargs):
        if 'sentry.interfaces.Stacktrace' in data:
            if 'frames' in data['sentry.interfaces.Stacktrace']:
                for frame in data['sentry.interfaces.Stacktrace']['frames']:
                    if 'vars' in frame:
                        for k, v in frame['vars'].iteritems():
                            if 'password' in k or 'secret' in k:
                                # store mask as a fixed length for security
                                frame['vars'][k] = '*'*16
        return data
@@ -163,16 +163,17 @@
 s.%0A%22%22%22%0A%0A
+%0A
 class Pr
@@ -387,16 +387,17 @@
 n data%0A%0A
+%0A
 class Sa
@@ -842,16 +842,64 @@
 tems():%0A
+                            lower_k = k.lower()%0A
         
@@ -935,16 +935,22 @@
 ord' in 
+lower_
 k or 'se
@@ -958,16 +958,22 @@
 ret' in 
+lower_
 k:%0A     
@@ -1097,17 +1097,19 @@
 k%5D = '*'
-*
+ * 
 16%0A     
@@ -1102,28 +1102,29 @@
 '*' * 16%0A        return data
+%0A

Handle var names that are uppercase