Ejemplo n.º 1
0
def store_cache(request):
    key = request.data.get("key", "unknown")
    data = request.data.get("value")
    if request.data.get("append"):
        if isinstance(data, dict):
            cached = load(key) or {}
            cached[data.get("name", "unknown")] = data.get("content")
            data = cached
    name = store(key, data, id_generator=str)
    return Response(name)
Ejemplo n.º 2
0
def store_cache(request):
    key = request.data.get("key", "unknown")
    data = request.data.get('value')
    if request.data.get('append'):
        if isinstance(data, dict):
            cached = load(key) or {}
            cached[data.get('name', 'unknown')] = data.get('content')
            data = cached
    name = store(key, data, id_generator=str)
    return Response(name)
Ejemplo n.º 3
0
def transform(request):
    name = store(
        "scanreport",
        dataclasses.asdict(scanreport.gvmd.transform(request.data)),
    )
    return Response(name)