Skip to content

Commit

Permalink
Align credentials stores part 12 (#27255)
Browse files Browse the repository at this point in the history
* Align credentials stores part 12

* fix

* fix

* undoing last change

* docker image

* docker

* fix

* raise error
  • Loading branch information
maimorag authored and MosheEichler committed Jul 2, 2023
1 parent d3a1536 commit 21616fc
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 14 deletions.
2 changes: 0 additions & 2 deletions Packs/Looker/.pack-ignore
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
[file:Looker.yml]
ignore=IN145
9 changes: 6 additions & 3 deletions Packs/Looker/Integrations/Looker/Looker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import requests
import traceback
import json
import urllib3

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


''' CONSTANTS '''
Expand All @@ -20,8 +21,8 @@

''' GLOBALS/PARAMS '''
SESSION_VALIDITY_THRESHOLD = timedelta(minutes=MAX_TIMEOUT_MINUTES)
CLIENT_ID = demisto.params().get('client_id')
CLIENT_SECRET = demisto.params().get('client_secret')
CLIENT_ID = demisto.params().get('credentials_api3_client', {}).get('identifier') or demisto.params().get('client_id')
CLIENT_SECRET = demisto.params().get('credentials_api3_client', {}).get('password') or demisto.params().get('client_secret')
# Remove trailing slash to prevent wrong URL path to service
SERVER = demisto.params()['url'][:-1] if (demisto.params()['url']
and demisto.params()['url'].endswith('/')) else demisto.params()['url']
Expand Down Expand Up @@ -401,6 +402,8 @@ def create_look(query_id, space_id, look_title, look_description=""):

def main():
LOG('Command being called is %s' % (demisto.command()))
if not(CLIENT_ID and CLIENT_SECRET):
raise DemistoException('API3 Client ID and Secret must be provided.')
try:
handle_proxy()
verify_url(SERVER)
Expand Down
11 changes: 9 additions & 2 deletions Packs/Looker/Integrations/Looker/Looker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ configuration:
type: 0
- display: API3 Client Secret
name: client_secret
required: true
required: false
type: 4
hidden: true
- display: API3 Client ID
name: credentials_api3_client
required: false
type: 9
displaypassword: API3 Client Secret
section: Connect
- display: Trust any certificate (not secure)
name: unsecure
required: false
Expand Down Expand Up @@ -262,7 +269,7 @@ script:
- contextPath: Looker.Look.LastUpdated
description: The time that the look was last updated.
type: Date
dockerimage: demisto/python3:3.9.8.24399
dockerimage: demisto/python3:3.10.12.63474
isfetch: false
runonce: false
script: '-'
Expand Down
6 changes: 6 additions & 0 deletions Packs/Looker/ReleaseNotes/1_0_6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### Looker
- Added the *API3 Client ID* and *API3 Client Secret* integration parameters to support credentials fetching object.
- Updated the Docker image to: *demisto/python3:3.10.12.63474*.
2 changes: 1 addition & 1 deletion Packs/Looker/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Looker",
"description": "Use the Looker integration to query an explore, save queries as looks, run looks, and fetch look results as incidents.",
"support": "xsoar",
"currentVersion": "1.0.5",
"currentVersion": "1.0.6",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
2 changes: 1 addition & 1 deletion Packs/ServiceDeskPlus/.pack-ignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[file:ServiceDeskPlus.yml]
ignore=IN126,IN145
ignore=IN126

[file:README.md]
ignore=RM104
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,11 +833,16 @@ def generate_refresh_token(client: Client, args: Dict) -> Tuple[str, dict, Any]:
def main():
params = demisto.params()
server_url = params.get('server_url')
technician_key = params.get('credentials_technician_key', {}).get(
'password') or params.get('technician_key')
client_id = params.get('credentials_client', {}).get('identifier') or params.get('client_id')
client_secret = params.get('credentials_client', {}).get('password') or params.get('client_secret')
refresh_token = params.get('credentials_refresh_token', {}).get('password') or params.get('refresh_token')
if server_url == 'On-Premise':
client = Client(url=params.get('server_url_on_premise') + API_VERSION,
use_ssl=not params.get('insecure', False),
use_proxy=params.get('proxy', False),
technician_key=params.get('technician_key'),
technician_key=technician_key,
fetch_time=params.get('first_fetch') if params.get('first_fetch') else '7 days',
fetch_status=params.get('fetch_status'),
fetch_limit=int(params.get('max_fetch')) if params.get('max_fetch') else 50,
Expand All @@ -848,9 +853,9 @@ def main():
client = Client(url=server_url + API_VERSION,
use_ssl=not params.get('insecure', False),
use_proxy=params.get('proxy', False),
client_id=params.get('client_id'),
client_secret=params.get('client_secret'),
refresh_token=params.get('refresh_token'),
client_id=client_id,
client_secret=client_secret,
refresh_token=refresh_token,
fetch_time=params.get('fetch_time') if params.get('fetch_time') else '7 days',
fetch_status=params.get('fetch_status'),
fetch_limit=int(params.get('fetch_limit')) if params.get('fetch_limit') else 50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ configuration:
name: technician_key
required: false
type: 4
hidden: true
- displaypassword: Technician Key
name: credentials_technician_key
required: false
hiddenusername: true
type: 9
- defaultvalue: https://example.com
display: On-Premise Server URL
name: server_url_on_premise
Expand All @@ -28,14 +34,28 @@ configuration:
name: client_id
required: false
type: 4
hidden: true
- display: Client Secret
name: client_secret
required: false
type: 4
hidden: true
- display: Client ID
name: credentials_client
required: false
type: 9
displaypassword: Client Secret
section: Connect
- display: Refresh Token
name: refresh_token
required: false
type: 4
hidden: true
- displaypassword: Refresh Token
name: credentials_refresh_token
required: false
hiddenusername: true
type: 9
- display: Trust any certificate (not secure)
name: insecure
required: false
Expand Down
9 changes: 9 additions & 0 deletions Packs/ServiceDeskPlus/ReleaseNotes/2_0_17.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

#### Integrations

##### Service Desk Plus
Added the following integration parameters to support credentials fetching object:
- *Technician Key*
- *Client ID*
- *Client Secret*
- *Refresh Token*
2 changes: 1 addition & 1 deletion Packs/ServiceDeskPlus/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Manage Engine Service Desk Plus",
"description": "IT service management.",
"support": "xsoar",
"currentVersion": "2.0.16",
"currentVersion": "2.0.17",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit 21616fc

Please sign in to comment.