From 89176721aaa96db73c5f7d1dc8f1268a39053438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Brigand=C3=AC?= Date: Tue, 24 May 2016 12:44:51 +0200 Subject: [PATCH] Resolve checkstyle violations --- .../dto/security/IndigoOAuth2Authentication.java | 11 +++++++++++ .../orchestrator/dto/security/IndigoUserInfo.java | 13 +++++++++++++ .../security/UserInfoIntrospectingTokenService.java | 1 + 3 files changed, 25 insertions(+) diff --git a/src/main/java/it/reply/orchestrator/dto/security/IndigoOAuth2Authentication.java b/src/main/java/it/reply/orchestrator/dto/security/IndigoOAuth2Authentication.java index af2fec8d26..11aa76d540 100644 --- a/src/main/java/it/reply/orchestrator/dto/security/IndigoOAuth2Authentication.java +++ b/src/main/java/it/reply/orchestrator/dto/security/IndigoOAuth2Authentication.java @@ -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()); diff --git a/src/main/java/it/reply/orchestrator/dto/security/IndigoUserInfo.java b/src/main/java/it/reply/orchestrator/dto/security/IndigoUserInfo.java index 420cf58274..effd349740 100644 --- a/src/main/java/it/reply/orchestrator/dto/security/IndigoUserInfo.java +++ b/src/main/java/it/reply/orchestrator/dto/security/IndigoUserInfo.java @@ -19,6 +19,12 @@ public class IndigoUserInfo extends DefaultUserInfo { private List 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()); @@ -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()) { diff --git a/src/main/java/it/reply/orchestrator/service/security/UserInfoIntrospectingTokenService.java b/src/main/java/it/reply/orchestrator/service/security/UserInfoIntrospectingTokenService.java index 2557093029..faf1d5580f 100644 --- a/src/main/java/it/reply/orchestrator/service/security/UserInfoIntrospectingTokenService.java +++ b/src/main/java/it/reply/orchestrator/service/security/UserInfoIntrospectingTokenService.java @@ -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;