chore: Code-split CS config class (#39813)

## Description
PR to code split cloud services configs.

/test Sanity

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13956077465>
> Commit: 458e1607df835771ddb0cb8869cdff2692e25abc
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13956077465&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Wed, 19 Mar 2025 21:06:02 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced an enhanced cloud configuration setup that provides default
values for key settings.
- **Refactor**
- Streamlined the existing cloud configuration by centralizing its
management and removing redundant customizations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Abhijeet 2025-03-20 15:14:22 +05:30 committed by GitHub
parent c162311f43
commit e9cb8420ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 23 deletions

View File

@ -1,30 +1,9 @@
package com.appsmith.server.configurations;
import com.appsmith.server.configurations.ce.CloudServicesConfigCE;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
@Getter
public class CloudServicesConfig {
private String baseUrl;
@Value("${appsmith.cloud_services.template_upload_auth_header}")
private String templateUploadAuthHeader;
@Autowired
public void setBaseUrl(@Value("${appsmith.cloud_services.base_url:}") String value) {
baseUrl = StringUtils.isEmpty(value) ? "https://cs.appsmith.com" : value;
}
@Value("${appsmith.cloud_services.signature_base_url}")
String baseUrlWithSignatureVerification;
public String getBaseUrlWithSignatureVerification() {
return StringUtils.isEmpty(this.baseUrlWithSignatureVerification)
? this.getBaseUrl()
: this.baseUrlWithSignatureVerification;
}
}
public class CloudServicesConfig extends CloudServicesConfigCE {}

View File

@ -0,0 +1,28 @@
package com.appsmith.server.configurations.ce;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@Getter
public class CloudServicesConfigCE {
private String baseUrl;
@Value("${appsmith.cloud_services.template_upload_auth_header}")
private String templateUploadAuthHeader;
@Autowired
public void setBaseUrl(@Value("${appsmith.cloud_services.base_url:}") String value) {
baseUrl = StringUtils.isEmpty(value) ? "https://cs.appsmith.com" : value;
}
@Value("${appsmith.cloud_services.signature_base_url}")
String baseUrlWithSignatureVerification;
public String getBaseUrlWithSignatureVerification() {
return StringUtils.isEmpty(this.baseUrlWithSignatureVerification)
? this.getBaseUrl()
: this.baseUrlWithSignatureVerification;
}
}