kafka-ops / julie

A solution to help you build automation and gitops in your Apache Kafka deployments. The Kafka gitops!
MIT License
421 stars 114 forks source link

Unrecognized field "subject" #403

Closed DanielMabbett closed 2 years ago

DanielMabbett commented 2 years ago

Describe the bug

We are seeing some strange behaviour when using the latest docker image and creating a custom role for the schema registry

This is what we are seeing on error:

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "subject" (class com.purbon.kafka.topology.model.users.Other), not marked as ignorable (6 known properties: "transactionId", "idempotence", "principal", "metadata", "group", "topic"])

This is our custom role:

  - name: "schemaRegistryPrefix"
    acls:
      - resourceType: "Subject"
        resourceName: "{{subject}}"
        patternType: "PREFIXED"
        host: "*"
        role: "ResourceOwner"

This is our topology file:

---
context: ""
source: ""
projects:
  - name: ""
    schemaRegistryPrefix:
      - principal: "User:svc-account"
        subject: "test.subject."

To Reproduce Steps to reproduce the behavior:

  1. Create the files above
  2. Using the latest docker image, create the custom role binding
  3. See error

Expected behavior Creation of the custom role binding

Screenshots n/a

Runtime (please complete the following information): n/a

Additional context Add any other context about the problem here.

purbon commented 2 years ago

Problem is identified here by missing subject alias in this context https://github.com/kafka-ops/julie/blob/master/src/main/java/com/purbon/kafka/topology/model/users/Other.java#L24-L32

related to #401

shahriar52 commented 2 years ago

I am also keen to get this solution both for the schema/subject and the connectors. Also, that would require RBAC scope to be extended to the schema-registry and the connector cluster.

purbon commented 2 years ago

Hi @shahriar52, this has a simple solution, it is required to extend the properties included in the referenced Other object. Contributions are very much welcome!, otherwise I will push a fix as soon as I collect a couple of hours available ;-)

purbon commented 2 years ago

Thanks, @shahriar52 and @DanielMabbett this would be fixed with the merge of #406. This future will be included in the next release.