Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align credentials stores part 14 #27361

Merged
merged 5 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Packs/Salesforce/.pack-ignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[file:Salesforce.yml]
ignore=IN126,IN145
ignore=IN126

[file:classifier-User_Profile_-_Salesforce_(Incoming).json]
ignore=MP106
Expand All @@ -8,7 +8,7 @@ ignore=MP106
ignore=MP106

[file:Salesforce_IAM.yml]
ignore=BA108,BA109,IN145
ignore=BA108,BA109

[file:Salesforce_image.png]
ignore=IM111
Expand Down
102 changes: 102 additions & 0 deletions Packs/Salesforce/Integrations/Salesforce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1662,3 +1662,105 @@
<p>6. Go to “Manage Connected Apps”.<br><img src="https://raw.githubusercontent.com/demisto/content/ca13780e216a39751600dcb1e386d12f52fc8f25/docs/images/Integrations/integration-Salesforce_mceclip6.png" width="165" height="162"></p>
<p>7. Edit the new application and under “OAuth Policies” enable all IP address.</p>
<p> <img src="https://raw.githubusercontent.com/demisto/content/ca13780e216a39751600dcb1e386d12f52fc8f25/docs/images/Integrations/integration-Salesforce_mceclip7.png" width="486" height="37"> </p>
### salesforce-get-casecomment

***
Returns a comment through the case number.

#### Base Command

`salesforce-get-casecomment`

#### Input

| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| oid | Returns information of a case. | Optional |
| caseNumber | The case number of the case. | Optional |

#### Context Output

| **Path** | **Type** | **Description** |
| --- | --- | --- |
| ID | string | The ID of the case. |
| ParentId | string | The ID of the parent case of the case comment. Required. |
| IsPublished | boolean | Whether the case comment is visible to customers in the Self-Service portal \(true\). The label is published. This is the only CaseComment field that can be updated through the API. |
| CommentBody | string | The text of the case body. Maximum size is 4,000 bytes. The label is Body. |
| CreatedById | unknown | The created date by ID. |
| CreatedDate | string | The created date. |
| SystemModstamp | string | The SystemMod stamp. |
| LastModifiedDate | string | The last modified date. |
| LastModifiedById | string | The last modified date by ID. |
| IsDeleted | boolean | Whether the object has been moved to the Recycle Bin \(true\). Label is Deleted. |
### salesforce-post-casecomment

***
The post comment through the case number.

#### Base Command

`salesforce-post-casecomment`

#### Input

| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| oid | The Object ID of the case. | Optional |
| caseNumber | The case number of the case. | Optional |
| text | Added Text to context. | Optional |

#### Context Output

There is no context output for this command.
### salesforce-get-user

***
Returns the UserName through the case number.

#### Base Command

`salesforce-get-user`

#### Input

| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| oid | The Object ID of the case. | Optional |
| caseNumber | The case number of the case. | Optional |

#### Context Output

| **Path** | **Type** | **Description** |
| --- | --- | --- |
| ID | string | The ID of the case. |
| Alias | string | The user’s alias. Required. For example, jsmith. |
| CommunityNickname | string | The name used to identify the user in the Community application, which includes the ideas and answers features. |
| CreatedById | string | Created by the ID. |
| Email | string | The user’s email address. Required. |
| LastLoginDate | string | The time and date when the user last successfully logged in. This value is updated if 60 seconds have elapsed since the user’s last login. |
| LastModifiedDate | string | The last modified date. |
| LastName | string | The user’s last name. Required. |
| Name | string | Concatenation of FirstName and LastName. Limited to 121 characters. |
| Username | string | Contains the name that a user enters to log in to the API or the user interface. Required. Must be in the form of an email address, all characters should be lowercase, and unique across all organizations. Each added user counts as a license. Every organization has a maximum number of licenses. If you attempt to exceed the maximum number of licenses by inserting user records, the attempt to create a user is rejected. |
| UserRoleId | string | The ID of the user’s UserRole. Label is Role ID. |
### salesforce-get-org

***
Returns organization details from the case number.

#### Base Command

`salesforce-get-org`

#### Input

| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| caseNumber | The case number of the case. | Optional |

#### Context Output

