Skip to content

Commit 251a10a

Browse files
authored
Rename DekClient to avoid conflict with Client (#112)
* Minor cleanup * Rename DekClient
1 parent 790b5e2 commit 251a10a

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

schemaregistry/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and [Java](https://github.com/confluentinc/schema-registry) clients.
1212
npm install @confluentinc/schemaregistry
1313
```
1414

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

110110
## Features and Limitations
111111
- Full Avro and JSON Schema support
112-
- Protobuf support requires (upcoming) release: CP 7.4.8, 7.5.7, 7.6.4, 7.7.2, 7.8.0
112+
- Protobuf support requires Schema Registry in (upcoming) release: CP 7.4.8, 7.5.7, 7.6.4, 7.7.2, 7.8.0
113113
- Support for CSFLE (Client-Side Field Level Encryption)
114114
- Support for schema migration rules for Avro and JSON Schema
115115
- Data quality rules are not yet supported

schemaregistry/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export * from './confluent/types/decimal_pb'
22
export * from './confluent/meta_pb'
33
export * from './rules/encryption/awskms/aws-driver'
44
export * from './rules/encryption/azurekms/azure-driver'
5+
export * from './rules/encryption/dekregistry/dekregistry-client'
56
export * from './rules/encryption/gcpkms/gcp-driver'
67
export * from './rules/encryption/hcvault/hcvault-driver'
78
export * from './rules/encryption/localkms/local-driver'

schemaregistry/rules/encryption/dekregistry/dekregistry-client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ interface Dek {
4646
deleted?: boolean;
4747
}
4848

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

59-
class DekRegistryClient implements Client {
59+
class DekRegistryClient implements DekClient {
6060
private restService: RestService;
6161
private kekCache: LRUCache<string, Kek>;
6262
private dekCache: LRUCache<string, Dek>;
@@ -78,7 +78,7 @@ class DekRegistryClient implements Client {
7878
this.dekMutex = new Mutex();
7979
}
8080

81-
static newClient(config: ClientConfig): Client {
81+
static newClient(config: ClientConfig): DekClient {
8282
const url = config.baseURLs[0];
8383
if (url.startsWith("mock://")) {
8484
return new MockDekRegistryClient()
@@ -242,5 +242,5 @@ class DekRegistryClient implements Client {
242242
}
243243
}
244244

245-
export { DekRegistryClient, Client, Kek, Dek };
245+
export { DekRegistryClient, DekClient, Kek, Dek };
246246

schemaregistry/rules/encryption/dekregistry/mock-dekregistry-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Client, Dek, Kek } from "./dekregistry-client";
1+
import { DekClient, Dek, Kek } from "./dekregistry-client";
22
import { MOCK_TS } from "./constants";
33
import stringify from "json-stringify-deterministic";
44
import {RestError} from "../../../rest-error";
55

6-
class MockDekRegistryClient implements Client {
6+
class MockDekRegistryClient implements DekClient {
77
private kekCache: Map<string, Kek>;
88
private dekCache: Map<string, Dek>;
99

schemaregistry/rules/encryption/encrypt-executor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
RuleError,
99
} from "../../serde/serde";
1010
import {RuleMode,} from "../../schemaregistry-client";
11-
import {Client, Dek, DekRegistryClient, Kek} from "./dekregistry/dekregistry-client";
11+
import {DekClient, Dek, DekRegistryClient, Kek} from "./dekregistry/dekregistry-client";
1212
import {RuleRegistry} from "../../serde/rule-registry";
1313
import {ClientConfig} from "../../rest-service";
1414
import {RestError} from "../../rest-error";
@@ -61,7 +61,7 @@ export class Clock {
6161
}
6262

6363
export class FieldEncryptionExecutor extends FieldRuleExecutor {
64-
client: Client | null = null
64+
client: DekClient | null = null
6565
clock: Clock
6666

6767
/**

schemaregistry/serde/rule-registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {RuleAction, RuleExecutor} from "./serde";
22

33
/**
4-
*
4+
* RuleRegistry is used to register and fetch rule executors and actions.
55
*/
66
export class RuleRegistry {
77
private ruleExecutors: Map<string, RuleExecutor> = new Map<string, RuleExecutor>()

0 commit comments

Comments
 (0)