Skip to content

Update json payload query support #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 21, 2024
Merged

Conversation

fimac
Copy link
Contributor

@fimac fimac commented Oct 21, 2024

Updates the payload to include a q value.

Adds query functions to use for each type to serialize the query into the required format.

Updates goeql tests.

Points eql sql install to central release folder that contains the latest sql for eql.

assert.Equal(t, newExample.EncryptedIntField, example.EncryptedIntField, "EncryptedIntField does not match")
assert.Equal(t, newExample.EncryptedTextField, example.EncryptedTextField, "EncryptedTextField does not match")
assert.Equal(t, newExample.EncryptedJsonbField, example.EncryptedJsonbField, "EncryptedJsonbField does not match")
assert.Equal(t, newExample.NonEncryptedField, returnedExample.NonEncryptedField, "NonEncryptedField does not match")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated these assertions as the expected value should be the first value in the assertion.

func assert.Equal(t assert.TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool

EncryptedIntField: 23,
EncryptedTextField: "another string that shouldn't be returned",
EncryptedJsonbField: jsonData,
},
Copy link
Contributor Author

@fimac fimac Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added another example to insert to ensure failures are picked up

https://cipherstash.slack.com/archives/C05CX3G2YQY/p1729475070543969

@@ -119,7 +125,7 @@ func TestMatchQueryLongString(t *testing.T) {
t.Errorf("Expected has to equal true, got: %v", has)
}

assert.Equal(t, returnedExample.EncryptedTextField, EncryptedTextField("this is a long string"), "EncryptedTextField should match")
assert.Equal(t, EncryptedTextField("this is a long string"), returnedExample.EncryptedTextField, "EncryptedTextField should match")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, expected should be first in the assertion

@fimac fimac marked this pull request as ready for review October 21, 2024 03:37
@fimac fimac force-pushed the feat/update-json-payload-query-support branch from c74b111 to 9366f2e Compare October 21, 2024 04:21
Copy link
Contributor

@auxesis auxesis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @fimac, thanks for putting this together.

I have added some commits to simplify and make the code and docs a little more idiomatic.

@fimac fimac merged commit 23733c0 into main Oct 21, 2024
1 check passed
@fimac fimac deleted the feat/update-json-payload-query-support branch October 21, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants