-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix: validate CLI using REST / instead of REST /info #3197
Conversation
Hey @spena I'm having trouble understanding why this is different. Doesn't ksql/ksql-rest-app/src/main/java/io/confluent/ksql/rest/server/resources/RootDocument.java Line 45 in 147336a
|
@vcrfxia That line just returns a response to the caller about the new location the caller must be redirected. It does not do the redirection automatically unless your client manages that. For instance, a Web browser will look into the HTTP response to see if there is a new location that needs to be redirected. Here's what CURL gets:
|
To check that I understand correctly, you're saying that if a user has access to Can you call out the fact that this is a breaking change by adding |
That's correct @vcrfxia Regarding the breaking change, I'm not sure I'm breaking something here. The CLI will continue working as before. No new output is added or modified. If something is broken, that would be on the REST endpoint authorization which is handled by an external authorization library which is not exposed in this code. Or what do you think would break? |
"Breaking change" doesn't mean anything is broken, but rather that the PR introduces backwards-incompatible behavior. The behavior that's changed here is that previously CLI startup permissions were based on whether the user has access to |
thanks @vcrfxia . I used your same comment in the breaking change in this PR. You used the right words to describe it :). What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @spena -- LGTM! Friendly reminder to propagate the "BREAKING CHANGE: [...]" text from the PR description into the commit message body when you merge the PR :)
8ddfa33
to
3339c7a
Compare
I'll force the merge. Jenkins is failing on the Twislockscan phase, which seems flaky. |
BREAKING CHANGE: Previously CLI startup permissions were based on whether the user has access to
/info
, but now it's based on whether the user has access to/
. This change implies that if a user has permissions to/
but not/info
, they now have access to the CLI whereas previously they did not.Description
The CLI currently makes a call to
GET /info
to validate if a client can connect to the KSQL server. If the server is not authorized to access the endpoint, then the CLI displays the correct access error (or any other access) on the console.With the introduction of the KSQL security extensions, these REST endpoints might have different access restrictions. For instance, the
GET /info
call might be opened to any authenticated user to get information about the KSQL server (such as KSQL and Kafka clusters IDs) and send the info to the KSQL admins to request access this KSQL server. Because of this, then the CLI will never show if a user is authorized to access the server during the CLI initialization.To improve this CLI message, we should validate the client using the
GET /
endpoint instead. This endpoint is not used and looks like a dummy endpoint.Testing done
Reviewer checklist