Skip to content

Commit

Permalink
Resolve checkstyle violations
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Brigandì committed May 24, 2016
1 parent 8adc11d commit 8917672
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ public class IndigoOAuth2Authentication extends OAuth2Authentication {
OAuth2AccessToken token;
UserInfo userInfo;

/**
* Generate an {@link IndigoOAuth2Authentication}.
*
* @param authentication
* the {@link OAuth2Authentication}.
* @param token
* the {@link OAuth2AccessToken}.
* @param userInfo
* the {@link UserInfo}. Can be null (i.e. the client is authenticating with its own
* credentials).
*/
public IndigoOAuth2Authentication(OAuth2Authentication authentication, OAuth2AccessToken token,
UserInfo userInfo) {
super(authentication.getOAuth2Request(), authentication.getUserAuthentication());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public class IndigoUserInfo extends DefaultUserInfo {
private List<Group> groups;
private String organizationName;

/**
* Create an IndigoUserInfo copying the fields from a {@link UserInfo} object.
*
* @param other
* the {@link UserInfo} to copy from.
*/
public IndigoUserInfo(UserInfo other) {
this.setSub(other.getSub());
this.setPreferredUsername(other.getPreferredUsername());
Expand Down Expand Up @@ -79,6 +85,13 @@ public JsonObject toJson() {
}
}

/**
* Create a {@link UserInfo} from its JSON representation.
*
* @param obj
* {@link JsonObject} containing the JSON representation.
* @return the UserInfo.
*/
public static UserInfo fromJson(JsonObject obj) {
IndigoUserInfo result = new IndigoUserInfo(DefaultUserInfo.fromJson(obj));
if (obj.has(GROUPS_KEY) && obj.get(GROUPS_KEY).isJsonArray()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package it.reply.orchestrator.service.security;

import com.google.common.base.Strings;

import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.JWTParser;

Expand Down

0 comments on commit 8917672

Please sign in to comment.