-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Enhance ms teams functionalities part1 #37268
base: master
Are you sure you want to change the base?
Conversation
…nctionalities_part1
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work!
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
…s.py Co-authored-by: michal-dagan <[email protected]>
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.yml
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.yml
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.yml
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams_test.py
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams_test.py
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams_test.py
Outdated
Show resolved
Hide resolved
…s_test.py Co-authored-by: ShirleyDenkberg <[email protected]>
…s_test.py Co-authored-by: ShirleyDenkberg <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
…s_test.py Co-authored-by: ShirleyDenkberg <[email protected]>
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams.py
Outdated
Show resolved
Hide resolved
…s.py Co-authored-by: ShirleyDenkberg <[email protected]>
…s.py Co-authored-by: ShirleyDenkberg <[email protected]>
…s.py Co-authored-by: ShirleyDenkberg <[email protected]>
…s.py Co-authored-by: ShirleyDenkberg <[email protected]>
@@ -722,8 +723,11 @@ def get_graph_access_token() -> str: | |||
tenant_id = integration_context.get('tenant_id') | |||
if not tenant_id: | |||
raise ValueError( | |||
'Did not receive tenant ID from Microsoft Teams, verify the messaging endpoint is configured correctly. ' | |||
'See https://xsoar.pan.dev/docs/reference/integrations/microsoft-teams#troubleshooting for more information' | |||
'Did not receive a tenant ID from Microsoft Teams. Verify that the messaging endpoint in the Demisto bot ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe we're trying to avoid using the "Demisto" word. consult with @nkanon
@@ -2646,8 +2650,11 @@ def ring_user(): | |||
tenant_id: str = integration_context.get('tenant_id', '') | |||
if not tenant_id: | |||
raise ValueError( | |||
'Did not receive tenant ID from Microsoft Teams, verify the messaging endpoint is configured correctly. ' | |||
'See https://xsoar.pan.dev/docs/reference/integrations/microsoft-teams#troubleshooting for more information' | |||
'Did not receive a tenant ID from Microsoft Teams. Verify that the messaging endpoint in the Demisto bot ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate code, make it a constant.
roles = sorted(roles) | ||
hr = tableToMarkdown(f'The current API permissions in the Teams application are: ({len(roles)})', | ||
roles, headers=['Permission']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roles = sorted(roles) | |
hr = tableToMarkdown(f'The current API permissions in the Teams application are: ({len(roles)})', | |
roles, headers=['Permission']) | |
hr = tableToMarkdown(f'The current API permissions in the Teams application are: ({len(roles)})', | |
sorted(roles), headers=['Permission']) |
no need for transitive assignment.
else: | ||
hr = 'Graph access token is not set.' | ||
|
||
demisto.debug(f"'microsoft-teams-token-permissions-list' command result is: {hr}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also print the AUTH_TYPE
messaging_endpoint = urljoin(urljoin(xsoar_url, 'instance/execute'), instance_name) | ||
|
||
else: # XSIAM or XSOAR SAAS | ||
# Add the 'ext-' prefix to the xsoar url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a link to the CRTX ticket to platform, as to why we do this substitutions
# Replace the '.xdr-' with '.crtx-' for XSIAM tenants | ||
messaging_endpoint = messaging_endpoint.replace('.xdr-', '.crtx-', 1) | ||
|
||
hr = f"The messaging endpoint is:\n `{messaging_endpoint}`\n\n The messaging endpoint should be added to the Demisto bot"\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here for Demisto keyword.
'Client Credentials', | ||
'Graph access token is not set.') | ||
]) | ||
def test_token_permissions_list_command(mocker, token, decoded_token, auth_type, expected_hr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding ids to the tests.
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Related Issues
relates: CIAC-11459
Description
'microsoft-teams-token-permissions-list'
command which retrieves the API permissions list of the graph access token.'microsoft-teams-create-messaging-endpoint'
command which generates the correct messaging endpoint, based on the server URL and the instance configurations.Must have