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

Allow any ref, not just tags or branches #83

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

mattwynne
Copy link

@mattwynne mattwynne commented Mar 15, 2021

The current regex for parsing a receive-pack payload assumes the ref will be of the form:

refs/tags/:tag-name
refs/heads/:branch-name

We'd like to be able to push arbitrary refs, like

refs/any/thing/we/like

The goal of this PR is to make that change, with tests and any neccesary changes to the outside API / internal model.

To do:

  • fix the regex so it works for any number of slashes/segments (currently assumes the form refs/one/two)
  • tests / API changes

gabrielcsapo and others added 27 commits November 10, 2017 10:39
* updates docs
- adds extensive docs to Git, Util and Service
- adds named function to events to trace errors more easily

* fixes req to be typed http.IncomingMessage
…eHead slightly. These three methods are now chainable. (gabrielcsapo#27)
- updates duplex lib to fix cork, uncork and add some chaining
- adds extensive docs to Git, Util and Service
- adds named function to events to trace errors more easily
* makes authenticate more flexible
- [BREAKING] changes the interface for authentication to make it more flexible
- when error is sent back to client ensure error is string

* updates readme and example

* adds README notice
- [BREAKING] changes the interface for authentication to make it more flexible
- when error is sent back to client ensure error is string
* fixes type to be the same as the event names

* updates changelog
* adds https support

* ensures options is set

* updates readme and adds example for https

* fixes lint

* documents git ssl override
- adds https support
* gitignore update for visual studio, Buffer Fix gabrielcsapo#38

* Update util.js

* Update service.js
- removes deprecated Buffer interface
- adds  functionality for event streams and response streams
- bump dependencies
  - tap ^11.0.1 -> ^12.5.3
  - tryitout ^2.0.6 -> ^2.1.1
It is currently possible to overwrite the `repoDir` by sending a repository name that starts with a "/", the `path.resolve` method prioritizes the second argument see the example below.

path.resolve("/my/repo/folder","/etc"); // /etc

This behavior gives an attacker the ability to create/write/pull repositories from an arbitrary absolute path, this issue could also impact authentication in some cases as it corrupts the repository name.
- Fixes bug with being able to overwrite git repos that a user doesn't have access to. @masasron
@mattwynne mattwynne changed the title Allow any ref, not just tags or branches Allow any ref, not just tags or branches (WIP) Mar 15, 2021
@mattwynne mattwynne marked this pull request as draft March 15, 2021 05:39
@mattwynne mattwynne changed the title Allow any ref, not just tags or branches (WIP) Allow any ref, not just tags or branches Mar 15, 2021
@gabrielcsapo
Copy link
Owner

This is great, any updates on tests @mattwynne ?

@mattwynne
Copy link
Author

I'm afraid I haven't had any time to give this attention since I shared my spike code. I got stuck on #81 - because I want to trust my environment before I start adding more tests.

@gabrielcsapo
Copy link
Owner

I can unblock you on that this weekend!

@gabrielcsapo
Copy link
Owner

@mattwynne tests should be fixed, CI is now running via GitHub actions!

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.

10 participants