This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
import sys | |
import os | |
class user_regs_struct(ctypes.Structure): | |
_fields_ = [ | |
("r15", ctypes.c_ulonglong), | |
("r14", ctypes.c_ulonglong), | |
("r13", ctypes.c_ulonglong), | |
("r12", ctypes.c_ulonglong), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Combine the RemoteUser Authentication and the django-auth-ldap | |
to populate Users in Django | |
https://docs.djangoproject.com/en/2.1/howto/auth-remote-user/ | |
https://django-auth-ldap.readthedocs.io/en/latest/ | |
""" | |
import logging | |
from django.contrib.auth import load_backend, login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Django REST Framework Permission Class for Django Rules | |
""" | |
from rest_framework import permissions, exceptions | |
from rest_framework.viewsets import ModelViewSet | |
from django.http import Http404 | |
class DjangoRulesMethodObjectPermissions(permissions.BasePermission): | |
""" |