| **Path** | **Type** | **Description** |
| --- | --- | --- |
| ID | string | The unique ID of the case. |
| Name | string | Name of the account. Required. Label is Account Name. Maximum size is 255 characters. If the account has a record type of Person Account, this value is the concatenation of the FirstName, MiddleName, LastName, and Suffix of the associated person contact. You cannot modify this value. |
8 changes: 6 additions & 2 deletions Packs/Salesforce/Integrations/Salesforce/Salesforce.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ var URI_PREFIX = '/services/data/v39.0/';
var SESSION_DATA = '';

function getNewToken() {
var client_id = params.credentials_client_secret !== null ? params.credentials_client_secret.identifier : params.clientID;
var client_secret = params.credentials_client_secret !== null ? params.credentials_client_secret.password : params.clientSecret;
if (client_id === null || client_secret === null)
return('Consumer Key and Consumer Secret must be provided.')
var request = {
grant_type: 'password',
client_id: params.clientID,
client_secret: params.clientSecret,
client_id: client_id,
client_secret: client_secret,
username: params.credentials.identifier,
password: params.credentials.password
};
Expand Down
11 changes: 9 additions & 2 deletions Packs/Salesforce/Integrations/Salesforce/Salesforce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ configuration:
name: clientID
defaultvalue: ""
type: 0
required: true
required: false
hidden: true
- display: Consumer Secret
name: clientSecret
defaultvalue: ""
type: 4
required: true
required: false
hidden: true
- display: Consumer Key
displaypassword: Consumer Secret
name: credentials_client_secret
required: false
type: 9
- display: Trust any certificate (not secure)
name: insecure
type: 8
Expand Down
11 changes: 7 additions & 4 deletions Packs/Salesforce/Integrations/Salesforce_IAM/Salesforce_IAM.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import demistomock as demisto
from CommonServerPython import *
import urllib3


# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
urllib3.disable_warnings()


DEFAULT_OUTGOING_MAPPER = "User Profile - Salesforce (Outgoing)"
Expand Down Expand Up @@ -397,9 +399,10 @@ def main():

username = params.get('credentials').get('identifier')
password = params.get('credentials').get('password')
client_id = params.get('consumer_key')
client_secret = params.get('consumer_secret')

client_id = params.get('credentials_consumer', {}).get('identifier') or params.get('consumer_key')
client_secret = params.get('credentials_consumer', {}).get('password') or params.get('consumer_secret')
if not (client_id and client_secret):
return_error('Consumer Key and Consumer Secret must be provided.')
verify_certificate = not params.get('insecure', False)
proxy = params.get('proxy', False)

Expand Down
14 changes: 11 additions & 3 deletions Packs/Salesforce/Integrations/Salesforce_IAM/Salesforce_IAM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ configuration:
type: 9
- display: Consumer Key
name: consumer_key
required: true
required: false
type: 4
hidden: true
- display: Consumer Secret
name: consumer_secret
required: true
required: false
type: 4
hidden: true
- display: Consumer Key
name: credentials_consumer
required: false
type: 9
displaypassword: Consumer Secret
section: Connect
- display: Trust any certificate (not secure)
name: insecure
required: false
Expand Down Expand Up @@ -279,7 +287,7 @@ script:
description: Retrieves a User Profile schema which holds all of the user fields within the application. Used for outgoing-mapping through the Get Schema option.
execution: false
name: get-mapping-fields
dockerimage: demisto/python3:3.10.5.31797
dockerimage: demisto/python3:3.10.12.62631
feed: false
isfetch: false
longRunning: false
Expand Down
9 changes: 9 additions & 0 deletions Packs/Salesforce/ReleaseNotes/2_0_13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

#### Integrations

##### Salesforce IAM
- Added the *Consumer Key* and *Consumer Secret* integration parameters to support credentials fetching object.
- Updated the Docker image to: *demisto/python3:3.10.12.62631*.

##### Salesforce
Added the *Consumer Key* and *Consumer Secret* integration parameters to support credentials fetching object.
2 changes: 1 addition & 1 deletion Packs/Salesforce/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Salesforce",
"description": "CRM Services",
"support": "xsoar",
"currentVersion": "2.0.12",
"currentVersion": "2.0.13",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down