Skip to content

Add ref information to upload request #845

Closed

Description

@dluksza

Current upload request specification makes it hard to enforce branch based permissions in Gerrit. In order to enforce them Gerrit must first accept all incoming large files, then based on the pushed repository content either discard uploaded objects or keep them.

Such approach leads to waste of user's time, data transfer and server storage.

Adding destination ref information into upload request would solve this issue. Before sending back upload links Gerrit can check user access permissions to given ref, preventing or allowing large object upload.

Example upload request with ref information:

> POST https://git-lfs-server.com/objects/batch HTTP/1.1
> Accept: application/vnd.git-lfs+json
> Content-Type: application/vnd.git-lfs+json
> Authorization: Basic ... (if authentication is needed)
>
> {
>   "operation": "upload",
>   "ref": "refs/heads/master",
>   "objects": [
>     {
>       "oid": "1111111",
>       "size": 123
>     }
>   ]
> }
>

Activity

  1. technoweenie commented on Nov 19, 2015

    @technoweenie
    Contributor

    👍 Seems legit. This is something that existing implementations can ignore.

  2. rubyist commented on Nov 19, 2015

    @rubyist
    Contributor

    👍 here too

  3. brabil commented on Nov 19, 2015

    @brabil

    Would be interested in such feature.

  4. technoweenie commented on Nov 20, 2015

    @technoweenie
    Contributor

    I just added this to my Git LFS v1.2 list. Now since it's a simple addition that shouldn't affect things, it's likely it'll be in the next 1.1.x release. It really depends on how busy I am, and whether anyone else contributes the code instead :) Anyone that comments on this issue will get pinged on the pull request (unless you ask me not to).

  5. ttaylorr commented on Apr 16, 2018

    @ttaylorr
    Contributor

    This was implemented by @technoweenie in #2712.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions