Пример #1
0
    def config_path(self, path: str):
        """
        Set the SASL configuration path. This is used to tell SASL where
        to look for the configuration file. In the current implementation
        it can be a colon separated list of directories.

        The environment variable ``PN_SASL_CONFIG_PATH`` can also be used
        to set this path, but if both methods are used then this
        :meth:`config_path` will take precedence.

        If not set, the underlying implementation default will be used.

        :param path: The configuration path, may contain colon-separated list
                     if more than one path is specified.
        """
        pn_sasl_config_path(self._sasl, path)
Пример #2
0
 def config_path(self, path):
     pn_sasl_config_path(self._sasl, path)
Пример #3
0
            if self.listener:
                self.listener.close()
            else:
                sys.exit(0)
        else:
            event.reactor.schedule(self.tmo, self)


parser = optparse.OptionParser(usage="usage: %prog [options]",
                               description="test authentication and authorization service")
parser.add_option("-a", "--address", default="localhost:55671",
                  help="address to listen on (default %default)")
parser.add_option("-c", "--config", help="sasl config path")
opts, args = parser.parse_args()

print('starting')
if opts.config:
    pn_sasl_config_path(None, opts.config)
    print('set sasl config path to %s' % opts.config)

handler = AuthService(opts.address)


def sigterm_handler(_signo, _stack_frame):
    handler.stop()


signal.signal(signal.SIGTERM, sigterm_handler)

Container(handler).run()
Пример #4
0
 def config_path(self, path):
     pn_sasl_config_path(self._sasl, path)