Skip to content

Static code analysis for python APIs. (Flake8 extension)

Notifications You must be signed in to change notification settings

lgo/flake8-webcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flake8-webcheck

A flake8 extension to do static analysis on projects. This package has been tested against flake8 3.0.4 and python 3.5.2

Currently the functionality being built out is to check for the presence of decorators. A use case is outlined below:

Decorator presence check

Given a set of API RequestHandler classes, from Tornado, check if each request function has a permission level set by a decorator. Doing this check ensures that changes always explicitly define a permission to make sure no security slips are created, causing open APIs.

import torando.web

class MyAPIRequestHandler(torando.web.RequestHandler):

  @permission.anonymous # OK, permission is defined
  def get(self):
      ...

  @permission.event.organizer # OK, permission is defined
  def put(self):
    ...


  def post(self): # Error, no permission defined for endpoint
    ...

About

Static code analysis for python APIs. (Flake8 extension)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages