From 2d9f712ce551026f0d5f302aaa0e0b85aea8747c Mon Sep 17 00:00:00 2001 From: Ken Giusti Date: Fri, 2 Oct 2015 19:47:17 +0000 Subject: QPID-6767: add --sasl-service-name option to all QPID tools. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1706480 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/tools/src/py/qpid-config | 3 +++ qpid/tools/src/py/qpid-ha | 3 +++ qpid/tools/src/py/qpid-printevents | 3 +++ qpid/tools/src/py/qpid-queue-stats | 3 +++ qpid/tools/src/py/qpid-route | 3 +++ qpid/tools/src/py/qpid-stat | 3 +++ qpid/tools/src/py/qpid-tool | 3 +++ 7 files changed, 21 insertions(+) diff --git a/qpid/tools/src/py/qpid-config b/qpid/tools/src/py/qpid-config index 130f90a291..3d4bb6036a 100755 --- a/qpid/tools/src/py/qpid-config +++ b/qpid/tools/src/py/qpid-config @@ -206,6 +206,7 @@ def OptionsAndArguments(argv): group1.add_option("-b", "--broker", action="store", type="string", metavar="
", help="Address of qpidd broker with syntax: [username/password@] hostname | ip-address [:]") group1.add_option("-a", "--broker-addr", action="store", type="string", metavar="
") group1.add_option("--sasl-mechanism", action="store", type="string", metavar="", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.") + group1.add_option("--sasl-service-name", action="store", type="string", help="SASL service name to use") group1.add_option("--ssl-certificate", action="store", type="string", metavar="", help="Client SSL certificate (PEM Format)") group1.add_option("--ssl-key", action="store", type="string", metavar="", help="Client SSL private key (PEM Format)") group1.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.") @@ -350,6 +351,8 @@ def OptionsAndArguments(argv): if opts.sasl_mechanism: conn_options['sasl_mechanisms'] = opts.sasl_mechanism + if opts.sasl_service_name: + conn_options['sasl_service'] = opts.sasl_service_name if opts.ssl_certificate: conn_options['ssl_certfile'] = opts.ssl_certificate if opts.ssl_key: diff --git a/qpid/tools/src/py/qpid-ha b/qpid/tools/src/py/qpid-ha index 76d9abde79..1c07658d34 100755 --- a/qpid/tools/src/py/qpid-ha +++ b/qpid/tools/src/py/qpid-ha @@ -72,6 +72,7 @@ class Command(object): common.add_option("-b", "--broker", metavar="
", help="Address of qpidd broker with syntax: [username/password@] hostname | ip-address [:]"+help_default("broker")) common.add_option("--timeout", type="float", metavar="", help="Give up if the broker does not respond within the timeout. 0 means wait forever"+help_default("timeout")) common.add_option("--sasl-mechanism", metavar="", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override") + common.add_option("--sasl-service-name", action="store", type="string", help="SASL service name to use") common.add_option("--ssl-certificate", metavar="", help="Client SSL certificate (PEM Format)") common.add_option("--ssl-key", metavar="", help="Client SSL private key (PEM Format)") common.add_option("--config", metavar="", help="Read default connection configuration from the qpidd.conf broker configuration file. Defaults are overridden by command-line options.)") @@ -97,6 +98,8 @@ class Command(object): else: # Use DEFAULTS if not opts.timeout: opts.timeout = DEFAULTS["timeout"] if opts.sasl_mechanism: conn_options['sasl_mechanisms'] = opts.sasl_mechanism + if opts.sasl_service_name: + conn_options['sasl_service'] = opts.sasl_service_name if opts.ssl_certificate: conn_options['ssl_certfile'] = opts.ssl_certificate if opts.ssl_key: if not opts.ssl_certificate: diff --git a/qpid/tools/src/py/qpid-printevents b/qpid/tools/src/py/qpid-printevents index 1d123fd345..f702ca91e8 100755 --- a/qpid/tools/src/py/qpid-printevents +++ b/qpid/tools/src/py/qpid-printevents @@ -132,6 +132,7 @@ def main(argv=None): p = optparse.OptionParser(usage=_usage, description=_description, formatter=JHelpFormatter()) p.add_option("--heartbeats", action="store_true", default=False, help="Use heartbeats.") p.add_option("--sasl-mechanism", action="store", type="string", metavar="", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.") + p.add_option("--sasl-service-name", action="store", type="string", help="SASL service name to use") p.add_option("--ssl-certificate", action="store", type="string", metavar="", help="Client SSL certificate (PEM Format)") p.add_option("--ssl-key", action="store", type="string", metavar="", help="Client SSL private key (PEM Format)") p.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.") @@ -147,6 +148,8 @@ def main(argv=None): if options.sasl_mechanism: conn_options['sasl_mechanisms'] = options.sasl_mechanism + if options.sasl_service_name: + conn_options['sasl_service'] = options.sasl_service_name if options.ssl_certificate: conn_options['ssl_certfile'] = options.ssl_certificate if options.ssl_key: diff --git a/qpid/tools/src/py/qpid-queue-stats b/qpid/tools/src/py/qpid-queue-stats index 9d7d8d9bbf..ca78f9b602 100755 --- a/qpid/tools/src/py/qpid-queue-stats +++ b/qpid/tools/src/py/qpid-queue-stats @@ -126,6 +126,7 @@ def main(argv=None): p.add_option('--broker-address','-a', default='localhost' , help='broker-addr is in the form: [username/password@] hostname | ip-address [:] \n ex: localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost') p.add_option('--filter','-f' ,default=None ,help='a list of comma separated queue names (regex are accepted) to show') p.add_option("--sasl-mechanism", action="store", type="string", metavar="", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.") + p.add_option("--sasl-service-name", action="store", type="string", help="SASL service name to use") p.add_option("--ssl-certificate", action="store", type="string", metavar="", help="Client SSL certificate (PEM Format)") p.add_option("--ssl-key", action="store", type="string", metavar="", help="Client SSL private key (PEM Format)") @@ -134,6 +135,8 @@ def main(argv=None): conn_options = {} if options.sasl_mechanism: conn_options['mechanisms'] = options.sasl_mechanism + if options.sasl_service_name: + conn_options['service'] = options.sasl_service_name if options.ssl_certificate: conn_options['ssl_certfile'] = options.ssl_certificate if options.ssl_key: diff --git a/qpid/tools/src/py/qpid-route b/qpid/tools/src/py/qpid-route index c0f36ae4b7..f51d2493e9 100755 --- a/qpid/tools/src/py/qpid-route +++ b/qpid/tools/src/py/qpid-route @@ -99,6 +99,7 @@ def OptionsAndArguments(argv): parser.add_option("-t", "--transport", action="store", type="string", default="tcp", metavar="", help="Transport to use for links, defaults to tcp") parser.add_option("--client-sasl-mechanism", action="store", type="string", metavar="", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). Used when the client connects to the destination broker (not for authentication between the source and destination brokers - that is specified using the [mechanisms] argument to 'add route'). SASL automatically picks the most secure available mechanism - use this option to override.") + parser.add_option("--sasl-service-name", action="store", type="string", help="SASL service name to use") parser.add_option("--ssl-certificate", action="store", type="string", metavar="", help="Client SSL certificate (PEM Format)") parser.add_option("--ssl-key", action="store", type="string", metavar="", help="Client SSL private key (PEM Format)") parser.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.") @@ -143,6 +144,8 @@ def OptionsAndArguments(argv): if opts.client_sasl_mechanism: config._conn_options['mechanisms'] = opts.client_sasl_mechanism + if opts.sasl_service_name: + config._conn_options['service'] = opts.sasl_service_name if opts.ssl_certificate: config._conn_options['ssl_certfile'] = opts.ssl_certificate diff --git a/qpid/tools/src/py/qpid-stat b/qpid/tools/src/py/qpid-stat index ecbfddf5fb..1780c4a819 100755 --- a/qpid/tools/src/py/qpid-stat +++ b/qpid/tools/src/py/qpid-stat @@ -70,6 +70,7 @@ def OptionsAndArguments(argv): help="Maximum time to wait for broker connection (in seconds)") group1.add_option("--sasl-mechanism", action="store", type="string", metavar="", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.") + group1.add_option("--sasl-service-name", action="store", type="string", help="SASL service name to use") group1.add_option("--ssl-certificate", action="store", type="string", metavar="", help="Client SSL certificate (PEM Format)") group1.add_option("--ssl-key", action="store", type="string", metavar="", help="Client SSL private key (PEM Format)") group1.add_option("--ha-admin", action="store_true", help="Allow connection to a HA backup broker.") @@ -105,6 +106,8 @@ def OptionsAndArguments(argv): if opts.sasl_mechanism: conn_options['sasl_mechanisms'] = opts.sasl_mechanism + if opts.sasl_service_name: + conn_options['sasl_service'] = opts.sasl_service_name if opts.ssl_certificate: conn_options['ssl_certfile'] = opts.ssl_certificate if opts.ssl_key: diff --git a/qpid/tools/src/py/qpid-tool b/qpid/tools/src/py/qpid-tool index b4c01677c3..09ca2b8c13 100755 --- a/qpid/tools/src/py/qpid-tool +++ b/qpid/tools/src/py/qpid-tool @@ -717,6 +717,7 @@ def parse_options( argv ): parser = optparse.OptionParser(usage=_usage) parser.add_option("-b", "--broker", action="store", type="string", metavar="
", help="Address of qpidd broker with syntax: [username/password@] hostname | ip-address [:]") parser.add_option("--sasl-mechanism", action="store", type="string", metavar="", help="SASL mechanism for authentication (e.g. EXTERNAL, ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL automatically picks the most secure available mechanism - use this option to override.") + parser.add_option("--sasl-service-name", action="store", type="string", help="SASL service name to use") parser.add_option("--ssl-certificate", action="store", type="string", metavar="", help="SSL certificate for client authentication") @@ -743,6 +744,8 @@ def parse_options( argv ): conn_options['ssl_keyfile'] = opts.ssl_key if opts.sasl_mechanism: conn_options['mechanisms'] = opts.sasl_mechanism + if opts.sasl_service_name: + conn_options['service'] = opts.sasl_service_name return broker_option, conn_options, args[1:] #========================================================= -- cgit v1.2.1