view sat_pubsub.tac @ 349:20b82fb8de02

backend: check nodes/items permission on disco#items: - move node access check workflow from getItemsData to a new checkNodeAccess method - only accessible items are returned to an entity when doing a disco#items on a node - for PEP, nodes with presence access model are not returned if entity has not presence subscription from the node owner - all nodes are returned in normal pubsub service - new NotLeafNodeError exception when an action need to be done on Leaf node and it is not the case - /!\ access it not fully checked : items access models are not handled for items id in disco#items, and whitelist nodes are returned regardless if requestor is in the white list or not. Furthermore, publisher-roster access is not handled for nodes.
author Goffi <goffi@goffi.org>
date Sun, 27 Aug 2017 20:33:39 +0200
parents 51af2ed8bd50
children
line wrap: on
line source

#!/usr/bin/python
#-*- coding: utf-8 -*-
# Copyright (c) 2003-2008 Ralph Meijer
# See LICENSE for details.

"""
Example TAC for SàT Pubsub.
"""

from twisted.application import service
from twisted.words.protocols.jabber.jid import JID

from sat_pubsub import tap

application = service.Application("sat_pubsub")

config = {
    'jid': JID('sat-pubsub.necton3.int'),
    'secret': 'pass',
    'rhost': '127.0.0.1',
    'rport': 5347,
    'backend': 'pgsql',
    'dbuser': 'goffi',
    'dbpass': 'toto',
    'dbname': "pubsub",
    'dbhost': "localhost",
    'dbport': None,
    'verbose': True,
    'hide-nodes': False,
}

idavollService = tap.makeService(config)
idavollService.setServiceParent(application)

# Set the maximum delay until trying to reconnect.
componentService = idavollService.getServiceNamed('component')
componentService.factory.maxdelay = 300