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

Feature/objects 1036 #1

Merged
merged 19 commits into from
Oct 5, 2016
Merged

Feature/objects 1036 #1

merged 19 commits into from
Oct 5, 2016

Conversation

andreassiegel
Copy link
Contributor

@andreassiegel andreassiegel commented Oct 4, 2016

What changes were proposed in this pull request?

Provides the common code for all user details services.

Note:
This also includes all classes that previously were part of smartcosmos-dao-user-details, because after some clean up this repository contained only two classes that actually are not independent from all the classes in this repository. Thus, this split eventually made no sense.

How is this patch documented?

  • Code
  • Javadoc
  • README

How was this patch tested?

  • Unit tests
  • Postman

Depends On

Nothing

<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
Copy link

Choose a reason for hiding this comment

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

Why provided scope? This is for builds and will prevent transient dependencies from recognizing this as a required dependency. That means you are at the mercy of whoever else declares these dependencies and the version they declare.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't ask me why, but lombok is always and everywhere declared with provided scope, probably because it's only relevant during compile time when Lombok does its magic.

public static final String CODE = "code";
public static final String MESSAGE = "message";

private static final int VERSION = 1;
Copy link

@ghost ghost Oct 4, 2016

Choose a reason for hiding this comment

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

this should be VERSION_1, VERSION_ONE or VERSION_01 otherwise it's a useless definition in the future since it will have to change anyway.

This is intended to be a forward thinking compatibility feature where the version number will change over time and can be used to route requests. Even though this is a response it should be consistent with our other implementations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

* @return the AuthenticateUserService bean
*/
@Bean
@ConditionalOnMissingBean
Copy link

Choose a reason for hiding this comment

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

Doesn't this require a value?

Copy link

Choose a reason for hiding this comment

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

We have to be careful here? If a developer uses their own auto-configuration this could engage before that causing confusion. I suggest a log.info("Default authentication service being started") or something similar to indicate in the logs that we are engaging on their behalf by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is no value in the annotation, it basically says use me if you don't have anything of my type.

I'll add the log message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

public static final String PASSWORD_HASH = "passwordHash";
public static final String AUTHORITIES = "authorities";

private static final int VERSION = 1;
Copy link

@ghost ghost Oct 4, 2016

Choose a reason for hiding this comment

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

VERSION_1 is preferred

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

@@ -0,0 +1,71 @@
package net.smartcosmos.userdetails.autoconfigure;
Copy link

Choose a reason for hiding this comment

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

nicely done

.findAny()
.get();

Assert.assertNotNull("the JSON message converter must not be null",
Copy link

Choose a reason for hiding this comment

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

That is nice to ensure but if someone is messing around with this we have big problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This must be a left-over from copying some previous code. To be honest, I have no idea why it is there or why we would need this in a test class.

We don't need an assertion to realize something might go wrong if this guy is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

@andreassiegel andreassiegel merged commit 938b60c into master Oct 5, 2016
@andreassiegel andreassiegel deleted the feature/OBJECTS-1036 branch October 5, 2016 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants