-
Notifications
You must be signed in to change notification settings - Fork 3
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
[EDGORDERS-83-ENV]. Refactor for TLS configuration for Spring-based Environment #105
Conversation
src/main/java/org/folio/edge/core/utils/SslConfigurationUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/org/folio/edge/core/utils/SslConfigurationUtil.java
Outdated
Show resolved
Hide resolved
README.md
Outdated
| `SPRING_SSL_BUNDLE_JKS_WEB-SERVER_KEYSTORE_TYPE` | `NA` | (Required). Set the type of the keystore. Common types include `JKS`, `PKCS12`, and `BCFKS` | | ||
| `SPRING_SSL_BUNDLE_JKS_WEB-SERVER_KEYSTORE_LOCATION` | `NA` | (Required). Set the location of the keystore file in the local file system | | ||
| `SPRING_SSL_BUNDLE_JKS_WEB-SERVER_KEYSTORE_PASSWORD` | `NA` | (Required). Set the password for the keystore | | ||
| `SPRING_SSL_BUNDLE_JKS_WEB-SERVER_KEY_ALIAS` | `NA` | Set the alias of the key within the keystore. | | ||
| `SPRING_SSL_BUNDLE_JKS_WEB-SERVER_KEY_PASSWORD` | `NA` | Optional param that points to a password of `KEY_ALIAS` if it protected | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove any dashes (WEB-SERVER -> WEBSERVER):
https://docs.spring.io/spring-boot/reference/features/external-config.html#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables
public static final String SPRING_SSL_BUNDLE_JKS_WEB_SERVER_KEYSTORE_TYPE = "SPRING_SSL_BUNDLE_JKS_WEBSERVER_KEYSTORE_TYPE"; | ||
public static final String SPRING_SSL_BUNDLE_JKS_WEB_SERVER_KEYSTORE_LOCATION = "SPRING_SSL_BUNDLE_JKS_WEBSERVER_KEYSTORE_LOCATION"; | ||
public static final String SPRING_SSL_BUNDLE_JKS_WEB_SERVER_KEYSTORE_PASSWORD = "SPRING_SSL_BUNDLE_JKS_WEBSERVER_KEYSTORE_PASSWORD"; | ||
public static final String SPRING_SSL_BUNDLE_JKS_WEB_SERVER_KEY_ALIAS = "SPRING_SSL_BUNDLE_JKS_WEBSERVER_KEY_ALIAS"; | ||
public static final String SPRING_SSL_BUNDLE_JKS_WEB_SERVER_KEY_PASSWORD = "SPRING_SSL_BUNDLE_JKS_WEBSERVER_KEY_PASSWORD"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name should also be renamed: WEB_SERVER -> WEBSERVER
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I do the same for the FOLIO_CLIENT_TLS_* variables?
public static final String FOLIO_CLIENT_TLS_TRUST_STORE_TYPE = "FOLIO_CLIENT_TLS_TRUSTSTORETYPE"; | ||
public static final String FOLIO_CLIENT_TLS_TRUST_STORE_PATH = "FOLIO_CLIENT_TLS_TRUSTSTOREPATH"; | ||
public static final String FOLIO_CLIENT_TLS_TRUST_STORE_PASSWORD = "FOLIO_CLIENT_TLS_TRUSTSTOREPASSWORD"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming the variable name gives a better indication of the content:
TRUST_STORE_TYPE -> TRUSTSTORETYPE
TRUST_STORE_PATH -> TRUSTSTOREPATH
TRUST_STORE_PASSWORD -> TRUSTSTOREPASSWORD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged
README.md
Outdated
@@ -165,34 +165,31 @@ Configuration information is specified in two forms: | |||
| `request_timeout_ms` | `30000` | Request Timeout | | |||
| `api_key_sources` | `PARAM,HEADER,PATH` | Defines the sources (order of precendence) of the API key. | | |||
|
|||
### System Properties for TLS configuration for Http server | |||
### Env variables for TLS configuration for Http server | |||
|
|||
To configure Transport Layer Security (TLS) for the HTTP server in an edge module, the following configuration parameters should be used. | |||
Parameters marked as Required are required only in case when ssl_enabled is set to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ssl_enabled has been replaced with checking whether SPRING_SSL_BUNDLE_JKS_WEBSERVER_KEYSTORE_TYPE is defined.
Co-authored-by: julianladisch <[email protected]>
Quality Gate passedIssues Measures |
Use Spring ENV vars