-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Online license verification #15147
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
Online license verification #15147
Conversation
Codecov ReportBase: 61.68% // Head: 61.60% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #15147 +/- ##
==========================================
- Coverage 61.68% 61.60% -0.08%
==========================================
Files 1365 1369 +4
Lines 33729 33808 +79
Branches 6472 6501 +29
==========================================
+ Hits 20807 20829 +22
- Misses 11107 11149 +42
- Partials 1815 1830 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the code I see a big issue: we can't switch from EE to CE at runtime and that's what this PR is assuming.
We need to stop the start of the app at the 1st online check if the license is expired the user will have to clear their env or licnese file to start in CE.
After normal startup when the app is running we need to do something as the app can't just switch to CE. What was specified for this?
d0004ab to
37145fd
Compare
|
I would like to point out some potential discrepancies. As of today, the permissions are registered only during startup. This includes permissions related to EE features. It's something we can tackle later, or we would need to rework the way the permissions are registered and cleared now if it's blocking us from merging this PR. |
a476c6d to
ecc4551
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! nicely done
ecc4551 to
8a6a81d
Compare
|
FYI the diff currently includes the entire audit logs feature, because #15536 is not merged yet |
f4056ae to
c8441a7
Compare
b690a9b to
a4c0d24
Compare
Use ee_store instead of the core_store Use ee_store instead of the core_store
a4c0d24 to
a0b344e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed all the diff, but the changes related to audit logs look good to me ✅
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: |
What does it do?
It introduces an online verification of the license, which consists of the following:
strapi.EEis read, the local license is verified to ensure that Strapi generated it, then the project is optimistically considered licensed.This is needed as the license state is used to determine which admin panel version to build.
Also, the content of the license is checked to enable the right features and verify the expiration date. At this step, the project can switch back to the community edition.
@alexandrebodin introduced a wrapper and a middleware to ensure that EE features could not be consumed on an unlicensed project even if the EE admin panel was used.
Why is it needed?
The offline system that we are currently using has its limitations.
For instance, a user has to restart the app after updating the project's license whenever the feature he/she has access to changes since the content of the license would be outdated.
How to test it?
You can make sure that you're project is licensed when using a valid license and that only one outbound call should be made, even when starting your project across multiple processes.
It should be working on every supported database, SQLite doesn't support the
FOR UPDATEsyntax, so when multiple processes are started simultaneously, multiple requests will be sent.It's not a big deal, as SQLite should be used in production rarely.
What's missing?
This PR was co-authored with @alexandrebodin.