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

feat: improved error message and updated error code for PrintTopics command #3246

Merged
merged 2 commits into from
Aug 22, 2019

Conversation

stevenpyzhang
Copy link
Member

Description

print <topic> returns a 200 response with a not too specific error message when trying to print a topic the user doesn't have Read permissions for. Updated to return 403 response, 40301 error code, and a more specific error message.

Old response
Not authorized to access topics: [qwerqwerqwerqwerqtly]

New response

{
    "@type": "generic_error",
    "error_code": 40301,
    "message": "Authorization denied to Read on topic(s): [qwerqwerqwerqwerqtly]",
    "stackTrace": []
}

Testing done

Unit test
Local testing

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@stevenpyzhang stevenpyzhang requested a review from a team as a code owner August 21, 2019 21:31
}

@Test
public void shouldPrintTopicWithoutReadPermissionsDenied() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: shouldThrowWhenPrintTopicWithReadPermissionsDenied

Copy link
Member

@spena spena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spena spena requested a review from a team August 22, 2019 18:50
@stevenpyzhang stevenpyzhang merged commit 4b94f22 into confluentinc:master Aug 22, 2019
@stevenpyzhang stevenpyzhang deleted the print-topic-acls branch August 22, 2019 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants