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

refactor(dbauthz): add authz for system-level functions#6513

Merged
johnstcn merged 16 commits intomainfrom
cj/dbauthz-system
Mar 10, 2023
Merged

refactor(dbauthz): add authz for system-level functions#6513
johnstcn merged 16 commits intomainfrom
cj/dbauthz-system

Conversation

@johnstcn
Copy link
Member

@johnstcnjohnstcn commentedMar 8, 2023
edited
Loading

  • Introduces rbac.ResourceSystem
  • Grants system.* to system and provisionerd rbac subjects
  • Updates dbauthz system queries where applicable

Note: I'm skipping provisionerd and provisionerjob-related functions; we need to add RBAC resources for these. Will create a follow-up PR for this.

- Introduces rbac.ResourceSystem- Grants system.* to system and provisionerd rbac subjects
…st user, and when registering InMemoryProvisionerd
@johnstcnjohnstcn marked this pull request as ready for reviewMarch 9, 2023 16:55
@@ -282,11 +282,6 @@ func (s *MethodTestSuite) TestProvsionerJob() {
check.Args(database.UpdateProvisionerJobWithCancelByIDParams{ID: j.ID}).
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Note: most of the changes here are just moving the respective tests tosystem_test.go to keep things consistent.

return fetch(q.log, q.auth, q.db.GetUserByID)(ctx, id)
}

// GetUsersByIDs is only used for usernames on workspace return data.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Note: Moved this to querier from system and set a simple authz check here. I can move it back to system but it's probably better to use rbac.ResourceUser here.

Copy link
Member

Choose a reason for hiding this comment

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

Fair 👍.

codersdk.FeatureExternalProvisionerDaemons: 1,
},
})
srv, err := client.ServeProvisionerDaemon(context.Background(), user.OrganizationID, []codersdk.ProvisionerType{
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

note: updated this test to use a separate user from owner

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

This looks good to me. Only one observation which seems fairly minor for now anyway.

Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

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

LG, glad we protect these now.

return fetch(q.log, q.auth, q.db.GetUserByID)(ctx, id)
}

// GetUsersByIDs is only used for usernames on workspace return data.
Copy link
Member

Choose a reason for hiding this comment

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

Fair 👍.

@johnstcnjohnstcn merged commit144f374 intomainMar 10, 2023
@johnstcnjohnstcn deleted the cj/dbauthz-system branchMarch 10, 2023 18:09
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 10, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri approved these changes

@EmyrkEmyrkEmyrk approved these changes

Assignees

@johnstcnjohnstcn

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@johnstcn@mafredri@Emyrk

[8]ページ先頭

©2009-2026 Movatter.jp