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

fix: allow regular users to push files#4500

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
sreya merged 6 commits intomainfromjon/fixfileperms
Oct 13, 2022
Merged

fix: allow regular users to push files#4500

sreya merged 6 commits intomainfromjon/fixfileperms
Oct 13, 2022

Conversation

sreya
Copy link
Collaborator

@sreyasreya commentedOct 12, 2022
edited
Loading

  • As part of merging support for Template RBAC
    and user groups a permission check on reading files
    was relaxed.

    With the addition of admin roles on individual templates, regular
    users are now able to push template versions if they have
    inherited the 'admin' role for a template. In order to do so
    they need to be able to create and read their own files. Since
    collisions on hash in the past were ignored, this means that a regular user
    who pushes a template version with a file hash that collides with
    an existing hash will not be able to read the file (since it belongs to
    another user).

    This commit fixes the underlying problem which was that
    the files table had a primary key on the 'hash' column.
    This was not a problem at the time because only template
    admins and other users with similar elevated roles were
    able to read all files regardless of ownership. To fix this
    a new column and primary key 'id' has been introduced to the files
    table. The unique constraint has been updated to be hash+created_by.
    Tables (provisioner_jobs) that referenced files.hash have been updated
    to reference files.id. Relevant API endpoints have also been updated.

fixes#4415

- As part of merging support for Template RBAC  and user groups a permission check on reading files  was relaxed.  With the addition of admin roles on individual templates, regular  users are now able to push template versions if they have  inherited the 'admin' role for a template. In order to do so  they need to be able to create and read their own files. Since  collisions on hash in the past were ignored, this means that a regular user  who pushes a template version with a file hash that collides with  an existing hash will not be able to read the file (since it belongs to  another user).  This commit fixes the underlying problem which was that  the files table had a primary key on the 'hash' column.  This was not a problem at the time because only template  admins and other users with similar elevated roles were  able to read all files regardless of ownership. To fix this  a new column and primary key 'id' has been introduced to the files  table. The unique constraint has been updated to be hash+created_by.  Tables (provisioner_jobs) that referenced files.hash have been updated  to reference files.id. Relevant API endpoints have also been updated.
@sreyasreya requested a review froma team as acode ownerOctober 12, 2022 01:23
@sreyasreya requested review fromjsjoeio and removed request fora teamOctober 12, 2022 01:23
@sreyasreya requested review fromkylecarbs andEmyrk and removed request forjsjoeioOctober 12, 2022 01:37
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. PR comment is great.

@sreyasreya merged commit4e57b9f intomainOct 13, 2022
@sreyasreya deleted the jon/fixfileperms branchOctober 13, 2022 23:02
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 13, 2022
@mafredri
Copy link
Member

Should we mark this a breaking change or add backwards compat? It looks like it prevents newer clients from uploading to previous versions of the server (the error is not very user friendly):

> Create and upload "docker-image-builds"? (yes/no) yesinvalid UUID length: 64Run 'coder templates create --help' for usage.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

template permissions: user withadmin access cannot push or pull a template
3 participants
@sreya@mafredri@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp