Copilot commented on code in PR #13676: URL: https://github.com/apache/cloudstack/pull/13676#discussion_r3644784970
########## utils/src/main/java/com/cloud/utils/crypt/EncryptablePropertyPlaceholderConfigurer.java: ########## @@ -0,0 +1,59 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +package com.cloud.utils.crypt; + +import org.jasypt.encryption.StringEncryptor; +import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; + +/** + * Spring bean that resolves property placeholders, decrypting any value wrapped as + * {@code ENC(...)} with the given jasypt {@link StringEncryptor}. Values that are not wrapped + * are passed through unchanged. + * + * This replaces {@code org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer} + * (from the jasypt-spring3 artifact), which is not on the classpath and is incompatible with + * Spring 5, so beans referencing it fail with a ClassNotFoundException. + */ +public class EncryptablePropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { Review Comment: This class is not referenced anywhere in the codebase yet (current usages only appear in this file and its unit test), so it won’t actually fix the RabbitMQ/Jasypt configuration failure described in #13352. To make the feature functional, update the relevant Spring context(s)/packaged XML to use this `com.cloud.utils.crypt.EncryptablePropertyPlaceholderConfigurer` (and define a `StringEncryptor` bean) in place of the missing `org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer`, and adjust any related documentation/examples accordingly. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
