Skip to content

Commit 4cdb500

Browse files
authored
Add manager details Okta_v2 (#24372)
* fix * rn * docker * fix UT * remove space * conflicts
1 parent 3c9da4f commit 4cdb500

File tree

6 files changed

+39
-13
lines changed

6 files changed

+39
-13
lines changed

Packs/Okta/Integrations/Okta_v2/Okta_v2.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ def get_users_context(raw_users):
318318
'Created': user.get('created'),
319319
'Activated': user.get('activated'),
320320
'StatusChanged': user.get('statusChanged'),
321-
'PasswordChanged': user.get('passwordChanged')
321+
'PasswordChanged': user.get('passwordChanged'),
322+
'Manager': user.get('profile', {}).get('manager'),
323+
'ManagerEmail': user.get('profile', {}).get('managerEmail')
322324
}
323325
if user.get('group'):
324326
user['Group'] = user.get('group')
@@ -363,6 +365,8 @@ def get_readable_users(raw_users, verbose='false'):
363365
'Login': user.get('profile', {}).get('login'),
364366
'Email': user.get('profile', {}).get('email'),
365367
'Second Email': user.get('profile', {}).get('secondEmail'),
368+
'Manager': user.get('profile', {}).get('manager'),
369+
'Manager Email': user.get('profile', {}).get('managerEmail')
366370
}
367371
additionalData = {
368372
'ID': user.get('id'),
@@ -393,7 +397,9 @@ def get_readable_users(raw_users, verbose='false'):
393397
'Last Name': user.get('profile').get('lastName'),
394398
'Mobile Phone': user.get('profile').get('mobilePhone'),
395399
'Last Login': user.get('lastLogin'),
396-
'Status': user.get('status')
400+
'Status': user.get('status'),
401+
'Manager': user.get('profile', {}).get('manager'),
402+
'Manager Email': user.get('profile', {}).get('managerEmail')
397403
}
398404
users.append(user)
399405
return users

Packs/Okta/Integrations/Okta_v2/Okta_v2.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,12 @@ script:
409409
- contextPath: Account.PasswordChanged
410410
description: Timestamp for when the user's password was last changed.
411411
type: Date
412+
- contextPath: Account.Manager
413+
description: The manager.
414+
type: String
415+
- contextPath: Account.ManagerEmail
416+
description: The manager email.
417+
type: String
412418
deprecated: false
413419
execution: false
414420
- arguments:
@@ -2026,7 +2032,7 @@ script:
20262032
name: okta-assign-group-to-app
20272033
deprecated: false
20282034
execution: false
2029-
dockerimage: demisto/python3:3.10.9.42476
2035+
dockerimage: demisto/python3:3.10.9.46807
20302036
runonce: false
20312037
script: '-'
20322038
subtype: python3

