Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kerberos] Refactoring and remove configs with defaults #32152

Merged
merged 2 commits into from
Jul 19, 2018

Conversation

bizybot
Copy link
Contributor

@bizybot bizybot commented Jul 18, 2018

This commit does some refactoring to remove support package
and move class KerberosTicketValidator to kerberos package.
That was the only class in that package, so no need for it to be in
separate package.
Changes done to use default values for jaas configuration options
to avoid unnecessary configuration.
Fix couple of random failures in tests.
Modified refreshKrb5Config to use default value false in
KerberosTicketValidator. If the krb5.conf file is modified then we
will need to restart JVM as the config will not be refreshed. This
will need to be documented.
For testing, refreshKrb5Config is set to true as we keep
changing the kdc port. This is set in SpnegoClient and only for tests.

This commit does some refactoring to remove support package
and move class KerberosTicketValidator to kerberos package.
That was the only class in that package, so no need for it to be in
separate package.
Changes done to use default values for jaas configuration options
for the ones which we can use defaults.
Fix couple of random failures in tests.
Modified `refreshKrb5Config` to use default value `false` in
KerberosTicketValidator. If the krb5.conf file is modified then we
will need to restart JVM as the config will not be refreshed.
For testing, `refreshKrb5Config` is set to `true` as we keep
changing the kdc port. This is set in SpnegoClient and only for tests.
@bizybot bizybot added >feature :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) labels Jul 18, 2018
@bizybot bizybot requested a review from jaymode July 18, 2018 07:25
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security

@@ -41,7 +41,7 @@
* It may respond with token which needs to be communicated with the peer.
*/
public class KerberosTicketValidator {
static final Oid SPNEGO_OID = getSpnegoOid();
public static final Oid SPNEGO_OID = getSpnegoOid();
Copy link
Member

Choose a reason for hiding this comment

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

why did this become public? Did you remove the support package in the test directory structure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I did not move the test support package classes, now I have moved them I do not need to make it public. Thank you.

@@ -49,7 +50,7 @@
* Use {@link #close()} to release and dispose {@link LoginContext} and
* {@link GSSContext} after usage.
*/
class SpnegoClient implements AutoCloseable {
public class SpnegoClient implements AutoCloseable {
Copy link
Member

Choose a reason for hiding this comment

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

you can revert these changes if you remove the support package here too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I did not move the test support package classes, now I have moved them so I do not need to make it public. Thank you.

Copy link
Member

@jaymode jaymode left a comment

Choose a reason for hiding this comment

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

LGTM

@bizybot bizybot merged commit f0df110 into elastic:feature/kerberos Jul 19, 2018
@bizybot bizybot deleted the kerberos/refactoring1 branch July 19, 2018 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants