Skip to content

Flex Private Recipe Repositories from local file #1069

@diogoslack

Description

@diogoslack

Hello!

I've created a Flex Private Recipe Repository for a project and it worked as expected, using GitHub. But since I can't use an external git repository (company policy), I have replicated it to the company internal bitbucket, but there is not possible to access the endpoint URL, because the bitbucket API requires an authentication and is not possible to remove it for security reasons.

A possible solution that I found was to require the recipe project in the main project (adding the private repository in composer.json) and having the 'endpoint' field with the file path instead of an URL.

  • composer.json
    "extra": { "symfony": { "allow-contrib": true, "require": "6.4.*", "endpoint": [ "./vendor/bundle-name/index.json", "flex://defaults" ] } },

  • index.json
    "_links": { "recipe_template_relative": "{package}/{version}/manifest.json" }

There is only one impediment for it to work: https://github.com/symfony/flex/blob/2.x/src/Downloader.php#L386
On that line is checking if the response status is 200, but in the case of the file, the status is 0.
If I change it to accept also the status 0, the recipe is executed as expected.

Do you think is possible to apply a change there? Or maybe suggest a different approach?

Thank you,
Diogo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions