use of org.apereo.cas.support.saml.idp.metadata.GitSamlIdPMetadataCipherExecutor in project cas by apereo.
the class SamlIdPGitIdPMetadataConfiguration method samlIdPMetadataGeneratorCipherExecutor.
@Bean
@ConditionalOnMissingBean(name = "gitSamlIdPMetadataCipherExecutor")
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public CipherExecutor samlIdPMetadataGeneratorCipherExecutor(final ConfigurableApplicationContext applicationContext, final CasConfigurationProperties casProperties) {
return BeanSupplier.of(CipherExecutor.class).when(CONDITION_ENABLED.given(applicationContext.getEnvironment())).and(CONDITION_URL.given(applicationContext.getEnvironment())).supply(() -> {
val idp = casProperties.getAuthn().getSamlIdp();
val crypto = idp.getMetadata().getGit().getCrypto();
if (crypto.isEnabled()) {
return CipherExecutorUtils.newStringCipherExecutor(crypto, GitSamlIdPMetadataCipherExecutor.class);
}
LOGGER.info("Git SAML IdP metadata encryption/signing is turned off and MAY NOT be safe in a production environment. " + "Consider using other choices to handle encryption, signing and verification of metadata artifacts");
return CipherExecutor.noOp();
}).otherwise(CipherExecutor::noOp).get();
}
Aggregations