CBG-4117: Add type checking to mandatory audit fields during event validation #7011
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CBG-4117
Previously #6987
Ensures that the type for the field in the event declaration matches the one actually being passed (when validating during devmode)
Caught a few instances of fields not matching their definitions and potential bugs as a result:
AuditFieldPayload
in some cases was taking either[]byte
or a struct, instead ofstring
[]byte
will be a base64 encoded string in JSON)handlePutDbAuditConfig
was printing the resulting config, rather than the request payload.string
vs.bool
for a minor difference in output.AuditFieldID
switched touint32
in all placesint
anduint64
types, but 32bit uints are plenty to represent audit IDsAuditFieldTimestamp
time.Time
->string
expandFields
now writes aRFC3339
formatted timestamp directly, instead of relying on the underlying JSON marshalling oftime.Time
. Gives us better control of format.Integration Tests
GSI=true,xattrs=true
https://jenkins.sgwdev.com/job/SyncGateway-Integration/2614/