From 3fd251a36461397f68fb2490366a202931231a69 Mon Sep 17 00:00:00 2001 From: Joaquin Esteban Ponte Diaz Date: Fri, 20 Oct 2023 13:49:19 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Update=20Salesforce?= =?UTF-8?q?=20connector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++++++++++++++----- pom.xml | 12 +++++----- .../mule/global-configuration-salesforce.xml | 2 +- src/main/resources/global-config.yaml | 13 ++++++----- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 95e02aa..cd1a028 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ Shared Mule library that provides reusable flows, resources and configuration se ## Table of contents 1. [Description](#description) -1. [Configuration](#configuration) +1. [Salesforce](#salesforce) + 1. [JWT configuration](#salesforce-jwt-configuration) + 2. [Connector configuration](#salesforce-connector-configuration) ## Description @@ -32,16 +34,24 @@ Multiple common components like flows, sub-flows, etc. to be re-used across the In summary, having a project with common assets like flows, configurations, and other reusable components brings numerous benefits, including reusability, consistency, efficiency, maintainability, scalability, and collaboration. It empowers developers to build integration solutions more effectively, accelerates development cycles, and ensures high-quality and reliable outcomes. -## Configuration +## Salesforce + +### Salesforce JWT configuration +Find the instrucctions in the Development Process Document in Anypoint Exchange. + +### Salesforce connector configuration The next properties must be provided to run the service: | Property | Description | | ------------------------- | ------------------------- | -| salesforce.keystore | Keystore with cetificates to connect with Salesforce. Salesforce JWT Authentication | -| salesforce.consumerkey | Salesforce Consumer Key | -| salesforce.principal | Salesforce User | -| salesforce.storepassword | Password for the keystore | +| salesforce.keystore | Keystore with the cetificate to connect with Salesforce. | +| salesforce.consumerkey | Connected App Consumer Key | +| salesforce.principal | The user created in Salesforce that has the profile assigned to the Connected App | +| salesforce.storepassword | The password to open the keystore | +| salesforce.certificatealias | The alias of the certificate inside the keystore | +| salesforce.tokenendpoint | The URL to generate the authentication token | +| salesforce.audienceurl | test.salesforce.com for a sandbox environment and login.salesforce.com for production. |
diff --git a/pom.xml b/pom.xml index 34f5a99..d135b02 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ 078efef1-d139-48ed-92f5-f8d4a0592374 common-parent-pom - 1.0.5 + 1.0.14 078efef1-d139-48ed-92f5-f8d4a0592374 common-core - 1.0.12 + 1.0.13 mule-application common-core Shared Mule library that provides reusable flows, resources and configuration settings common for all applications @@ -29,9 +29,9 @@ org.mule.tools.maven mule-maven-plugin true - - mule-plugin - + + mule-application + @@ -50,9 +50,7 @@ mule-otel-connector mule-plugin - - diff --git a/src/main/mule/global-configuration-salesforce.xml b/src/main/mule/global-configuration-salesforce.xml index 38bca4f..cf77dbc 100644 --- a/src/main/mule/global-configuration-salesforce.xml +++ b/src/main/mule/global-configuration-salesforce.xml @@ -24,7 +24,7 @@ consumerKey="${salesforce.consumerkey}" keyStore="${salesforce.keystore}" storePassword="${salesforce.storepassword}" - principal="${salesforce.principal}" /> + principal="${salesforce.principal}" certificateAlias="${salesforce.certificatealias}" tokenEndpoint="${salesforce.tokenendpoint}" audienceUrl="${salesforce.audienceurl}"/> diff --git a/src/main/resources/global-config.yaml b/src/main/resources/global-config.yaml index 55e3067..6b95cef 100644 --- a/src/main/resources/global-config.yaml +++ b/src/main/resources/global-config.yaml @@ -6,14 +6,17 @@ salesforce: consumerkey: "my-consumer-key" keystore: "my-keystore.jks" storepassword: "the-kystore-password" - principal: "user-in-salesforce" + certificatealias: "the-certificate-inside-keystore" + principal: "user-in-salesforce" + tokenendpoint: "salesforce-token-endpoint" + audienceurl: "https://test.salesforce.com-(sandbox)" -#OpenTelemtry configuration +# OpenTelemtry configuration otel: collectorendpoint: "http://localhost:4317" servicename: "myservice" -#Service messages +# Service messages messages: backend-error: "There was a problem while trying to access the backend repository" apikit-400: "Bad request" @@ -22,9 +25,7 @@ messages: apikit-406: "Not acceptable" apikit-415: "Unsupported media type" apikit-501: "Not Implemented" - - + # Logging - logz.io -# Add the jar files in the service pom logzio.token: "MyToken" logzio.url: "MyUrl" \ No newline at end of file