'Plugin entry point, test existence of HTML auto-completable forms
containing password-type inputs. Either form\'s <autocomplete> attribute
is not present or is \'off\'.
:param request: The HTTP request object.
:param response: The HTTP response object
:return: None, all results are saved in the kb.'

def grep(self, request, response):

    if (not response.is_text_or_html()):
        return
    try:
        doc_parser = parser_cache.dpc.get_document_parser_for(response)
    except BaseFrameworkException:
        return
    for form in doc_parser.get_forms():
        if (form.get_autocomplete() is False):
            continue
        for form_field_list in form.meta.itervalues():
            for form_field in form_field_list:
                if (form_field.input_type != INPUT_TYPE_PASSWD):
                    continue
                if (not form_field.autocomplete):
                    continue
                url = response.get_url()
                desc = 'The    URL:    "%s"    has    a    "<form>"    element    with    auto-complete    enabled.'
                desc %= url
                i = Info('Auto-completable    form', desc, response.id, self.get_name())
                i.add_to_highlight('autocomplete')
                i.set_url(url)
                i[AutoCompleteInfoSet.ITAG] = form.get_action().uri2url()
                self.kb_append_uniq_group(self, 'form_autocomplete', i, group_klass=AutoCompleteInfoSet)
                break
