Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.21
go 1.26
12 changes: 6 additions & 6 deletions plugin/table/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ type ColumnType string
// The following column types are defined in osquery tables.h.
const (
ColumnTypeUnknown ColumnType = "UNKNOWN"
ColumnTypeText = "TEXT"
ColumnTypeInteger = "INTEGER"
ColumnTypeBigInt = "BIGINT"
ColumnTypeUnsignedBigInt = "UNSIGNED BIGINT"
ColumnTypeDouble = "DOUBLE"
ColumnTypeBlob = "BLOB"
ColumnTypeText ColumnType = "TEXT"
ColumnTypeInteger ColumnType = "INTEGER"
ColumnTypeBigInt ColumnType = "BIGINT"
ColumnTypeUnsignedBigInt ColumnType = "UNSIGNED BIGINT"
ColumnTypeDouble ColumnType = "DOUBLE"
ColumnTypeBlob ColumnType = "BLOB"
)

// jsonString returns the value used when marshaling ColumnType to JSON
Expand Down
17 changes: 10 additions & 7 deletions plugin/table/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ func TestTable_Spec(t *testing.T) {
expected string
}{
{
name: "single text column",
plugin: NewPlugin("simple", []ColumnDefinition{TextColumn("simple_text")}, mockGenerate),
name: "single text column",
plugin: NewPlugin("simple", []ColumnDefinition{TextColumn("simple_text")}, mockGenerate,
WithPlatforms(DarwinPlatform),
),
expected: `{
"name": "simple",
"cacheable": false,
Expand All @@ -40,7 +42,9 @@ func TestTable_Spec(t *testing.T) {
IntegerColumn("pid"),
BigIntColumn("size"),
DoubleColumn("score"),
}, mockGenerate),
}, mockGenerate,
WithPlatforms(DarwinPlatform),
),
expected: `{
"name": "mixed",
"cacheable": false,
Expand All @@ -61,7 +65,9 @@ func TestTable_Spec(t *testing.T) {
plugin: NewPlugin("opts", []ColumnDefinition{
TextColumn("key", IndexColumn(), RequiredColumn()),
IntegerColumn("count", HiddenColumn()),
}, mockGenerate),
}, mockGenerate,
WithPlatforms(DarwinPlatform),
),
expected: `{
"name": "opts",
"cacheable": false,
Expand Down Expand Up @@ -103,9 +109,6 @@ func TestTable_Spec(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if len(tt.plugin.platforms) == 0 {
tt.plugin.platforms = []platformName{DarwinPlatform}
}
generatedSpec := tt.plugin.Spec()

var expectedSpec OsqueryTableSpec
Expand Down