public class ServiceBindingPropertySource extends java.lang.Object implements IntrospectionUtils.SecurePropertySource
IntrospectionUtils.SecurePropertySource
that uses Kubernetes service bindings to resolve expressions.
Usage example:
Configure the certificate with a service binding. When the service binding is constructed as follows:
$SERVICE_BINDING_ROOT/
/custom-certificate/
/keyFile
/file
/chainFile
/keyPassword
<SSLHostConfig>
<Certificate certificateKeyFile="${custom-certificate.keyFile}"
certificateFile="${custom-certificate.file}"
certificateChainFile="${custom-certificate.chainFile}"
certificateKeyPassword="${chomp:custom-certificate.keyPassword}"
type="RSA" />
</SSLHostConfig>
The optional chomp: prefix will cause the ServiceBindingPropertySource
to trim a single newline (\r\n, \r, or \n)
from the end of the file, if it exists. This is a convenience for hand-edited
files/values where removing a trailing newline is difficult, and trailing
whitespace changes the meaning of the value.
echo "org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.ServiceBindingPropertySource" >> conf/catalina.properties
or add this to CATALINA_OPTS
-Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.ServiceBindingPropertySource
NOTE: When configured the PropertySource for resolving expressions
from system properties is still active.| Constructor and Description |
|---|
ServiceBindingPropertySource() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getProperty(java.lang.String key) |
java.lang.String |
getProperty(java.lang.String key,
java.lang.ClassLoader classLoader)
Obtain a property value, checking that code associated with the
provided class loader has permission to access the property.
|
public java.lang.String getProperty(java.lang.String key)
getProperty in interface IntrospectionUtils.PropertySourcepublic java.lang.String getProperty(java.lang.String key,
java.lang.ClassLoader classLoader)
IntrospectionUtils.SecurePropertySourceclassLoader is null or if classLoader does
not implement PermissionCheck then the property value will be
looked up without a call to
PermissionCheck.check(java.security.Permission)getProperty in interface IntrospectionUtils.SecurePropertySourcekey - The key of the requested propertyclassLoader - The class loader associated with the code that
trigger the property lookupnull if it could not be found
or if PermissionCheck.check(java.security.Permission)
failsCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.