Spring Cloud Schema Registry独立服务器的安全性

时间:2020-08-31 03:46:35

标签: apache-kafka registry schema spring-cloud avro

我能够运行Spring Cloud Schema Registry独立服务器(数据库已嵌入H2以进行测试)和Spring Cloud Stream Kafka Avro Producer和Kafka Avro Consumer(均使用Spring Cloud Schema Registry客户端库)。现在,我想将安全性应用于生产者/消费者-因此,我考虑在向架构的Registry Server发出HTTP请求时,在请求标头中使用令牌(可能是OAuth2)。我在Spring Boot项目中为restTemplate bean创建了一个拦截器,该拦截器将在请求发送到Schema Registry服务器之前插入令牌。但是,当我查看生产者/消费者的日志时,发现在创建restTemplate bean之前已发布了对Spring Cloud Schema Registry服务器的HTTP请求:

o.s.web.client.RestTemplate           : HTTP POST http://localhost:8990
  1. 有没有一种方法可以配置Schema Registry客户端以使用我的restTemplate bean,以便我可以插入令牌?

  2. 如果您正在使用独立的Schema Registry服务器(出于许可的原因,我无法使用Confluent Registry服务器),那么如何应用安全性?

我正在使用Spring Boot 2.2.4和spring-cloud-schema-registry-core 1.0.0,spring-cloud-schema-registry-server 1.0.0,spring-cloud-schema-registry-client 1.0.0

谢谢

0 个答案:

没有答案