Skip to content

Commit

Permalink
Better ATC and FileCategory IDs attribute names
Browse files Browse the repository at this point in the history
  • Loading branch information
np5 committed Mar 2, 2023
1 parent 64f19b0 commit 6c538bb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion goztl.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
libraryVersion = "0.1.16"
libraryVersion = "0.1.17"
userAgent = "goztl/" + libraryVersion
mediaType = "application/json"
)
Expand Down
8 changes: 4 additions & 4 deletions osquery_configurations.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ type OsqueryConfiguration struct {
InventoryEC2 bool `json:"inventory_ec2"`
InventoryInterval int `json:"inventory_interval"`
Options map[string]interface{} `json:"options"`
ATCs []int `json:"automatic_table_constructions"`
FileCategories []int `json:"file_categories"`
ATCIDs []int `json:"automatic_table_constructions"`
FileCategoryIDs []int `json:"file_categories"`
Created Timestamp `json:"created_at,omitempty"`
Updated Timestamp `json:"updated_at,omitempty"`
}
Expand All @@ -56,8 +56,8 @@ type OsqueryConfigurationRequest struct {
InventoryEC2 bool `json:"inventory_ec2"`
InventoryInterval int `json:"inventory_interval"`
Options map[string]interface{} `json:"options"`
FileCategories []int `json:"file_categories"`
ATCs []int `json:"automatic_table_constructions"`
ATCIDs []int `json:"automatic_table_constructions"`
FileCategoryIDs []int `json:"file_categories"`
}

type listOCOptions struct {
Expand Down
28 changes: 14 additions & 14 deletions osquery_configurations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func TestOsqueryConfigurationsService_List(t *testing.T) {
InventoryEC2: false,
InventoryInterval: 600,
Options: map[string]interface{}{"config_refresh": 120.0},
ATCs: []int{},
FileCategories: []int{},
ATCIDs: []int{},
FileCategoryIDs: []int{},
Created: Timestamp{referenceTime},
Updated: Timestamp{referenceTime},
},
Expand Down Expand Up @@ -143,8 +143,8 @@ func TestOsqueryConfigurationsService_GetByID(t *testing.T) {
InventoryEC2: false,
InventoryInterval: 600,
Options: map[string]interface{}{"config_refresh": 120.0},
ATCs: []int{1},
FileCategories: []int{1},
ATCIDs: []int{1},
FileCategoryIDs: []int{1},
Created: Timestamp{referenceTime},
Updated: Timestamp{referenceTime},
}
Expand Down Expand Up @@ -179,8 +179,8 @@ func TestOsqueryConfigurationsService_GetByName(t *testing.T) {
InventoryEC2: false,
InventoryInterval: 600,
Options: map[string]interface{}{"config_refresh": 120.0},
ATCs: []int{},
FileCategories: []int{},
ATCIDs: []int{},
FileCategoryIDs: []int{},
Created: Timestamp{referenceTime},
Updated: Timestamp{referenceTime},
}
Expand All @@ -201,8 +201,8 @@ func TestOsqueryConfigurationsService_Create(t *testing.T) {
InventoryEC2: false,
InventoryInterval: 600,
Options: map[string]interface{}{"config_refresh": 120.0},
ATCs: []int{1, 2},
FileCategories: []int{1, 2},
ATCIDs: []int{1, 2},
FileCategoryIDs: []int{1, 2},
}

mux.HandleFunc("/osquery/configurations/", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -234,8 +234,8 @@ func TestOsqueryConfigurationsService_Create(t *testing.T) {
InventoryEC2: false,
InventoryInterval: 600,
Options: map[string]interface{}{"config_refresh": 120.0},
ATCs: []int{1, 2},
FileCategories: []int{1, 2},
ATCIDs: []int{1, 2},
FileCategoryIDs: []int{1, 2},
Created: Timestamp{referenceTime},
Updated: Timestamp{referenceTime},
}
Expand All @@ -255,8 +255,8 @@ func TestOsqueryConfigurationsService_Update(t *testing.T) {
InventoryApps: true,
InventoryEC2: false,
InventoryInterval: 600,
ATCs: []int{1, 2, 3},
FileCategories: []int{1, 2, 3},
ATCIDs: []int{1, 2, 3},
FileCategoryIDs: []int{1, 2, 3},
Options: map[string]interface{}{"config_refresh": 120.0},
}

Expand Down Expand Up @@ -288,8 +288,8 @@ func TestOsqueryConfigurationsService_Update(t *testing.T) {
InventoryEC2: false,
InventoryInterval: 600,
Options: map[string]interface{}{"config_refresh": 120.0},
ATCs: []int{1, 2, 3},
FileCategories: []int{1, 2, 3},
ATCIDs: []int{1, 2, 3},
FileCategoryIDs: []int{1, 2, 3},
Created: Timestamp{referenceTime},
Updated: Timestamp{referenceTime},
}
Expand Down

0 comments on commit 6c538bb

Please sign in to comment.