...
@Factory
@Requires(missingProperty = LocalCacheProperties.PREFIX + "." + MyEntityCacheConfig.CACHE_NAME)
public class MyEntityCacheConfig {
public static final String CACHE_NAME = "my-entity";
@Bean
@Singleton
@Named(CACHE_NAME)
LocalCacheProperties cacheProperties(ApplicationConfiguration applicationConfiguration) {
return LocalCacheProperties.builder()
.cacheName(CACHE_NAME)
.applicationConfiguration(applicationConfiguration)
.build();
}
}
...
messageQueue:
provider: rabbitmq
uri: amqps://user:pass@localhost:5671/%2f
exchangeName: testExchange
tls:
enabled: true
p12KeyPath: C:/certs/rmq.p12
p12KeyPassphrase: rmqpass
producer:
minIdleChannels: 2
maxIdleChannels: 4
maxOpenChannels: 6
sendMessageTimeout: 10000
threads: 10
retry:
retries: 10
delay: 10000
consumer:
directConsumer:
maxMessages: 4
mmaxMessageRequeues: 6
broadcastConsumer:
maxMessages: 3
maxMessageRequeues: 6
Encryption
PDP provides a utilities class called CryptoUtils that allows the user to encrypt and decrypt any given String.
import com.pureinsights.pdp.core.crypto.CryptoUtils;
public class EncrytedEntity {
String content;
public EncrytedEntity(String content) {
this.content = CryptoUtils.encrypt(content);
}
public String plainContent() {
return CryptoUtils.decrypt(content);
}
}
The encryption mechanism provided by the CryptoUtils uses a master password to generate the secret key. This master password can be configured setting the environment variable PDP_MASTER_PASSWORD
.
Warning For production environments always set your own master password. Never rely on the default one.
Secrets Service
The Secrets Service provides a way to store and retrieve encrypted information from a given repository.
Configuration
secretsService:
provider: <providerKey>
Configuration Parameters
provider
(Optional, String) Repository provider to store and retrieve secrets
Providers
Storage
Stores and retrieves secrets from the configured storage for PDP.
providerKey
storage
Configuration
secretsService:
provider: storage