Repository navigation
Commit e0f14b1
committed
feat(eql-codegen): print and log every Go EQL type redacted
A Go EQL value is the JSON its column stores: a stored value holds
ciphertext and terms, and a query value holds terms. Until now each type
was a bare []byte to fmt and slog, so %s or a log line wrote those bytes
out. The compiled predicate Match returns (#1443) is the first operand a
caller is likely to log whole, so every generated type now gets String,
Format and LogValue, written by eql-codegen beside Value and Scan so no
type can be missed. All three write one text, the type's name and
[redacted] (or {} when empty); Format answers every verb, %#v included,
so no GoString is generated. Value, MarshalJSON and a []byte or string
conversion still give the JSON.
The helpers (text, format, logValue) are hand-written in eql.go, so the
generated methods stay one-line block bodies gofmt leaves alone. A codegen
test checks every `type X []byte` the file declares has all three.1 parent 52802ef commit e0f14b1
4 files changed
Lines changed: 1824 additions & 9 deletions
File tree
- languages/golang/encrypt/eql
- packages/eql/crates/eql-codegen/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
0 commit comments