Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #842 Pass GitHub access token when accessing raw.githubuserconten…
…t.com in case of private recipes (aivus) This PR was merged into the 1.x branch. Discussion ---------- Pass GitHub access token when accessing raw.githubusercontent.com in case of private recipes I'm checking how to use private symfony recipes and found that `symfony/flex` is not using GH access token when accessing `raw.githubcontent.com`. For a public repositories it's not a case, but for private repositories it's not possible to access the recipe template url from `raw.githubcontent.com` without using access token. Adding access token for requests to `api.github.com` is [covered by Composer](https://github.com/composer/composer/blob/f5ffedfe60b5b0043c368b91e656288517aad0d9/src/Composer/Util/AuthHelper.php#L210-L215), but it doesn't cover downloading files from `raw.githubcontent.com`. This PR introduces logic for adding token for requests to `raw.githubcontent.com` in the [similar way as composer does](https://github.com/composer/composer/blob/f5ffedfe60b5b0043c368b91e656288517aad0d9/src/Composer/Util/AuthHelper.php#L210-L215) for `api.github.com`. Limitations: * Current implementation adds the token (if it presents) to ALL requests to the `raw.githubusercontent.com`, but I don't think that it's a big issue actually. Commits ------- d7dd781 Pass GitHub access token when accessing raw.githubusercontent.com
- Loading branch information