Beispiel #1
0
def server():
    config = get_config_for_tests(DOMAIN)
    server = TAXIIServer(config)

    server.persistence.create_services_from_object(SERVICES)

    return server
Beispiel #2
0
def client():
    config = get_config_for_tests('some.com')

    server = TAXIIServer(config)

    app = create_app(server)
    app.config['TESTING'] = True

    return app.test_client()
Beispiel #3
0
def client():

    config = get_config_for_tests('some.com')

    server = TAXIIServer(config)
    server.persistence.create_services_from_object(SERVICES)

    app = create_app(server)
    app.config['TESTING'] = True

    return app.test_client()
def server():

    config = get_config_for_tests(DOMAIN)
    server = TAXIIServer(config)

    server.persistence.create_services_from_object(SERVICES)

    for coll in COLLECTIONS_B:
        coll = server.persistence.create_collection(coll)
        server.persistence.attach_collection_to_services(coll.id, service_ids=ASSIGNED_SERVICES)

    return server
Beispiel #5
0
def create_account():

    parser = get_parser()
    parser.add_argument("-u", "--username", dest="username", help="Username for the new account", required=True)
    parser.add_argument("-p", "--password", dest="password", help="Password for the new account", required=True)

    args = parser.parse_args()

    server = TAXIIServer(config)
    token = server.auth.create_account(args.username, args.password)

    log.info("Account created", token=token)
Beispiel #6
0
def server():

    config = get_config_for_tests(DOMAIN)
    server = TAXIIServer(config)

    server.persistence.create_services_from_object(SERVICES)

    services = ['poll-A', 'collection-management-A']

    for coll in COLLECTIONS_B:
        coll = server.persistence.create_collection(coll)
        server.persistence.attach_collection_to_services(coll.id, service_ids=services)

    return server
Beispiel #7
0
def server():

    config = get_config_for_tests(DOMAIN)
    server = TAXIIServer(config)

    server.persistence.create_services_from_object(SERVICES)

    coll_mapping = {
        'inbox-A' : COLLECTIONS_A,
        'inbox-B' : COLLECTIONS_B
    }
    for service, collections in coll_mapping.items():
        for coll in collections:
            coll = server.persistence.create_collection(coll)
            server.persistence.attach_collection_to_services(coll.id,
                    service_ids=[service])
    
    return server
Beispiel #8
0
def app():
    context.server = TAXIIServer(prepare_test_config())
    app = create_app(context.server)
    app.config['TESTING'] = True
    return app
Beispiel #9
0
from opentaxii.server import TAXIIServer
from opentaxii.config import ServerConfig
from opentaxii.middleware import create_app
from opentaxii.utils import configure_logging

config = ServerConfig()
configure_logging(config['logging'], plain=True)

server = TAXIIServer(config)

app = create_app(server)
app.debug = True
Beispiel #10
0
def server(config):
    return TAXIIServer(config)