macadmins / osquery-extension

An osquery extension for endpoint engineers
Apache License 2.0
97 stars 32 forks source link

ensure cached DEP status is read if a check was made in the last 24 hours #38

Closed grahamgilbert closed 1 year ago

grahamgilbert commented 1 year ago

the condition to evaluate if the cached value should be read was wrong, causing the mdm table to invoke profiles show --type enrollment almost every time it was called.

this changeset fixes the condition and adds tests for this specific scenario.

This was originally submitted in https://github.com/macadmins/osquery-extension/pull/37

github-actions[bot] commented 1 year ago

LCOV of commit ff6c817 during Test Coverage #12

Summary coverage rate:
  lines......: 43.0% (246 of 572 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate:
                                                   |Lines       |Functions  |Branches    
  Filename                                         |Rate     Num|Rate    Num|Rate     Num
  =======================================================================================
  tables/mdm/mdm.go                                |40.6%    180|    -     0|    -      0