Packs/Okta/Integrations/Okta_v2/Okta_v2_test.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"displayName": "test1",
3030
"secondEmail": "[email protected]",
3131
"login": "[email protected]",
32-
"email": "[email protected]"
32+
"email": "[email protected]",
33+
"manager": "manager",
34+
"managerEmail": "[email protected]"
3335
},
3436
"credentials": {
3537
"provider": {
@@ -617,13 +619,15 @@ def util_load_json(path: str):
617619
'Status': 'PROVISIONED', 'Type': 'Okta', 'Created': "2020-02-19T08:18:20.000Z",
618620
'Activated': "2020-02-20T11:44:43.000Z",
619621
'StatusChanged': "2020-02-20T11:45:24.000Z",
620-
'PasswordChanged': "2020-02-19T08:18:21.000Z"}, '[email protected]'),
622+
'PasswordChanged': "2020-02-19T08:18:21.000Z", "Manager": "manager", "ManagerEmail": "[email protected]"},
623+
621624
({"userId": "", "username": "[email protected]", "verbose": 'true'},
622625
{'ID': 'TestID', 'Username': '[email protected]', 'DisplayName': 'test this', 'Email': '[email protected]',
623626
'Status': 'PROVISIONED', 'Type': 'Okta', 'Created': "2020-02-19T08:18:20.000Z",
624627
'Activated': "2020-02-20T11:44:43.000Z",
625628
'StatusChanged': "2020-02-20T11:45:24.000Z",
626-
'PasswordChanged': "2020-02-19T08:18:21.000Z"}, 'Additional Data'),
629+
'PasswordChanged': "2020-02-19T08:18:21.000Z", "Manager": "manager", "ManagerEmail": "[email protected]"},
630+
'Additional Data'),
627631
]
628632
)
629633
def test_get_user_command(mocker, args, expected_context, expected_readable):
@@ -642,13 +646,15 @@ def test_get_user_command(mocker, args, expected_context, expected_readable):
642646
'Status': 'PROVISIONED', 'Type': 'Okta', 'Created': "2020-02-19T08:18:20.000Z",
643647
'Activated': "2020-02-20T11:44:43.000Z",
644648
'StatusChanged': "2020-02-20T11:45:24.000Z",
645-
'PasswordChanged': "2020-02-19T08:18:21.000Z"}, '[email protected]'),
649+
'PasswordChanged': "2020-02-19T08:18:21.000Z", "Manager": "manager", "ManagerEmail": "[email protected]"},
650+
646651
({"userId": "", "username": "[email protected]", "verbose": 'true'},
647652
{'ID': 'TestID', 'Username': '[email protected]', 'DisplayName': 'test this', 'Email': '[email protected]',
648653
'Status': 'PROVISIONED', 'Type': 'Okta', 'Created': "2020-02-19T08:18:20.000Z",
649654
'Activated': "2020-02-20T11:44:43.000Z",
650655
'StatusChanged': "2020-02-20T11:45:24.000Z",
651-
'PasswordChanged': "2020-02-19T08:18:21.000Z"}, 'Additional Data'),
656+
'PasswordChanged': "2020-02-19T08:18:21.000Z", "Manager": "manager", "ManagerEmail": "[email protected]"},
657+
'Additional Data'),
652658
]
653659
)
654660
def test_list_user_command(mocker, args, expected_context, expected_readable):

Packs/Okta/Integrations/Okta_v2/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ Fetches information for a single user. You must enter one or more parameters for
621621
| Account.Activated | Date | Timestamp for when the user was activated. |
622622
| Account.StatusChanged | Date | Timestamp for when the user's status was last changed. |
623623
| Account.PasswordChanged | Date | Timestamp for when the user's password was last changed. |
624-
624+
| Account.Manager | String | The manager. |
625+
| Account.ManagerEmail | String | The manager email. |
625626

626627
##### Command Example
627628
```!okta-get-user [email protected] verbose=true```
@@ -635,6 +636,8 @@ Fetches information for a single user. You must enter one or more parameters for
635636
"DisplayName": "test that",
636637
"Email": "[email protected]",
637638
"ID": "00uqk1qesl3k0SRbH0h7",
639+
"Manager": "[email protected]",
640+
"ManagerEmail": null,
638641
"PasswordChanged": "2020-03-26T13:56:50.000Z",
639642
"Status": "ACTIVE",
640643
"StatusChanged": "2020-03-26T13:56:52.000Z",
@@ -647,9 +650,9 @@ Fetches information for a single user. You must enter one or more parameters for
647650
##### Human Readable Output
648651
>### User:testForDocs@test.com
649652
>### Profile
650-
>|Email|First Name|Last Name|Login|Mobile Phone|Second Email|
651-
>|---|---|---|---|---|---|
652-
>| [email protected] | test | that | [email protected] | | |
653+
>|Email|First Name|Last Name|Login|Manager|Manager Email|Mobile Phone|Second Email|
654+
>|---|---|---|---|---|---|---|---|
655+
653656
654657
### Additional Data
655658
|Activated|Created|Credentials|ID|Last Login|Last Updated|Password Changed|Status|Status Changed|Type|_links|

Packs/Okta/ReleaseNotes/3_1_9.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
#### Integrations
3+
##### Okta v2
4+
- Updated the Docker image to: *demisto/python3:3.10.9.46807*.
5+
- Added the manager name and manager email to the outputs in the ***okta-get-user*** command.

Packs/Okta/pack_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Okta",
33
"description": "Integration with Okta's cloud-based identity management service.",
44
"support": "xsoar",
5-
"currentVersion": "3.1.8",
5+
"currentVersion": "3.1.9",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

0 commit comments

Comments
 (0)