Esempio n. 1
0
def entrypoint(app_context: PluginAppContext):
    """
    Register plugin hook handler.

    This will be called on app load.
    """
    app_context.register_hook_handler(DrakvufHookHandler)
Esempio n. 2
0
# Quick query endpoints
api.add_resource(QuickQueryResource, "/<any(file, config, blob, object):type>/quick_query")
api.add_resource(QuickQueryItemResource, "/quick_query/<int:id>")

# Metakey endpoints
api.add_resource(MetakeyListDefinitionResource, '/meta/list/<any(read, set):access>')
api.add_resource(MetakeyResource, '/<any(file, config, blob, object):type>/<hash64:identifier>/meta')
api.add_resource(MetakeyListDefinitionManageResource, '/meta/manage')
api.add_resource(MetakeyDefinitionManageResource, '/meta/manage/<key>')
api.add_resource(MetakeyPermissionResource, '/meta/manage/<key>/permissions/<group_name>')

# User endpoints
api.add_resource(UserListResource, "/user")
api.add_resource(UserResource, "/user/<login>")
api.add_resource(UserProfileResource, "/profile/<login>")
api.add_resource(UserGetPasswordChangeTokenResource, "/user/<login>/change_password")
api.add_resource(UserPendingResource, "/user/<login>/pending")

# Group endpoints
api.add_resource(GroupListResource, "/group")
api.add_resource(GroupResource, "/group/<name>")
api.add_resource(GroupMemberResource, '/group/<name>/member/<login>')

setup_logger()

# Load plugins
plugin_context = PluginAppContext()
with app.app_context():
    load_plugins(plugin_context)
Esempio n. 3
0
def entrypoint(app_context: PluginAppContext):
    app_context.register_resource(KartonAnalysisResource,
                                  "/karton/<hash64:identifier>")
    app_context.register_hook_handler(KartonDispatcher)
def entrypoint(app_context: PluginAppContext):
    logger.info("plugin started!")
    app_context.register_hook_handler(VTHookHandler)