kafka-ops / julie

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

v4.2.5 HybridCCloudAclsProvider does not translate principal ID properly #537

Open 92twinturboz opened 1 year ago

92twinturboz commented 1 year ago

Describe the bug When defining a principal in the topology as a service account resource ID (sa-XXXXXX) and specifying the com.purbon.kafka.topology.roles.HybridCCloudAclsProvider control class, the ACLs are created in confluent cloud with the sa-XXXXX id as opposed to the integer ID.

To Reproduce Steps to reproduce the behavior:

  1. Configure JuileOps with the following control class: topology.builder.access.control.class=com.purbon.kafka.topology.roles.HybridCCloudAclsProvider

  2. Create a topology and specify the sa-XXXXX principal ID: `context: "test" source: "topo" projects:

    • name: "julie" topics:
      • name: "acl.test.1.0" producers:
        • principal: "User:sa-12345" consumers:
        • principal: "User:sa-12345"`
  3. Run kafka-acls to validate the ACLs created: `kafka-acls --command-config ~/acl-cmd-config --list --bootstrap-server

Current ACLs for resource ResourcePattern(resourceType=TOPIC, name=test.topo.acl.test.1.0, patternType=LITERAL): (principal=User:sa-12345, host=, operation=READ, permissionType=ALLOW) (principal=User:sa-12345, host=, operation=WRITE, permissionType=ALLOW)

...`

Expected behavior The ACLs should be created with the equivalent integer ID.

Runtime (please complete the following information):

Additional context