mneethiraj commented on code in PR #1143: URL: https://github.com/apache/ranger/pull/1143#discussion_r3752087480
########## ranger-tools/src/main/python/stress/stress_kms.py: ########## @@ -29,21 +29,37 @@ # This script requires Python package apache_ranger to be present. # The package can be installed using following command: # pip3 install --upgrade apache_ranger -# +# If KMS is running with Kerberos, then 'requests-kerberos' package is required and can be installed using following command: +# pip3 install requests-kerberos ## ## This script calls KMS APIs from multiple-threads ## ## parameters: ## kms_url: URL to Apache Ranger admin server -## kms_auth: authentication to connect to Apache Ranger admin server +## kms_auth_type: authentication mode used to connect to Ranger KMS +## 'simple' - Hadoop simple auth; identity is taken +## from `kms_user`. +## 'kerberos' - SPNEGO/Kerberos auth; identity is taken +## from the caller's Kerberos ticket cache +## (run `kinit` before starting the script). +## Requires the `requests-kerberos` package. +## kms_user: user name to pass when kms_auth_type == 'simple'. +## Ignored in kerberos mode. ## key_count number of keys to create ## rollover_key_count: number of times each key to be rolled over ## encrypted_key_count: number of encrypted keys to generate per key ## thread_count: number of threads to call Apache Ranger APIs from ## -kms_url = 'http://localhost:9292' -kms_auth = HadoopSimpleAuth('keyadmin') +kms_auth_type = 'kerberos' # 'simple' | 'kerberos' Review Comment: Is use of `kms_auth_type` necessary? To keep this script simple, I suggest directly setting `kms_auth` in line 81 below: ``` # use Hadoop simple authentication kms_auth = HadoopSimpleAuth(kms_user) # uncomment following 2 lines to use Kerberos authentication # from requests_kerberos import HTTPKerberosAuth, DISABLED # kms_auth = HTTPKerberosAuth(mutual_authentication=DISABLED) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
