def __init__(self): BaseBackend.__init__(self, models.Key) self.config = Config() self.encryption = Encryption(self.config["blacklist.keystore.psk"])
from django.contrib.auth import authenticate from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from blacklist.common.api import API from blacklist.common.config import Config from blacklist.common.encryption import Encryption import datetime import random import time config = Config() api = API() enc = Encryption(config["blacklist.api.psk"]) def dispatch(request, data): response = { "result": False, "data": None, "random": random.random() * time.mktime(datetime.datetime.timetuple(datetime.datetime.now())) } try: data = enc.decrypt(data)
def __init__(self): BaseBackend.__init__(self, models.Peering) self.config = Config() self.encryption = Encryption(self.config["blacklist.keystore.psk"]) self.ipcalc = IPCalc() self.netdata = NetData()
def __init__(self): self.config = Config() self.context = zmq.Context() self.broker = self.context.socket(zmq.REQ) self.broker.connect(self.config["blacklist.broker"]) self.encryption = Encryption(self.config["blacklist.api.psk"])