Ejemplo n.º 1
0
 def __init__(self):
     BaseBackend.__init__(self, models.Key)
     self.config = Config()
     self.encryption = Encryption(self.config["blacklist.keystore.psk"])
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
 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"])