hpgrahsl / kryptonite-for-kafka

Kryptonite for Kafka is a client-side 🔒 field level 🔓 cryptography library for Apache Kafka® offering a Kafka Connect SMT, ksqlDB UDFs, and a standalone HTTP API service. It's an ! UNOFFICIAL ! community project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot decrypt int64 (long) fields

wdutkiewicz opened this issue · comments

Hi, @hpgrahsl

I encountered an error when trying to decrypt fields of type long (INT64). I believe there is a bug in TypeSchemaMapper.java

Map<Type, Supplier<SchemaBuilder>> DEFAULT_MAPPINGS_DECRYPT =
      Map.of(
          Type.BOOLEAN, SchemaBuilder::bool,
          Type.INT8, SchemaBuilder::int8,
          Type.INT16, SchemaBuilder::int16,
          Type.INT32, SchemaBuilder::int32,
          Type.INT64, SchemaBuilder::int16,
          Type.FLOAT32, SchemaBuilder::float32,
          Type.FLOAT64, SchemaBuilder::float64,
          Type.STRING, SchemaBuilder::string,
          Type.BYTES, SchemaBuilder::bytes
      );

INT64 is mapped to int16 - shouldn't it be int64?

Yes, good catch. That's a bug indeed. THX for reporting this.

Will be addressed in the next (patch) release.

@wdutkiewicz Find the patch release here https://github.com/hpgrahsl/kryptonite-for-kafka/releases/tag/v0.4.2 Give it a try and let me know if this solves the reported issue.