Skip to content

Commit

Permalink
JWT, better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
troeger committed Aug 18, 2020
1 parent 000c988 commit b9ac37b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 10 additions & 1 deletion kubeportal/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ class Common(Configuration):

REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
'dj_rest_auth.jwt_auth.JWTCookieAuthentication',
],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
]
}

REST_USE_JWT = True
JWT_AUTH_COOKIE = 'kubeportal-auth'


WSGI_APPLICATION = 'kubeportal.wsgi.application'

AUTH_PASSWORD_VALIDATORS = [
Expand Down Expand Up @@ -195,6 +199,11 @@ class Development(Common):
'level': 'DEBUG',
'propagate': True
},
'django': {
'handlers': ['console', ],
'level': 'WARNING',
'propagate': True
},
}
}

Expand Down
4 changes: 2 additions & 2 deletions kubeportal/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from kubeportal import models, kubernetes

logging.getLogger('KubePortal').setLevel(logging.DEBUG)
logging.getLogger('django.request').setLevel(logging.DEBUG)
logging.getLogger('social').setLevel(logging.DEBUG)
logging.getLogger('django.request').setLevel(logging.WARNING)
logging.getLogger('django').setLevel(logging.WARNING)

admin_clear_password = 'adminäö&%/1`'

Expand Down
3 changes: 2 additions & 1 deletion requirements-prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ python-jose==3.1.0
django-cors-middleware==1.3.1
django-sortedm2m-filter-horizontal-widget==1.3.2
django-multi-email-field==0.6.1
dj-rest-auth[with_social]==1.1.1
dj-rest-auth[with_social]==1.1.1
djangorestframework-simplejwt==4.4.0

0 comments on commit b9ac37b

Please sign in to comment.