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

GEODE-4633: un-deprecate peer-auth-init and more javadoc #1442

Merged
merged 6 commits into from Feb 15, 2018

Conversation

jinmeiliao
Copy link
Member

@jinmeiliao jinmeiliao commented Feb 13, 2018

Thank you for submitting a contribution to Apache Geode.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.

Copy link
Contributor

@davebarnes97 davebarnes97 left a comment

Choose a reason for hiding this comment

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

Can't comment on code, but I have a couple of comments on the comments:

In AuthInitialize.java, change "an {@link SecurityManager}" to "a {@link SecurityManager}".

In SecurityManager.java, change "method will also needs" to "method will also need".

Copy link
Member

@PurelyApplied PurelyApplied left a comment

Choose a reason for hiding this comment

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

Formatting and phrasing nitpicks, otherwise looks good to me.

@@ -92,8 +92,8 @@ Properties getCredentials(Properties securityProps, DistributedMember server, bo
* @param securityProps
* @return the credentials to be used. It needs to contain "security-username" and
* "security-password"
* @deprecated As of Geode 1.3, please implement getCredentials(Properties, DistributedMember,
* boolean)
* @deprecated in Geode 1.3. never called by the product. use getCredentials(Properties
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if the docs side of things differs, but I think two spaces after a period is still the standard for monospaced fonts. Capitalize after the periods in any case.

Copy link
Member

Choose a reason for hiding this comment

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

Also, linking the javadoc would be nice.

   * @deprecated in Geode 1.3.  Never called by the product.
   * Use {@link #getCredentials(Properties, DistributedMember, boolean)}

* use log4j instead of these loggers.
*
* @since Geode 1.0.
* @deprecated in Geode 1.5, never called by the product, use init(LogWriter systemLogger,
Copy link
Member

Choose a reason for hiding this comment

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

Linking init could be nice. I'd prefer full sentences in the javadocs personally, rather that notes.


@Override
public boolean authorize(Object principal, ResourcePermission permission) {
// only server-1 and server-2 are authenticated, but only server-1 is authorized
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: I'd drop the first "only."

@Override
public boolean authorize(Object principal, ResourcePermission permission) {
// only server-1 and server-2 are authenticated, but only server-1 is authorized
if ("server-1".equals(principal)) {
Copy link
Member

Choose a reason for hiding this comment

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

Does it still read as well when this is simplified to return "server-1".equals(principal);

Copy link
Member Author

Choose a reason for hiding this comment

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

yup.

@@ -54,8 +54,8 @@ default void init(LogWriter systemLogger, LogWriter securityLogger)
/**
*
* @since Geode 1.0.
* @deprecated in Geode 1.5, never called by the product, use init(LogWriter systemLogger,
* LogWriter securityLogger)
* @deprecated in Geode 1.5. Never called by the product. Use {link #init(LogWriter systemLogger,
Copy link
Member

Choose a reason for hiding this comment

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

Forgot the @ in @link.

If you're using IntelliJ, I think the default "view javadoc" hotkey is Ctrl-J, if you want to make sure linkage is working correctly.

@@ -92,8 +92,8 @@ Properties getCredentials(Properties securityProps, DistributedMember server, bo
* @param securityProps
* @return the credentials to be used. It needs to contain "security-username" and
* "security-password"
* @deprecated in Geode 1.3. never called by the product. use getCredentials(Properties
* securityProps, DistributedMember server, boolean isPeer)
* @deprecated in Geode 1.3. Never called by the product. Use {link #getCredentials(Properties
Copy link
Member

Choose a reason for hiding this comment

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

See above.

@jinmeiliao
Copy link
Member Author

precheckin green

@jinmeiliao
Copy link
Member Author

precheckin green

Copy link

@pdxrunner pdxrunner left a comment

Choose a reason for hiding this comment

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

LGTM except for the Autinitialize javadoc that needs some clartification

/**
* Initialize the callback for a client/peer. This is invoked when a new connection from a
* client/peer is created with the host.
*
* Do not use these loggers, use log4j logger directly
*

Choose a reason for hiding this comment

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

I find the wording in the javadoc confusing - we are saying use the init(systemLogger, securityLogger) method, but don't use the logger arguments in the AuthInitialize implementors.

I understand that we need to continue support any existing implementations, so maybe the javadoc should indicate that new implementations should use log4j logger instead of the logger parameters.

@jinmeiliao jinmeiliao merged commit 7c5cd35 into apache:develop Feb 15, 2018
@jinmeiliao jinmeiliao deleted the authInit branch February 15, 2018 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants