Package trac :: Package util :: Module html :: Class FormTokenInjector

Class FormTokenInjector

source code

markupbase.ParserBase --+        
                        |        
    HTMLParser.HTMLParser --+    
                            |    
                HTMLTransform --+
                                |
                               FormTokenInjector

Identify and protect forms from CSRF attacks.

This filter works by adding a input type=hidden field to POST forms.

Instance Methods
 
__init__(self, form_token, out)
Initialize and reset this instance.
source code
 
handle_starttag(self, tag, attrs) source code

Inherited from HTMLTransform: handle_charref, handle_comment, handle_data, handle_decl, handle_endtag, handle_entityref, handle_pi, handle_startendtag, unescape

Inherited from HTMLParser.HTMLParser: check_for_whole_start_tag, clear_cdata_mode, close, error, feed, get_starttag_text, goahead, parse_bogus_comment, parse_endtag, parse_html_declaration, parse_pi, parse_starttag, reset, set_cdata_mode, unknown_decl

Inherited from markupbase.ParserBase: getpos, parse_comment, parse_declaration, parse_marked_section, updatepos

Class Variables

Inherited from HTMLParser.HTMLParser: CDATA_CONTENT_ELEMENTS, entitydefs

Method Details

__init__(self, form_token, out)
(Constructor)

source code 
Initialize and reset this instance.
Overrides: markupbase.ParserBase.__init__

handle_starttag(self, tag, attrs)

source code 
Overrides: HTMLParser.HTMLParser.handle_starttag