Skip to content

Commit a744a82

Browse files
authored
First cut at Data Contract rules (#77)
* First cut at encryption rules (#74) * First cut at encryption rules * Add tests * Clean up package.json * Clean up package.json * Add kms clients * Minor fix * First cut at additional serde tests (#75) * First cut at additional serde tests * Add JSON test * Add protobuf ref test * Add format params * Checkpoint * Add coverage to gitignore * Remove coverage * Minor fix * Minor fix * Avro ref test * Add json ref test * Add nested tests * First cut at Data Contract rules * Remove CEL executors for now * Minor refactor to use RuleRegistry * Move DEK registry under encryption * Clean up package.json * Add CSFLE test with logical type * Minor fix * Add CEL executors * Revert "Add CEL executors" This reverts commit 850c3de. * Minor fixes * Minor fixes
1 parent 99d0c5e commit a744a82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8067
-1233
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
dist/
23
node_modules/
34
deps/librdkafka
45
npm-debug.log
@@ -15,3 +16,4 @@ deps/*
1516

1617
.idea
1718
.vscode
19+
coverage

Makefile.schemaregistry

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ TS_NODE ?= ./node_modules/.bin/ts-node
99
# Paths
1010
SRC_DIR = schemaregistry
1111
SR_TEST_DIR = test/schemaregistry
12-
DEK_TEST_DIR = test/schemaregistry/dekregistry
12+
DEK_TEST_DIR = test/schemaregistry/rules/encryption/dekregistry
1313
INTEG_DIR = e2e/schemaregistry
1414

1515
# Tasks

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ module.exports = {
33
'^.+\\.tsx?$': 'ts-jest',
44
},
55
};
6-

package-lock.json

Lines changed: 3463 additions & 945 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
},
3333
"license": "MIT",
3434
"devDependencies": {
35+
"@bufbuild/buf": "^1.37.0",
36+
"@bufbuild/protoc-gen-es": "^2.0.0",
3537
"@eslint/js": "^9.9.0",
3638
"@types/eslint__js": "^8.42.3",
37-
"@types/node": "^20.4.5",
39+
"@types/node": "^20.16.1",
3840
"bluebird": "^3.5.3",
3941
"eslint": "^8.57.0",
4042
"eslint-plugin-jest": "^28.6.0",
@@ -46,23 +48,27 @@
4648
"typescript-eslint": "^8.2.0"
4749
},
4850
"dependencies": {
49-
"@bufbuild/buf": "^1.37.0",
51+
"@aws-sdk/client-kms": "^3.637.0",
52+
"@azure/identity": "^4.4.1",
53+
"@azure/keyvault-keys": "^4.8.0",
5054
"@bufbuild/protobuf": "^2.0.0",
51-
"@bufbuild/protoc-gen-es": "^2.0.0",
5255
"@criteria/json-schema": "^0.10.0",
5356
"@criteria/json-schema-validation": "^0.10.0",
57+
"@google-cloud/kms": "^4.5.0",
5458
"@hackbg/miscreant-esm": "^0.3.2-patch.3",
5559
"@mapbox/node-pre-gyp": "^1.0.11",
60+
"@smithy/types": "^3.3.0",
5661
"@types/validator": "^13.12.0",
5762
"ajv": "^8.17.1",
5863
"async-mutex": "^0.5.0",
5964
"avsc": "^5.7.7",
6065
"axios": "^1.7.3",
6166
"bindings": "^1.3.1",
6267
"json-stringify-deterministic": "^1.0.12",
68+
"jsonata": "^2.0.5",
6369
"lru-cache": "^11.0.0",
64-
"miscreant": "^0.3.2",
6570
"nan": "^2.17.0",
71+
"node-vault": "^0.10.2",
6672
"ts-jest": "^29.2.4",
6773
"validator": "^13.12.0"
6874
},
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
message LinkedList {
7+
int32 value = 1;
8+
LinkedList next = 10;
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
import "test/schemaregistry/serde/test.proto";
7+
8+
message DependencyMessage {
9+
bool is_active = 1;
10+
TestMessage test_messsage = 2;
11+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
import "confluent/meta.proto";
7+
8+
message Author {
9+
string name = 1 [
10+
(confluent.field_meta).tags = "PII"
11+
];
12+
int32 id = 2;
13+
bytes picture = 3 [
14+
(confluent.field_meta).tags = "PII"
15+
];
16+
repeated string works = 4;
17+
}
18+
19+
message Pizza {
20+
string size = 1;
21+
repeated string toppings = 2;
22+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
import "google/protobuf/timestamp.proto";
7+
8+
message UserId {
9+
oneof user_id {
10+
string kafka_user_id = 1;
11+
int32 other_user_id = 2;
12+
MessageId another_id = 3;
13+
}
14+
}
15+
16+
message MessageId {
17+
string id = 1;
18+
}
19+
20+
enum Status {
21+
ACTIVE = 0;
22+
INACTIVE = 1;
23+
}
24+
25+
message ComplexType {
26+
oneof some_val {
27+
string one_id = 1;
28+
int32 other_id = 2;
29+
}
30+
bool is_active = 3;
31+
}
32+
33+
/*
34+
* Complex message using nested protos and repeated fields
35+
*/
36+
message NestedMessage {
37+
UserId user_id = 1;
38+
bool is_active = 2;
39+
repeated string experiments_active = 3;
40+
google.protobuf.Timestamp updated_at = 4;
41+
Status status = 5;
42+
ComplexType complex_type = 6;
43+
map<string, string> map_type = 7;
44+
InnerMessage inner = 8;
45+
46+
message InnerMessage {
47+
string id = 1 [json_name="id"];
48+
repeated int32 ids = 2 [packed=true];
49+
}
50+
51+
enum InnerEnum {
52+
option allow_alias = true;
53+
ZERO = 0;
54+
ALSO_ZERO = 0;
55+
}
56+
57+
reserved 14, 15, 9 to 11;
58+
reserved "foo", "bar";
59+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
message NewerWidget {
7+
string name = 1;
8+
int32 length = 2;
9+
int32 version = 3;
10+
}

0 commit comments

Comments
 (0)