Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

DEVICE-123 - Fetch more detailed mobile device information #143

Merged
merged 3 commits into from
Jun 16, 2023

Conversation

mknoedel
Copy link
Contributor

@mknoedel mknoedel commented Jun 15, 2023

Description

Summary

Fetch more detailed information about mobile devices and add it to the mobile Device entities. Also added lastSeenOn.

Type of change

Please leave any irrelevant options unchecked.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist

General Development Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Integration Development Checklist:

Please leave any irrelevant options unchecked.

  • I have checked for additional permissions required to call any new API
    endpoints, and have documented any additional permissions in
    jupiterone.md, where necessary.
  • My changes properly paginate the target service provider's API
  • My changes properly handle rate limiting of the target service provider's
    API
  • My new integration step is instrumented to execute in the correct order
    using dependsOn
  • I have referred to the
    JupiterOne data model
    to ensure that any new entities/relationships, and relevant properties,
    match the recommended model for this class of data
  • I have updated the CHANGELOG.md file to describe my changes
  • When changes include modifications to existing graph data ingestion, I've
    reviewed all existing managed questions referencing the entities,
    relationships, and their property names, to ensure those questions still
    function with my changes.

@mknoedel mknoedel requested a review from a team as a code owner June 15, 2023 16:27
/**
* Requires "Read - Mobile Devices" permission
*/
public async fetchMobileDeviceById(id: number): Promise<MobileDeviceDetail> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much like the computers endpoint, you need to individually call the detail view on mobile devices to get most of what we care about.

Comment on lines +36 to +43
const extensionAttributes = {};

// Prevent all extensionAttributes from being uploaded due to the size of the
// entities that can be generated as a result from uploading every property.
if (deviceDetail && deviceDetail.extension_attributes) {
extensionAttributes[`extensionAttribute.${DEPLOYMENT_STATUS}`] =
getDeploymentStatus(deviceDetail.extension_attributes);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was taken from the createComputerEntity and it looks like the extension properties are the same for mobile devices if you check the recordings.

Comment on lines +259 to +262
lastSeenOn: parseTimePropertyValue(
detailData?.general?.last_contact_time_epoch ?? device.report_date_epoch,
'ms',
),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to the report_date_epoch when we don't have detail data.

@mknoedel mknoedel changed the title Device-123 - Fetch more detailed mobile device information DEVICE-123 - Fetch more detailed mobile device information Jun 16, 2023
@adam-in-ict adam-in-ict added minor minor release release labels Jun 16, 2023
@mknoedel mknoedel merged commit 247d357 into main Jun 16, 2023
6 checks passed
@mknoedel mknoedel deleted the DEVICE-123-lastSeenOn branch June 16, 2023 19:44
@j1-internal-automation
Copy link
Collaborator

🚀 PR was released in v2.13.0 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants