FundingCircle / jackdaw

A Clojure library for the Apache Kafka distributed streaming platform.
https://fundingcircle.github.io/jackdaw/
BSD 3-Clause "New" or "Revised" License
369 stars 80 forks source link

Using Schema Registry with basic auth #171

Open lurodrigo opened 5 years ago

lurodrigo commented 5 years ago

Does jackdaw provide a convenient way to use schema registry with basic auth? I think it's a good feature, considering it's how Confluent Cloud secures its Schema Registry instances.

After lots of source reading I was able to produce messages by instantiating a custom CachedSchemaRegistryClient object and passing it as :schema-registry-client, for instance:

(RestService. ^str "https://xxxxx.confluent.cloud")
(def cli (CachedSchemaRegistryClient. rs 200 (select-keys (basic-config) ["basic.auth.credentials.source" "schema.registry.basic.auth.user.info"])))
(def serde-resolver
  (partial resolver/serde-resolver :schema-registry-url (get (basic-config) "schema.registry.url")
           :schema-registry-client cli))
cddr commented 5 years ago

Yes I’d definitely like to make this more convenient and improving the documentation of the avro/confluent serde is high on my priority list.

neuromantik33 commented 2 years ago

Any updates on this? Confluent cloud basically enforces basic auth for its schema registry.