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

feat: adds enterprise license check #2431

Merged
merged 27 commits into from
May 7, 2024
Merged

Conversation

gupta-piyush19
Copy link
Contributor

What does this PR do?

Adds enterprise license check by calling the formbricks enterprise server for validation

Fixes

  • License check logic

How should this be tested?

  • set IS_FORMBRICKS_CLOUD = 0 in .env
  • set a valid ENTERPRISE_LICENSE_KEY provided by @jobenjada or @mattinannt
  • check the enterprise license status in settings(/settings/enterprise)

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented Apr 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
formbricks-cloud ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 1:24pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
formbricks-com ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 1:24pm
formbricks-docs ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 1:24pm

Copy link
Contributor

github-actions bot commented Apr 12, 2024

Thank you for following the naming conventions for pull request titles! 🙏

packages/ee/lib/service.ts Outdated Show resolved Hide resolved
packages/ee/lib/service.ts Outdated Show resolved Hide resolved
packages/ee/lib/service.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jonas-hoebenreich jonas-hoebenreich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to implement a fallback that ensures that the license is not deactivated by accident? When the the key is recognized as not valid due to an error (e.g. ee.formbricks.com has an outage or is buggy) suddenly all users will have admin rights and can do stupid things.
Possible solutions to ensure that a downtime of the license server does not affect all Enterprise installations:

  • Check the license status every hour, but only return invalid if it has never been valid in the past 6 hours
  • Show annoying banners in the backend to warn users that the licence key is invalid and enterprise features will be deactivated soon

@gupta-piyush19
Copy link
Contributor Author

Thanks, @jonas-hoebenreich, for the suggestion.
It makes sense to have a fault-tolerant system. I am thinking of adding a cached value for licence validity, such that if the enterprise server returns an erroneous value, we can rely on the cached value for up to 24 hours.

@mattinannt mattinannt marked this pull request as draft April 25, 2024 10:38
packages/ee/lib/service.ts Show resolved Hide resolved
@pandeymangg pandeymangg marked this pull request as ready for review May 6, 2024 11:50
@pandeymangg pandeymangg enabled auto-merge May 6, 2024 11:53
@pandeymangg pandeymangg added this pull request to the merge queue May 7, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 7, 2024
@mattinannt mattinannt added this pull request to the merge queue May 7, 2024
Merged via the queue into main with commit b016d80 May 7, 2024
12 checks passed
@mattinannt mattinannt deleted the piyush/enterprise-license-check branch May 7, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants