Skip to content

RANGER-5728: Update stress_kms script to run against Keberos enabled . - #1143

Open
vikaskr22 wants to merge 1 commit into
apache:masterfrom
vikaskr22:RANGER-5728
Open

RANGER-5728: Update stress_kms script to run against Keberos enabled .#1143
vikaskr22 wants to merge 1 commit into
apache:masterfrom
vikaskr22:RANGER-5728

Conversation

@vikaskr22

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Existing stress_kms.py utility file is being updated to run against Kerberos enabled server. Now Ranger services run with Kerberos by default in Docker, so updated this script to run with Kerberos.

This script can still run with SIMPLE AUTH .

This script has been very helpful to quickly verify any sanity/tests, updating this to run with Kerberos will be helpful.

How was this patch tested?

  • mvn build with UT passed
  • By running the script against Kerberos enabled server.

##
kms_url = 'http://localhost:9292'
kms_auth = HadoopSimpleAuth('keyadmin')
kms_auth_type = 'kerberos' # 'simple' | 'kerberos'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the review @mneethiraj .

Actually I simply tried to keep all the parameters that can be modified at one place, this way it remains consistent with other params like kms_user, kms_url etc.
With explicit kms_auth_type along with description , it would be clear for the new user that this part is configurable. Making inline changes is also fine, but to me it seems making changes in the execution logic.

It's only about convention, please let me know your thoughts, I will change it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vikaskr22 - the comments have become too noisy, hence my suggestion to keeps the code simple for humans to read. I would suggest only the following 2 changes:

  1. add following at the top of the file (not much value in "optimizing" to import only when using Kerbeors
from requests_kerberos import HTTPKerberosAuth, DISABLED
  1. Change kms_auth initialization to following:
kms_auth = HadoopSimpleAuth(kms_user)
# for kerberos:
# kms_auth = HTTPKerberosAuth(mutual_authentication=DISABLED)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants