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

RBAC: Return the underlying error instead of internal server or bad request for managed permission endpoints #80974

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

IevaVasiljeva
Copy link
Contributor

What is this feature?

Change the manage permission endpoints to return the underlying errutil error (if any) instead of 500/400 in all cases.

Why do we need this feature?

This makes the returned errors more accurate and informative, and makes it easier for external tooling to work with Grafana's managed permissions. Eg, Terraform processes not found errors differently than internal server errors.

Who is this feature for?

Mostly internal/external devs

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@IevaVasiljeva IevaVasiljeva added this to the 10.4.x milestone Jan 22, 2024
@IevaVasiljeva IevaVasiljeva requested review from kalleep and a team January 22, 2024 12:11
@IevaVasiljeva IevaVasiljeva requested review from a team as code owners January 22, 2024 12:11
@IevaVasiljeva IevaVasiljeva requested review from undef1nd, suntala and idafurjes and removed request for a team January 22, 2024 12:11
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to my PR, but came up when I generated the specs. I think it should've been included in this PR but was accidentally left out. Correct me if I'm wrong @dmihai

@IevaVasiljeva IevaVasiljeva changed the title RBAC: return the underlying error instead of internal server or bad request for managed permission endpoints RBAC: Return the underlying error instead of internal server or bad request for managed permission endpoints Jan 22, 2024
@IevaVasiljeva IevaVasiljeva merged commit dc9e590 into main Jan 25, 2024
24 checks passed
@IevaVasiljeva IevaVasiljeva deleted the ieva/return-correct-error branch January 25, 2024 16:24
rwwiv pushed a commit that referenced this pull request Jan 25, 2024
…equest for managed permission endpoints (#80974)

* return not found instead of an internal server error when listing/updating permissions

* openapi gen
Ukochka pushed a commit that referenced this pull request Feb 14, 2024
…equest for managed permission endpoints (#80974)

* return not found instead of an internal server error when listing/updating permissions

* openapi gen
@aangelisc aangelisc modified the milestones: 10.4.x, 10.4.0 Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants