Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: Rbac errors should be returned, and not hidden behind 404#7122

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 5 commits intomainfromstevenmasley/rbac_error
Apr 13, 2023

Conversation

@Emyrk
Copy link
Member

@EmyrkEmyrk commentedApr 13, 2023
edited
Loading

sql.ErrNoRows was hiding actual errors. This makes dbauthz return actual unauthorized errors, and the api just needs to check bothsql.ErrNoRows anddbauthz.IsUnauthorized to return a 404.

Fixes:#6774

@EmyrkEmyrk marked this pull request as ready for reviewApril 13, 2023 15:55

// nolint:gocritic // GetWorkspaceAppsByAgentIDs is a system function.
apps,err:=api.Database.GetWorkspaceAppsByAgentIDs(ctx,resourceAgentIDs)
apps,err:=api.Database.GetWorkspaceAppsByAgentIDs(dbauthz.AsSystemRestricted(ctx),resourceAgentIDs)
Copy link
Member

Choose a reason for hiding this comment

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

Ooops, I missed this

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The sql.ErrNoRows hid it☹️

@EmyrkEmyrk merged commit38e5b96 intomainApr 13, 2023
@EmyrkEmyrk deleted the stevenmasley/rbac_error branchApril 13, 2023 18:06
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 13, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees

@EmyrkEmyrk

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Fix DBAuthz return sql.ErrNoRows

3 participants

@Emyrk@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp