geonode.security.middleware
Attributes
Classes
Requires a user to be logged in to access any page that is not white-listed. |
|
Middleware that checks if session variables have been correctly set. |
|
Middleware that checks if admin is making requests from allowed IPs. |
Module Contents
- class geonode.security.middleware.LoginRequiredMiddleware(get_response)[source]
Bases:
django.utils.deprecation.MiddlewareMixinRequires a user to be logged in to access any page that is not white-listed.
This middleware simply checks user property of a request, to determine whether the query is authenticated or not, but since DRF assumes correlation between session authentication and presence of user property in the request, an additional check was introduced in the middleware, to allow Basic authenticated requests without additional middleware setting this property (otherwise, all DRF views configured with: authentication_classes = [SessionAuthentication,] would accept Basic authenticated requests (regardless of presence of BasicAuthentication in view’s authentication_classes).
- class geonode.security.middleware.LoginFromApiKeyMiddleware(get_response)[source]
Bases:
django.utils.deprecation.MiddlewareMixin