
class Processor(object):
    def process(self, data):
        resp = self.get_data(data)
        if resp:
            data['extra'].update(resp)
        return data
    
    def get_data(self, data):
        return {}

from pprint import pprint
def sanitize_passwords_processor(data):
    """ Asterisk out passwords from password fields in frames.
    """
    if 'sentry.interfaces.Exception' in data:
        if 'frames' in data['sentry.interfaces.Exception']:
            for frame in data['sentry.interfaces.Exception']['frames']:
                if 'vars' in frame:
                    print frame['vars']
                    for k,v in frame['vars'].iteritems():
                        if k.startswith('password'):
                            frame['vars'][k] = '*'*len(v)
    return data

#class SantizePasswordsProcessor(Processor):


class Processor(object):
    def process(self, data):
        resp = self.get_data(data)
        if resp:
            data['extra'].update(resp)
        return data
    
    def get_data(self, data):
        return {}

def sanitize_passwords_processor(data):
    """ Asterisk out passwords from password fields in frames.
    """
    if 'sentry.interfaces.Exception' in data:
        if 'frames' in data['sentry.interfaces.Exception']:
            for frame in data['sentry.interfaces.Exception']['frames']:
                if 'vars' in frame:
                    for k,v in frame['vars'].iteritems():
                        if k.startswith('password'):
                            # store mask as a fixed length for security
                            frame['vars'][k] = '*'*16
    return data

#class SantizePasswordsProcessor(Processor):

Remove print statement and change mask to use a fixed length
Remove print statement and change mask to use a fixed length

  
  class Processor(object):
      def process(self, data):
          resp = self.get_data(data)
          if resp:
              data['extra'].update(resp)
          return data
      
      def get_data(self, data):
          return {}
  
- from pprint import pprint
  def sanitize_passwords_processor(data):
      """ Asterisk out passwords from password fields in frames.
      """
      if 'sentry.interfaces.Exception' in data:
          if 'frames' in data['sentry.interfaces.Exception']:
              for frame in data['sentry.interfaces.Exception']['frames']:
                  if 'vars' in frame:
-                     print frame['vars']
                      for k,v in frame['vars'].iteritems():
                          if k.startswith('password'):
+                             # store mask as a fixed length for security
-                             frame['vars'][k] = '*'*len(v)
+                             frame['vars'][k] = '*'*16
      return data
  
  #class SantizePasswordsProcessor(Processor):
  
Remove print statement and change mask to use a fixed length
## Code Before:

class Processor(object):
    def process(self, data):
        resp = self.get_data(data)
        if resp:
            data['extra'].update(resp)
        return data
    
    def get_data(self, data):
        return {}

from pprint import pprint
def sanitize_passwords_processor(data):
    """ Asterisk out passwords from password fields in frames.
    """
    if 'sentry.interfaces.Exception' in data:
        if 'frames' in data['sentry.interfaces.Exception']:
            for frame in data['sentry.interfaces.Exception']['frames']:
                if 'vars' in frame:
                    print frame['vars']
                    for k,v in frame['vars'].iteritems():
                        if k.startswith('password'):
                            frame['vars'][k] = '*'*len(v)
    return data

#class SantizePasswordsProcessor(Processor):

## Instruction:
Remove print statement and change mask to use a fixed length
## Code After:

class Processor(object):
    def process(self, data):
        resp = self.get_data(data)
        if resp:
            data['extra'].update(resp)
        return data
    
    def get_data(self, data):
        return {}

def sanitize_passwords_processor(data):
    """ Asterisk out passwords from password fields in frames.
    """
    if 'sentry.interfaces.Exception' in data:
        if 'frames' in data['sentry.interfaces.Exception']:
            for frame in data['sentry.interfaces.Exception']['frames']:
                if 'vars' in frame:
                    for k,v in frame['vars'].iteritems():
                        if k.startswith('password'):
                            # store mask as a fixed length for security
                            frame['vars'][k] = '*'*16
    return data

#class SantizePasswordsProcessor(Processor):
