Skip to content

Commit

Permalink
Pre-commit hook runs bandit (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Apr 28, 2021
1 parent 860d9be commit 16e5ea8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and formatting
name: Pre-commit checks

on:
push:
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ repos:
- id: flake8
types:
- python
- repo: https://github.com/pycqa/bandit
rev: 1.7.0
hooks:
- id: bandit
args: ["-ll"]
exclude: ^server/
files: .py$
7 changes: 5 additions & 2 deletions benefits/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
_LANG = "lang"
_ORIGIN = "origin"
_START = "start"
_TOKEN = "token"
_TOKEN_EXP = "token_exp"
_UID = "uid"

# ignore bandit B105:hardcoded_password_string
# as these are not passwords, but keys for the session dict
_TOKEN = "token" # nosec
_TOKEN_EXP = "token_exp" # nosec


def agency(request):
"""Get the agency from the request's session, or None"""
Expand Down

0 comments on commit 16e5ea8

Please sign in to comment.