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

[Marketplace Contribution] Okta v2 #28453

Merged
merged 16 commits into from
Jul 26, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 11 additions & 8 deletions Packs/Okta/Integrations/Okta_v2/Okta_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,13 @@ def poll_verify_push(self, url):
response['factorResult'] = "TIMEOUT"
return response

def search(self, term, limit):
def search(self, term, limit, advanced_search):
uri = "users"
query_params = {
'q': encode_string_results(term),
'limit': limit
}
query_params = assign_params(
limit=limit,
q=encode_string_results(term),
search=encode_string_results(advanced_search)
)
return self._http_request(
method='GET',
url_suffix=uri,
Expand Down Expand Up @@ -670,7 +671,6 @@ def test_module(client, args):
Returns:
'ok' if test passed, anything else will fail the test.
"""
args
uri = 'users/me'
client._http_request(method='GET', url_suffix=uri)
return 'ok', None, None
Expand Down Expand Up @@ -891,7 +891,10 @@ def search_command(client, args):
term = args.get('term')
limit = args.get('limit') or SEARCH_LIMIT
verbose = args.get('verbose')
raw_response = client.search(term, limit)
advanced_search = args.get('advanced_search', '')
if not term and not advanced_search:
raise DemistoException('Please provide either the term or advanced_search argument')
raw_response = client.search(term, limit, advanced_search)

if raw_response and len(raw_response) > 0:
users_context = client.get_users_context(raw_response)
Expand Down Expand Up @@ -1008,7 +1011,7 @@ def list_users_command(client, args):
'Account(val.ID && val.ID == obj.ID)': context,
'Okta.User(val.tag)': {'tag': after_tag}
}
return(
return (
readable_output,
outputs,
raw_response
Expand Down
9 changes: 6 additions & 3 deletions Packs/Okta/Integrations/Okta_v2/Okta_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,12 @@ script:
type: String
- arguments:
- default: true
description: Term by which to search. Can be a first name, last name, or email address.
description: Term by which to search. Can be a first name, last name, or email address. The argument `term` or `advanced_search` is required.
name: term
required: true
required: false
- description: Searches for users with a supported filtering expression for most properties, including custom-defined properties. The argument `term` or `advanced_search` is required.
name: advanced_search
required: false
- description: The maximum number of results to return. The default and maximum is 200.
name: limit
- auto: PREDEFINED
Expand Down Expand Up @@ -1403,7 +1406,7 @@ script:
name: appName
description: Assign a group to an application
name: okta-assign-group-to-app
dockerimage: demisto/python3:3.10.12.63474
dockerimage: demisto/python3:3.10.12.66339
runonce: false
script: '-'
subtype: python3
Expand Down
3 changes: 2 additions & 1 deletion Packs/Okta/Integrations/Okta_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ Searches for Okta users.

| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| term | Term by which to search. Can be a first name, last name, or email address. | Required |
| term | Term by which to search. Can be a first name, last name, or email address. The argument `term` or `advanced_search` is required. | Optional |
| advanced_search | Searches for users with a supported [filtering expression](https://developer.okta.com/docs/reference/core-okta-api/#filter) for most properties, including custom-defined properties. [Supported operators](https://developer.okta.com/docs/reference/core-okta-api/#operators). The argument `term` or `advanced_search` is required. | Optional |
| limit | The maximum number of results to return. The default and maximum is 200. | Optional |
| verbose | Whether to return details of users that match the found term. Can be "true" or "false". The default is "false". Possible values are: true, false. Default is false. | Optional |

Expand Down
6 changes: 6 additions & 0 deletions Packs/Okta/ReleaseNotes/3_1_25.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#### Integrations

##### Okta v2

- Updated the Docker image to: *demisto/python3:3.10.12.66339*.
- Added the argument **advanced_search** to the **okta-search** command, which enables the command to search for users based on user profile properties, including custom defined ones.
2 changes: 1 addition & 1 deletion Packs/Okta/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Okta",
"description": "Integration with Okta's cloud-based identity management service.",
"support": "xsoar",
"currentVersion": "3.1.24",
"currentVersion": "3.1.25",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down