Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throws java.lang.IllegalArgumentException while execute the julie command #559

Open
VICT0RW0NG opened this issue Nov 28, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@VICT0RW0NG
Copy link

Describe the bug
We are trying to use Julie to manage the Kafka artifacts and RBAC rules for Confluent 7.1.1. About the RBAC setting in Confluent we are using User / Group Principle to set the rules for different artifacts (e.g, topic , connectors etc.). Once we execute the julie script, it throws Throws java.lang.IllegalArgumentException , suspect that we have some special characters has been set in the group principle shown in the reproduce section. After that we based on the API shown in the error log and perform API testing via postman , we can get the principle details.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command docker run --network host -v /mnt/c/julie/foo_demo/production:/foo_demo purbon/kafka-topology-builder:4.4.1 julie-ops-cli.sh --clientConfig /foo_demo/project-config.properties --topology /foo_demo/topology.yaml --brokers hk01lconfbkr01vp.aswatson.net:9093,hk01lconfbkr02vp.aswatson.net:9093,hk01lconfbkr03vp.aswatson.net:9093
  2. Console error log
09:48:27.498 [main] DEBUG org.apache.kafka.clients.admin.KafkaAdminClient - [AdminClient clientId=adminclient-1] Kafka admin client closed.
java.lang.IllegalArgumentException: Illegal character in path at index 107: https://hk01lconfbkr01vp.aswatson.net:8090/security/1.0/principals/Group:s-ConRBAC.PROD.Techlab,OU=Security Groups,OU=Groups,OU=HK,OU=Regions,DC=aswgroup/roles/DeveloperRead/resources
        at java.base/java.net.URI.create(URI.java:883)
        at com.purbon.kafka.topology.clients.JulieHttpClient.setupARequest(JulieHttpClient.java:71)
        at com.purbon.kafka.topology.clients.JulieHttpClient.postRequest(JulieHttpClient.java:176)
        at com.purbon.kafka.topology.clients.JulieHttpClient.doPost(JulieHttpClient.java:171)
        at com.purbon.kafka.topology.api.mds.MDSApiClient.lookupResources(MDSApiClient.java:292)
        at com.purbon.kafka.topology.api.mds.MDSApiClient.lookupResourcesForKafka(MDSApiClient.java:274)
        at com.purbon.kafka.topology.roles.RBACProvider.listAcls(RBACProvider.java:72)
        at com.purbon.kafka.topology.AccessControlManager.printCurrentState(AccessControlManager.java:393)
        at com.purbon.kafka.topology.JulieOps.run(JulieOps.java:216)
        at com.purbon.kafka.topology.JulieOps.run(JulieOps.java:227)
        at com.purbon.kafka.topology.CommandLineInterface.processTopology(CommandLineInterface.java:212)
        at com.purbon.kafka.topology.CommandLineInterface.run(CommandLineInterface.java:161)
        at com.purbon.kafka.topology.CommandLineInterface.main(CommandLineInterface.java:147)
Caused by: java.net.URISyntaxException: Illegal character in path at index 107: https://hk01lconfbkr01vp.aswatson.net:8090/security/1.0/principals/Group:s-ConRBAC.PROD.Techlab,OU=Security Groups,OU=Groups,OU=HK,OU=Regions,DC=aswgroup/roles/DeveloperRead/resources
        at java.base/java.net.URI$Parser.fail(URI.java:2913)
        at java.base/java.net.URI$Parser.checkChars(URI.java:3084)
        at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3166)
        at java.base/java.net.URI$Parser.parse(URI.java:3114)
        at java.base/java.net.URI.<init>(URI.java:600)
        at java.base/java.net.URI.create(URI.java:881)
        ... 12 more

Expected behavior
Expected that would not throws an error, we have tried to attempt the same API via postman, it can return successfully,

Screenshots
Error throws in the Console
image

Postman
image

Runtime (please complete the following information):
Julie version: 4.4.1
Docker

@VICT0RW0NG VICT0RW0NG added the bug Something isn't working label Nov 28, 2022
@dwimsey
Copy link

dwimsey commented Dec 16, 2022

Looks like the space in between the Security Groups OU is likely the problem - its not being URI encoded before being passed to the Http request library.

String url = "/security/1.0/principals/" + principal + "/roles/" + role + "/resources";

URI encoding for these values will need to be done to fix this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants