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
4 changes: 2 additions & 2 deletions schemaregistry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and [Java](https://github.com/confluentinc/schema-registry) clients.
npm install @confluentinc/schemaregistry
```

# Getting Started
## Getting Started
Below is a simple example of using Avro serialization with the Schema Registry client and the KafkaJS client.
```javascript
const { Kafka } = require('@confluentinc/kafka-javascript').KafkaJS;
Expand Down Expand Up @@ -109,7 +109,7 @@ run().catch (async e => {

## Features and Limitations
- Full Avro and JSON Schema support
- Protobuf support requires (upcoming) release: CP 7.4.8, 7.5.7, 7.6.4, 7.7.2, 7.8.0
- Protobuf support requires Schema Registry in (upcoming) release: CP 7.4.8, 7.5.7, 7.6.4, 7.7.2, 7.8.0
- Support for CSFLE (Client-Side Field Level Encryption)
- Support for schema migration rules for Avro and JSON Schema
- Data quality rules are not yet supported
Expand Down
1 change: 1 addition & 0 deletions schemaregistry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './confluent/types/decimal_pb'
export * from './confluent/meta_pb'
export * from './rules/encryption/awskms/aws-driver'
export * from './rules/encryption/azurekms/azure-driver'
export * from './rules/encryption/dekregistry/dekregistry-client'
export * from './rules/encryption/gcpkms/gcp-driver'
export * from './rules/encryption/hcvault/hcvault-driver'
export * from './rules/encryption/localkms/local-driver'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface Dek {
deleted?: boolean;
}

interface Client {
interface DekClient {
registerKek(name: string, kmsType: string, kmsKeyId: string, shared: boolean,
kmsProps?: { [key: string]: string }, doc?: string): Promise<Kek>;
getKek(name: string, deleted: boolean): Promise<Kek>;
Expand All @@ -56,7 +56,7 @@ interface Client {
close(): Promise<void>;
}

class DekRegistryClient implements Client {
class DekRegistryClient implements DekClient {
private restService: RestService;
private kekCache: LRUCache<string, Kek>;
private dekCache: LRUCache<string, Dek>;
Expand All @@ -78,7 +78,7 @@ class DekRegistryClient implements Client {
this.dekMutex = new Mutex();
}

static newClient(config: ClientConfig): Client {
static newClient(config: ClientConfig): DekClient {
const url = config.baseURLs[0];
if (url.startsWith("mock://")) {
return new MockDekRegistryClient()
Expand Down Expand Up @@ -242,5 +242,5 @@ class DekRegistryClient implements Client {
}
}

export { DekRegistryClient, Client, Kek, Dek };
export { DekRegistryClient, DekClient, Kek, Dek };

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Client, Dek, Kek } from "./dekregistry-client";
import { DekClient, Dek, Kek } from "./dekregistry-client";
import { MOCK_TS } from "./constants";
import stringify from "json-stringify-deterministic";
import {RestError} from "../../../rest-error";

class MockDekRegistryClient implements Client {
class MockDekRegistryClient implements DekClient {
private kekCache: Map<string, Kek>;
private dekCache: Map<string, Dek>;

Expand Down
4 changes: 2 additions & 2 deletions schemaregistry/rules/encryption/encrypt-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
RuleError,
} from "../../serde/serde";
import {RuleMode,} from "../../schemaregistry-client";
import {Client, Dek, DekRegistryClient, Kek} from "./dekregistry/dekregistry-client";
import {DekClient, Dek, DekRegistryClient, Kek} from "./dekregistry/dekregistry-client";
import {RuleRegistry} from "../../serde/rule-registry";
import {ClientConfig} from "../../rest-service";
import {RestError} from "../../rest-error";
Expand Down Expand Up @@ -61,7 +61,7 @@ export class Clock {
}

export class FieldEncryptionExecutor extends FieldRuleExecutor {
client: Client | null = null
client: DekClient | null = null
clock: Clock

/**
Expand Down
2 changes: 1 addition & 1 deletion schemaregistry/serde/rule-registry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {RuleAction, RuleExecutor} from "./serde";

/**
*
* RuleRegistry is used to register and fetch rule executors and actions.
*/
export class RuleRegistry {
private ruleExecutors: Map<string, RuleExecutor> = new Map<string, RuleExecutor>()
Expand Down