composer-envato icon indicating copy to clipboard operation
composer-envato copied to clipboard

Signed and expiring URL-s from Envato API get into composer.lock

Open szepeviktor opened this issue 5 years ago • 5 comments

    "packages": [
        {
            "name": "envato/layerslider-plugin",
            "version": "6.9.2",
            "dist": {
                "type": "zip",
                "url": "https://marketplace-downloads.customer.envatousercontent.com/files/270888641/layersliderwp-6.9.2.installable.zip?response-content-dispositio....."
            },
            "type": "wordpress-plugin"
        }
    ],

If Composer cache is cleared the download from this URL will fail.

$ composer install --prefer-dist --no-suggest
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
    Finished: success: 0, skipped: 0, failure: 1, total: 1
Package operations: 1 install, 0 updates, 0 removals
  - Installing envato/layerslider-plugin (6.9.2): Downloading (0%)    Authentication required (marketplace-downloads.customer.envatousercontent.com):
      Username:

szepeviktor avatar Feb 21 '20 10:02 szepeviktor

Is there a workaround for this?

dlecan avatar Mar 30 '20 07:03 dlecan

There are 2 things.

  1. if you keep local cache it works
  2. we may develop a CustomInstaller that does the download with a fresh URL

szepeviktor avatar Mar 30 '20 07:03 szepeviktor

@dlecan There is a solution, almost 100% implemented in https://github.com/ffraenz/private-composer-installer

  1. Put placeholder/s in distUrl
  2. Replace them on-the-fly

What do you think?

szepeviktor avatar Apr 05 '20 09:04 szepeviktor

:+1: Using environment variables is a good way to handle secrets. Do you need to update this plugin to use private-composer-installer? How to combine them together?

dlecan avatar Apr 05 '20 16:04 dlecan

I think we have to copy&develop as we shouldn't simply replace a placeholder but query Envato API for a fresh signed URL.

szepeviktor avatar Apr 05 '20 20:04 szepeviktor

I might work on this issue this week since I need consistent installation across our team and environments.

mcaskill avatar Feb 22 '23 23:02 mcaskill

All right. This started to be a simple plugin.

szepeviktor avatar Feb 23 '23 04:02 szepeviktor

I also expected this to be a simple endeavor 😆🤦‍♂️

mcaskill avatar Feb 23 '23 16:02 mcaskill