Modify: disable basic auth in API add protection to storage info endpoint
This commit is contained in:
		
							parent
							
								
									bfe13039a3
								
							
						
					
					
						commit
						305001c9ab
					
				| @ -163,6 +163,9 @@ class TicketViewSet(viewsets.ModelViewSet): | |||||||
| 
 | 
 | ||||||
| class StorageInfo(views.APIView): | class StorageInfo(views.APIView): | ||||||
|     """Info about storage total/used/free space""" |     """Info about storage total/used/free space""" | ||||||
|  | 
 | ||||||
|  |     permission_classes = (IsAuthenticated, ) | ||||||
|  | 
 | ||||||
|     @extend_schema( |     @extend_schema( | ||||||
|         responses=StorageInfoSerializer, |         responses=StorageInfoSerializer, | ||||||
|         summary='Show storage space in bytes' |         summary='Show storage space in bytes' | ||||||
|  | |||||||
| @ -178,7 +178,7 @@ REST_FRAMEWORK = { | |||||||
|     'DEFAULT_AUTHENTICATION_CLASSES': [ |     'DEFAULT_AUTHENTICATION_CLASSES': [ | ||||||
|         'rest_framework_simplejwt.authentication.JWTAuthentication', |         'rest_framework_simplejwt.authentication.JWTAuthentication', | ||||||
|         'rest_framework.authentication.SessionAuthentication', |         'rest_framework.authentication.SessionAuthentication', | ||||||
|         'rest_framework.authentication.BasicAuthentication' |         # 'rest_framework.authentication.BasicAuthentication' | ||||||
|     ], |     ], | ||||||
|     'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend', ],  # noqa:E501 |     'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend', ],  # noqa:E501 | ||||||
|     'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', |     'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user