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

New dependencies on licensed extensions are not covered by existing licenses when upgrading licensed extensions #174

Open
raphj opened this issue Jun 19, 2024 · 1 comment

Comments

@raphj
Copy link
Contributor

raphj commented Jun 19, 2024

When upgrading a licensed extension with a new dependency to another licensed extension, the newly added dependency is not covered by the existing valid license. i.e the existing valid license for the "parent" extension is not considered valid for the dependency.

This caused xwikisas/xwiki-pro-macros#286. The bug can also be reproduced with xwikisas/xwiki-pro-macros#78 (which has gone unnoticed so far).

The dependencies need to be reanalyzed when upgrading extensions, and the new artifact ids need to be added to the valid license.

When handling this, please remove or adjust the workaround added at xwikisas/xwiki-pro-macros#286 (xwikisas/xwiki-pro-macros@c242742) on Pro Macros

@mflorea
Copy link
Contributor

mflorea commented Jun 20, 2024

The list of dependencies that should be covered by the license are included in the license when it is generated. So if we add paid deps after the license was generated, we currently need to re-generate the license to have the updated list of deps.

On the licensing application side, we could detect when a license needs to be re-generated. E.g.:

  • have an extension upgrade listener that catches licensed extension upgrades
  • collect the list of licensed deps for both the previous and new extension version (the one being upgraded)
  • if the two list differs then make a call to store to regenerate the license then fetch the license from the store and apply it

By re-generate the license I mean: create a new license page with the updated "Dependent Extension Ids" field and with expiration date increased by 1 second. Have a safety measure to block such a request if the previous license was generated very recently (less than X time ago, like 1h or 1 day). The store could also do the same check as the client instance and only re-generate if the deps have changed.

@oanalavinia oanalavinia self-assigned this Jun 20, 2024
@snazare snazare moved this to In Progress in ProAppsRoadmapAug-Sep2024 Aug 6, 2024
@snazare snazare added P1 and removed P1 labels Aug 6, 2024
oanalavinia added a commit that referenced this issue Oct 2, 2024
…icenses when upgrading licensed extensions #174

* first working version, before refactoring
oanalavinia added a commit that referenced this issue Oct 2, 2024
…icenses when upgrading licensed extensions #174

* code refactorings
oanalavinia added a commit that referenced this issue Oct 7, 2024
…icenses when upgrading licensed extensions #174

* added unit tests
* moved TrialLicenseGeneratorTest to junit5
oanalavinia added a commit that referenced this issue Oct 14, 2024
…icenses when upgrading licensed extensions #174

* added debug logs
* handle better response from store, which will also contain the license
oanalavinia added a commit that referenced this issue Oct 14, 2024
…icenses when upgrading licensed extensions #174

* do post request for renewing licenses
oanalavinia added a commit that referenced this issue Oct 16, 2024
…icenses when upgrading licensed extensions #174

* refactor + add unit tests
* handle ExtensionInstalledEvent
oanalavinia added a commit that referenced this issue Oct 18, 2024
…icenses when upgrading licensed extensions #174

* add store renew URL config property
* add changes needed for the regenerateLicense code, in order to update the dependenyFeatureIds all the time, not only when they are not defined
* start the renew license process only if there is a license already assigned
oanalavinia added a commit that referenced this issue Oct 22, 2024
…icenses when upgrading licensed extensions #174

* consider also the case where there were some dependencies changes at some point and these were not updated on the license + unit tests
oanalavinia added a commit that referenced this issue Oct 23, 2024
…icenses when upgrading licensed extensions #174

* only trigger renew if a top level extension is upgraded
* fix bugs on code used on store: regenerate license for specific version, equals qas not working because it checks order as well, issueDate was not updated
oanalavinia added a commit that referenced this issue Oct 24, 2024
…icenses when upgrading licensed extensions #174

* description update
oanalavinia added a commit that referenced this issue Oct 29, 2024
…icenses when upgrading licensed extensions #174

* refactoring and adding comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

4 participants