diff --git a/README.md b/README.md index 8765dcc7b..0b613e007 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,9 @@ The two Enums removed are: * DocumentType - the `DocumentDetails.getType()` method now returns a String. The possible values are exposed as constants on the `com.yoti.api.client.DocumentDetails` interface. * HumanProfile.Gender - `HumanProfile.getGender()` now returns an `Attribute`. Possible values are defined in `com.yoti.api.client.HumanProfile`. +### Removed toString() methods +We've removed implementations of toString() from all the DTOs returned through the public api. + ## Spring Security Integration If you use Spring Security you can use the `yoti-sdk-spring-security` module to make integration easier. You are provided with some classes that fit into Spring Security's existing authentication model. diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeConverter.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeConverter.java index f0167c3ff..9f1d88c86 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeConverter.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeConverter.java @@ -59,7 +59,7 @@ private Object convertValueFromProto(AttrProto.Attribute attribute) throws Parse case JSON: return JSON_MAPPER.readValue(attribute.getValue().toString(DEFAULT_CHARSET), Map.class); default: - LOG.warn("Unknown type {} for attribute {}. Attempting to parse it as a String", attribute.getContentType(), attribute.getName()); + LOG.warn("Unknown type '{}' for attribute '{}'. Attempting to parse it as a String", attribute.getContentType(), attribute.getName()); return attribute.getValue().toString(DEFAULT_CHARSET); } } diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeListConverter.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeListConverter.java index f6819fa5e..e1ba1b75c 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeListConverter.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/AttributeListConverter.java @@ -36,7 +36,7 @@ List> parseAttributeList(byte[] attributeListBytes) throws ProfileE AttributeListProto.AttributeList attributeList = parseProto(attributeListBytes); List> attributes = parseAttributes(attributeList); - LOG.debug("{} attribute(s) parsed", attributes.size()); + LOG.debug("{} out of {} attribute(s) parsed successfully ", attributes.size(), attributeList.getAttributesCount()); return attributes; } diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/DocumentDetailsAttributeValue.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/DocumentDetailsAttributeValue.java index 8eaf9b6b7..d57ca9f31 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/DocumentDetailsAttributeValue.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/DocumentDetailsAttributeValue.java @@ -44,15 +44,4 @@ public String getIssuingAuthority() { return authority; } - @Override - public String toString() { - return "DocumentDetailsAttributeValue{" + - "type=" + type + - ", issuingCountry='" + issuingCountry + '\'' + - ", number='" + number + '\'' + - ", expirationDate=" + expirationDate + - ", issuingAuthority='" + authority + '\'' + - '}'; - } - } diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/JsonResourceFetcher.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/JsonResourceFetcher.java index 46c38dcc0..9b7712d0c 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/JsonResourceFetcher.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/JsonResourceFetcher.java @@ -46,7 +46,7 @@ public T postResource(UrlConnector urlConnector, byte[] body, Map headers) throws IOException { - LOG.debug("Connecting to: " + urlConnector.getUrlString()); + LOG.debug("Connecting to: '{}'", urlConnector.getUrlString()); HttpURLConnection httpUrlConnection = urlConnector.getHttpUrlConnection(); httpUrlConnection.setRequestMethod(httpMethod); setHeaders(headers, httpUrlConnection); diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/ProfileResponse.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/ProfileResponse.java index ed6a73363..f90a386de 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/ProfileResponse.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/ProfileResponse.java @@ -54,14 +54,6 @@ public int hashCode() { return result; } - @Override - public String toString() { - return "ProfileResponse{" + - "sessionData='" + sessionData + '\'' + - ", receipt=" + receipt + - '}'; - } - public static class ProfileResponseBuilder { private String sessionData; private Receipt receipt; diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/Receipt.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/Receipt.java index 26f90d90a..1408a0225 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/Receipt.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/Receipt.java @@ -227,21 +227,6 @@ public boolean equals(Object obj) { return true; } - @Override - public String toString() { - return "Receipt [receiptId=" + getDisplayReceiptId() - + ", otherPartyProfile=" + Arrays.toString(otherPartyProfile) - + ", profile=" + Arrays.toString(profile) - + ", otherPartyExtraData=" + Arrays.toString(otherPartyExtraData) - + ", extraData=" + Arrays.toString(extraData) - + ", wrappedReceiptKey=" + Arrays.toString(wrappedReceiptKey) - + ", policyUri=" + policyUri - + ", personalKey=" + Arrays.toString(personalKey) - + ", rememberMeId=" + Arrays.toString(rememberMeId) - + ", outcome=" + outcome - + ", timestamp=" + timestamp + "]"; - } - public String getDisplayReceiptId() { return receiptId != null ? toBase64String(receiptId) : "<>"; } diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/RemoteProfileService.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/RemoteProfileService.java index a6702c05e..d2ecd30a0 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/RemoteProfileService.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/RemoteProfileService.java @@ -73,7 +73,7 @@ public Receipt getReceipt(KeyPair keyPair, String appId, String connectToken) th } private Receipt fetchReceipt(String resourcePath, String digest, String authKey) throws IOException, ProfileException { - LOG.info("Fetching profile from resource at {}", resourcePath); + LOG.info("Fetching profile from resource at '{}'", resourcePath); Map headers = new HashMap<>(); headers.put(AUTH_KEY_HEADER, authKey); headers.put(DIGEST_HEADER, digest); diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlAddress.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlAddress.java index 4640057b8..67f3eaeee 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlAddress.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlAddress.java @@ -24,12 +24,4 @@ public String getCountry() { return country; } - @Override - public String toString() { - return "SimpleAmlAddress{" + - "postCode='" + postCode + '\'' + - ", country='" + country + '\'' + - '}'; - } - } diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlProfile.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlProfile.java index 03b1f513a..46fb58772 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlProfile.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlProfile.java @@ -45,14 +45,4 @@ public AmlAddress getAmlAddress() { return amlAddress; } - @Override - public String toString() { - return "SimpleAmlProfile{" + - "givenNames='" + givenNames + '\'' + - ", familyName='" + familyName + '\'' + - ", ssn='" + ssn + '\'' + - ", amlAddress=" + amlAddress + - '}'; - } - } diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlResult.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlResult.java index fc449fa17..dbe1ed67d 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlResult.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/call/aml/SimpleAmlResult.java @@ -40,12 +40,4 @@ public void setOnWatchList(boolean onWatchList) { this.onWatchList = onWatchList; } - @Override - public String toString() { - return "SimpleAmlResult{" + - "onFraudList=" + onFraudList + - ", onPepList=" + onPepList + - ", onWatchList=" + onWatchList + - '}'; - } } diff --git a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/util/QuietCloseable.java b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/util/QuietCloseable.java index 7ea6019db..57a1191ba 100644 --- a/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/util/QuietCloseable.java +++ b/yoti-sdk-impl/src/main/java/com/yoti/api/client/spi/remote/util/QuietCloseable.java @@ -22,7 +22,7 @@ public void close() { try { autoCloseable.close(); } catch (Exception e) { - LOG.error("Failed to close " + autoCloseable.getClass().getCanonicalName(), e); + LOG.error("Failed to close '{}'", autoCloseable.getClass().getCanonicalName(), e); } } diff --git a/yoti-sdk-spring-security/src/main/java/com/yoti/api/spring/security/web/YotiAuthenticationFilter.java b/yoti-sdk-spring-security/src/main/java/com/yoti/api/spring/security/web/YotiAuthenticationFilter.java index fad99dddb..6086468a3 100644 --- a/yoti-sdk-spring-security/src/main/java/com/yoti/api/spring/security/web/YotiAuthenticationFilter.java +++ b/yoti-sdk-spring-security/src/main/java/com/yoti/api/spring/security/web/YotiAuthenticationFilter.java @@ -30,7 +30,7 @@ public Authentication attemptAuthentication(final HttpServletRequest request, final HttpServletResponse response) throws AuthenticationException { LOG.debug("Yoti Auth Filter Running...."); final String token = obtainToken(request); - LOG.debug("Found token {}.", token); + LOG.debug("Found token '{}'.", token); final YotiAuthenticationToken authRequest = new YotiAuthenticationToken(token);