Skip to content

Trusted Activities

class _incydr_sdk.trusted_activities.client.TrustedActivitiesV2(parent)

Client for /v2/trusted-activites endpoints.

Usage example:

>>> import incydr
>>> client = incydr.Client(**kwargs)
>>> client.trusted_activities.v2.get_page()
add_account_name(self, account_name, description=None, dropbox=False, one_drive=False)

Trust activity for a specific corporate account for cloud sync apps installed on user devices.

Parameters:

  • account_name: str (required) - Account name to trust for the specified cloud sync services.
  • description: str - Optional description of the trusted activity.
  • dropbox: bool - Whether to trust Dropbox as a cloud sync service. Defaults to False.
  • one_drive bool - Whether to trust OneDrive as a cloud sync service. Defaults to False.

At least 1 activity action group (dropbox, one_drive) is required to be trusted.

Returns: A TrustedActivity object representing the newly created trusted activity.

add_domain(self, domain, description=None, file_upload=None, cloud_sync_services=None, cloud_share_services=None, email_share_services=None, git_push=None)

Trust activity across an entire domain.

Parameters:

  • domain: str (required) - Domain to trust.
  • description: str - Optional description of the trusted activity.
  • file_upload: bool - Whether to trust activity if the tab URL or tab title includes this domain.
  • cloud_sync_services: List[CloudSyncApps] - Activity is trusted if the username signed in to the sync app is on this domain. Supported cloud storage apps for file syncing are BOX, GOOGLE_DRIVE, ICLOUD and/or ONE_DRIVE.
  • cloud_share_services: List[CloudShareApps] - Activity is trusted if the user it's shared with is on this domain. Supported cloud storage services for file sharing are BOX, GOOGLE_DRIVE and/or ONE_DRIVE. You must have a cloud connector configured for your tenant to support this trusted action.
  • email_share_services: List[EmailServices] - Activity is trusted if the email recipient is on this domain. Supported email services are GMAIL and/or MICROSOFT_365. You must have an email connector configured for your tenant to support this trusted action.
  • git_push: bool - Whether to trust Git push events to this domain.

Returns: A TrustedActivity object representing the newly created trusted activity.

add_git_repository(self, git_uri, description=None)

Trust file uploads to a git repository.

Parameters:

  • git_uri: str (required) - Git URI to trust (ex: bitbucket.org:exampleent/myrepo).
  • description: str - Optional description of the trusted activity.

Returns: A TrustedActivity object representing the newly created trusted activity.

add_slack_workspace(self, workspace_name, description=None)

Trust activity uploaded through a Slack workspace.

Parameters:

  • workspace_name: str (required) - Name of the Slack workspace to trust.
  • description: str - Optional description of the trusted activity.

Returns: A TrustedActivity object representing the newly created trusted activity.

add_url_path(self, url, description=None)

Trust browser uploads to only part of a domain by including a specific path. For example: github.com/company will only trust uploads to the company repository.

Parameters:

  • url: str (required) - URL path to trust (ex: example.com/path).
  • description: str - Optional description of the trusted activity.

Returns: A TrustedActivity object representing the newly created trusted activity.

delete(self, activity_id)

Delete a trusted activity.

Parameters:

  • activity_id int (required) - Unique ID for the trusted activity.

Usage example:

>>> client.trusted_activities.v2.delete(23)
<Response [200]>

Returns: A requests.Response indicating success.

get_page(self, page_num=1, page_size=None, activity_type=None, sort_key=None, sort_direction=None)

Get a page of trusted activities. Filter results by passing the appropriate parameters:

Parameters:

  • page_num: int - Page number for results, starting at 1.
  • page_size: int - Max number of results to return per page. Defaults to client's page_size setting.
  • activity_type: ActivityType - The type of the trusted activity.
  • sort_key: SortKeys - The key by which to sort the returned list.
  • sort_dir: SortDirection - The order in which to sort the returned list.

Returns: A TrustedActivitiesPage object.

get_trusted_activity(self, activity_id)

Get a single trusted activity.

Parameters:

  • activity_id: str (required) - The unique ID for the trusted activity.

Returns: A TrustedActivity object representing the trusted activity.

iter_all(self, page_size=None, activity_type=None, sort_key=None, sort_direction=None)

Iterate over all trusted activities.

Accepts the same parameters as .get_page() except page_num.

Returns: A generator yielding individual TrustedActivity objects.

update(self, trusted_activity)

Updates a trusted activity. The following fields can be updated:

  • description: A description of the trusted activity.
  • value: The value of the trusted activity, e.g. domain name or Slack workspace name.
  • type: The type of the trusted activity. One of ActivityType.
  • activity_action_group: The list of actions associated with the activity.

Parameters

  • trusted_activity: TrustedActivity (required) - The modified trusted activity object.

Usage example:

>>> activity = client.trusted_activities.get_trusted_activity(2)
>>> activity.description = "New description"
>>> client.trusted_activities.v2.update(activity)

Returns: A TrustedActivity object with updated values from server.