diff --git a/powerauth-admin/src/main/java/io/getlime/security/app/admin/configuration/PowerAuthWebServiceConfiguration.java b/powerauth-admin/src/main/java/io/getlime/security/app/admin/configuration/PowerAuthWebServiceConfiguration.java index f2d7b9f99..1d6abffaf 100644 --- a/powerauth-admin/src/main/java/io/getlime/security/app/admin/configuration/PowerAuthWebServiceConfiguration.java +++ b/powerauth-admin/src/main/java/io/getlime/security/app/admin/configuration/PowerAuthWebServiceConfiguration.java @@ -59,7 +59,7 @@ public boolean isCurrentSecuritySettings(String clientToken) { */ @Bean public PowerAuthClient powerAuthClient() { - PowerAuthRestClientConfiguration config = new PowerAuthRestClientConfiguration(); + final PowerAuthRestClientConfiguration config = new PowerAuthRestClientConfiguration(); config.setPowerAuthClientToken(configuration.getClientToken()); config.setPowerAuthClientSecret(configuration.getClientSecret()); config.setAcceptInvalidSslCertificate(configuration.isAcceptInvalidSslCertificate()); diff --git a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClient.java b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClient.java index cd8301987..587168b5f 100644 --- a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClient.java +++ b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClient.java @@ -75,7 +75,7 @@ public PowerAuthFido2RestClient(String baseUrl) throws PowerAuthFido2Exception { */ public PowerAuthFido2RestClient(String baseUrl, PowerAuthFido2RestClientConfiguration config) throws PowerAuthFido2Exception { final DefaultRestClient.Builder builder = DefaultRestClient.builder().baseUrl(baseUrl) - .acceptInvalidCertificate(config.getAcceptInvalidSslCertificate()) + .acceptInvalidCertificate(config.isAcceptInvalidSslCertificate()) .connectionTimeout(config.getConnectTimeout()) .responseTimeout(config.getResponseTimeout()) .maxIdleTime(config.getMaxIdleTime()) diff --git a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClientConfiguration.java b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClientConfiguration.java index 4e1fa54dd..238e9919d 100644 --- a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClientConfiguration.java +++ b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthFido2RestClientConfiguration.java @@ -34,9 +34,14 @@ @Getter @Setter public class PowerAuthFido2RestClientConfiguration { - // Use 1 MB as default maximum memory size + /** + * Maximum memory size for HTTP requests in bytes. Use 1 MB as default maximum memory size. + */ private int maxMemorySize = 1024 * 1024; - // Use 5 seconds as default connect timeout + + /** + * Connection timeout. Use 5 seconds as default value. + */ private Duration connectTimeout = Duration.ofMillis(5000); /** @@ -54,207 +59,54 @@ public class PowerAuthFido2RestClientConfiguration { */ private Duration maxLifeTime; - private boolean proxyEnabled = false; - private String proxyHost; - private int proxyPort; - private String proxyUsername; - private String proxyPassword; - private String powerAuthClientToken; - private String powerAuthClientSecret; - private boolean acceptInvalidSslCertificate; - private HttpHeaders defaultHttpHeaders; - private ExchangeFilterFunction filter; - - /** - * Get maximum memory size for HTTP requests in bytes. - * @return Maximum memory size for HTTP requests in bytes. - */ - public int getMaxMemorySize() { - return maxMemorySize; - } - - /** - * Set maximum memory size for HTTP requests in bytes. - * @param maxMemorySize Maximum memory size for HTTP requests in bytes. - */ - public void setMaxMemorySize(int maxMemorySize) { - this.maxMemorySize = maxMemorySize; - } - - /** - * Get connection timeout as a Duration. - * @return Connection timeout as a Duration. - */ - public Duration getConnectTimeout() { - return connectTimeout; - } - - /** - * Set connection timeout as a Duration. - * @param connectTimeout Connection timeout as a Duration. - */ - public void setConnectTimeout(Duration connectTimeout) { - this.connectTimeout = connectTimeout; - } - - /** - * Get whether HTTP proxy is enabled. - * @return Whether HTTP proxy is enabled. - */ - public boolean isProxyEnabled() { - return proxyEnabled; - } - - /** - * Set whether HTTP proxy is enabled. - * @param proxyEnabled Whether HTTP proxy is enabled. - */ - public void setProxyEnabled(boolean proxyEnabled) { - this.proxyEnabled = proxyEnabled; - } - /** - * Get proxy host. - * @return Proxy host. + * Whether HTTP proxy is enabled. */ - public String getProxyHost() { - return proxyHost; - } - - /** - * Set proxy host. - * @param proxyHost Proxy host. - */ - public void setProxyHost(String proxyHost) { - this.proxyHost = proxyHost; - } - - /** - * Get proxy port. - * @return Proxy port. - */ - public int getProxyPort() { - return proxyPort; - } - - /** - * Set proxy port. - * @param proxyPort Proxy port. - */ - public void setProxyPort(int proxyPort) { - this.proxyPort = proxyPort; - } - - /** - * Get proxy username. - * @return Proxy username. - */ - public String getProxyUsername() { - return proxyUsername; - } - - /** - * Set proxy username. - * @param proxyUsername Proxy username.s - */ - public void setProxyUsername(String proxyUsername) { - this.proxyUsername = proxyUsername; - } - - /** - * Get proxy password. - * @return Proxy password. - */ - public String getProxyPassword() { - return proxyPassword; - } - - /** - * Set proxy password. - * @param proxyPassword Proxy password. - */ - public void setProxyPassword(String proxyPassword) { - this.proxyPassword = proxyPassword; - } - - /** - * Get HTTP basic authentication username. - * @return HTTP basic authentication username. - */ - public String getPowerAuthClientToken() { - return powerAuthClientToken; - } + private boolean proxyEnabled = false; /** - * Set HTTP basic authentication username. - * @param powerAuthClientToken HTTP basic authentication username. + * Proxy host. */ - public void setPowerAuthClientToken(String powerAuthClientToken) { - this.powerAuthClientToken = powerAuthClientToken; - } + private String proxyHost; /** - * Get HTTP basic authentication password. - * @return HTTP basic authentication password. + * Proxy port. */ - public String getPowerAuthClientSecret() { - return powerAuthClientSecret; - } + private int proxyPort; /** - * Set HTTP basic authentication password. - * @param powerAuthClientSecret HTTP basic authentication password. + * Proxy username. */ - public void setPowerAuthClientSecret(String powerAuthClientSecret) { - this.powerAuthClientSecret = powerAuthClientSecret; - } + private String proxyUsername; /** - * Get whether SSL certificate errors are ignored. - * @return Whether SSL certificate errors are ignored. + * Proxy password. */ - public boolean getAcceptInvalidSslCertificate() { - return acceptInvalidSslCertificate; - } + private String proxyPassword; /** - * Set whether SSL certificate errors are ignored. - * @param acceptInvalidSslCertificate Whether SSL certificate errors are ignored. + * HTTP basic authentication username. */ - public void setAcceptInvalidSslCertificate(boolean acceptInvalidSslCertificate) { - this.acceptInvalidSslCertificate = acceptInvalidSslCertificate; - } + private String powerAuthClientToken; /** - * Get default HTTP headers. - * @return Default HTTP headers. + * HTTP basic authentication password. */ - public HttpHeaders getDefaultHttpHeaders() { - return defaultHttpHeaders; - } + private String powerAuthClientSecret; /** - * Set default HTTP headers. - * @param defaultHttpHeaders Default HTTP headers. + * Whether SSL certificate errors are ignored. */ - public void setDefaultHttpHeaders(HttpHeaders defaultHttpHeaders) { - this.defaultHttpHeaders = defaultHttpHeaders; - } + private boolean acceptInvalidSslCertificate; /** - * Get exchange filter function. - * @return Exchange filter function. + * Default HTTP headers. */ - public ExchangeFilterFunction getFilter() { - return filter; - } + private HttpHeaders defaultHttpHeaders; /** - * Set exchange filter function. - * @param filter Exchange filter function. + * Exchange filter function. */ - public void setFilter(ExchangeFilterFunction filter) { - this.filter = filter; - } + private ExchangeFilterFunction filter; } diff --git a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClient.java b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClient.java index e0e3c8750..222ea36dc 100644 --- a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClient.java +++ b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClient.java @@ -79,7 +79,7 @@ public PowerAuthRestClient(String baseUrl) throws PowerAuthClientException { */ public PowerAuthRestClient(String baseUrl, PowerAuthRestClientConfiguration config) throws PowerAuthClientException { final DefaultRestClient.Builder builder = DefaultRestClient.builder().baseUrl(baseUrl) - .acceptInvalidCertificate(config.getAcceptInvalidSslCertificate()) + .acceptInvalidCertificate(config.isAcceptInvalidSslCertificate()) .connectionTimeout(config.getConnectTimeout()) .responseTimeout(config.getResponseTimeout()) .maxIdleTime(config.getMaxIdleTime()) diff --git a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClientConfiguration.java b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClientConfiguration.java index 49a67b1c6..d7c8ae87b 100644 --- a/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClientConfiguration.java +++ b/powerauth-rest-client-spring/src/main/java/com/wultra/security/powerauth/rest/client/PowerAuthRestClientConfiguration.java @@ -33,9 +33,14 @@ @Getter @Setter public class PowerAuthRestClientConfiguration { - // Use 1 MB as default maximum memory size + /** + * Maximum memory size for HTTP requests in bytes. Use 1 MB as default maximum memory size. + */ private int maxMemorySize = 1024 * 1024; - // Use 5 seconds as default connect timeout + + /** + * Connection timeout. Use 5 seconds as default value. + */ private Duration connectTimeout = Duration.ofMillis(5000); /** @@ -53,207 +58,54 @@ public class PowerAuthRestClientConfiguration { */ private Duration maxLifeTime; - private boolean proxyEnabled = false; - private String proxyHost; - private int proxyPort; - private String proxyUsername; - private String proxyPassword; - private String powerAuthClientToken; - private String powerAuthClientSecret; - private boolean acceptInvalidSslCertificate; - private HttpHeaders defaultHttpHeaders; - private ExchangeFilterFunction filter; - - /** - * Get maximum memory size for HTTP requests in bytes. - * @return Maximum memory size for HTTP requests in bytes. - */ - public int getMaxMemorySize() { - return maxMemorySize; - } - - /** - * Set maximum memory size for HTTP requests in bytes. - * @param maxMemorySize Maximum memory size for HTTP requests in bytes. - */ - public void setMaxMemorySize(int maxMemorySize) { - this.maxMemorySize = maxMemorySize; - } - - /** - * Get connection timeout as a Duration. - * @return Connection timeout as a Duration. - */ - public Duration getConnectTimeout() { - return connectTimeout; - } - - /** - * Set connection timeout as a Duration. - * @param connectTimeout Connection timeout as a Duration. - */ - public void setConnectTimeout(Duration connectTimeout) { - this.connectTimeout = connectTimeout; - } - - /** - * Get whether HTTP proxy is enabled. - * @return Whether HTTP proxy is enabled. - */ - public boolean isProxyEnabled() { - return proxyEnabled; - } - - /** - * Set whether HTTP proxy is enabled. - * @param proxyEnabled Whether HTTP proxy is enabled. - */ - public void setProxyEnabled(boolean proxyEnabled) { - this.proxyEnabled = proxyEnabled; - } - /** - * Get proxy host. - * @return Proxy host. + * Whether HTTP proxy is enabled. */ - public String getProxyHost() { - return proxyHost; - } - - /** - * Set proxy host. - * @param proxyHost Proxy host. - */ - public void setProxyHost(String proxyHost) { - this.proxyHost = proxyHost; - } - - /** - * Get proxy port. - * @return Proxy port. - */ - public int getProxyPort() { - return proxyPort; - } - - /** - * Set proxy port. - * @param proxyPort Proxy port. - */ - public void setProxyPort(int proxyPort) { - this.proxyPort = proxyPort; - } - - /** - * Get proxy username. - * @return Proxy username. - */ - public String getProxyUsername() { - return proxyUsername; - } - - /** - * Set proxy username. - * @param proxyUsername Proxy username.s - */ - public void setProxyUsername(String proxyUsername) { - this.proxyUsername = proxyUsername; - } - - /** - * Get proxy password. - * @return Proxy password. - */ - public String getProxyPassword() { - return proxyPassword; - } - - /** - * Set proxy password. - * @param proxyPassword Proxy password. - */ - public void setProxyPassword(String proxyPassword) { - this.proxyPassword = proxyPassword; - } - - /** - * Get HTTP basic authentication username. - * @return HTTP basic authentication username. - */ - public String getPowerAuthClientToken() { - return powerAuthClientToken; - } + private boolean proxyEnabled = false; /** - * Set HTTP basic authentication username. - * @param powerAuthClientToken HTTP basic authentication username. + * Proxy host. */ - public void setPowerAuthClientToken(String powerAuthClientToken) { - this.powerAuthClientToken = powerAuthClientToken; - } + private String proxyHost; /** - * Get HTTP basic authentication password. - * @return HTTP basic authentication password. + * Proxy port. */ - public String getPowerAuthClientSecret() { - return powerAuthClientSecret; - } + private int proxyPort; /** - * Set HTTP basic authentication password. - * @param powerAuthClientSecret HTTP basic authentication password. + * Proxy username. */ - public void setPowerAuthClientSecret(String powerAuthClientSecret) { - this.powerAuthClientSecret = powerAuthClientSecret; - } + private String proxyUsername; /** - * Get whether SSL certificate errors are ignored. - * @return Whether SSL certificate errors are ignored. + * Proxy password. */ - public boolean getAcceptInvalidSslCertificate() { - return acceptInvalidSslCertificate; - } + private String proxyPassword; /** - * Set whether SSL certificate errors are ignored. - * @param acceptInvalidSslCertificate Whether SSL certificate errors are ignored. + * HTTP basic authentication username. */ - public void setAcceptInvalidSslCertificate(boolean acceptInvalidSslCertificate) { - this.acceptInvalidSslCertificate = acceptInvalidSslCertificate; - } + private String powerAuthClientToken; /** - * Get default HTTP headers. - * @return Default HTTP headers. + * HTTP basic authentication password. */ - public HttpHeaders getDefaultHttpHeaders() { - return defaultHttpHeaders; - } + private String powerAuthClientSecret; /** - * Set default HTTP headers. - * @param defaultHttpHeaders Default HTTP headers. + * Whether SSL certificate errors are ignored. */ - public void setDefaultHttpHeaders(HttpHeaders defaultHttpHeaders) { - this.defaultHttpHeaders = defaultHttpHeaders; - } + private boolean acceptInvalidSslCertificate; /** - * Get exchange filter function. - * @return Exchange filter function. + * Default HTTP headers. */ - public ExchangeFilterFunction getFilter() { - return filter; - } + private HttpHeaders defaultHttpHeaders; /** - * Set exchange filter function. - * @param filter Exchange filter function. + * Exchange filter function. */ - public void setFilter(ExchangeFilterFunction filter) { - this.filter = filter; - } + private ExchangeFilterFunction filter; }