Open
Conversation
This commit enables self-hosted instances to discover and purchase extensions through a centralized marketplace system. ## Database Changes - Convert registry_extension_purchases to polymorphic relationship - Add purchaser_uuid and purchaser_type columns - Add indexes for efficient polymorphic queries - Maintain backward compatibility with company_uuid ## Model Updates - Add polymorphic purchaser() relationship to RegistryExtensionPurchase - Support both Company and RegistryDeveloperAccount as purchasers - Maintain legacy company() relationship for backward compatibility ## Controller Updates - Update getStripeCheckoutSessionStatus to identify purchaser via: - Session company_uuid (cloud users) - Bearer token + RegistryUser (developer accounts) - Create purchase records with polymorphic purchaser data - Add listPublicExtensions() method with 15-minute caching ## New Public Endpoint - GET /~registry/v1/extensions - Publicly accessible extension listing - Returns all published extensions (free and paid) - Cached for performance and scalability - Enables self-hosted instances to discover extensions ## Benefits - Self-hosted users can view all available extensions - Developer accounts can purchase extensions without cloud subscription - Centralized payment processing maintains security - Clear monetization path for extension developers - Backward compatible with existing cloud user purchases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements the backend infrastructure for the Universal Extension Marketplace, enabling self-hosted Fleetbase instances to discover and purchase both free and paid extensions without requiring a cloud subscription.
Key Features
1. Public Extension Discovery
GET /~registry/v1/extensions2. Polymorphic Purchase System
3. Multi-Authentication Purchase Flow
company_uuid)Database Changes
Migration 1: Convert to Polymorphic
Migration 2: Add Indexes
Code Changes
Models
RegistryExtensionPurchase
purchaser()polymorphic relationshipcompany()for backward compatibilityControllers
RegistryExtensionController
listPublicExtensions()methodRegistryPaymentsController
getStripeCheckoutSessionStatus()company_uuidfor backward compatibilityRoutes
GET /~registry/v1/extensionsBenefits
✅ For Self-Hosted Users
✅ For Extension Developers
✅ For Fleetbase
✅ For the Ecosystem
Testing Checklist
Migration Notes
company_uuidvalues are automatically migrated to polymorphic formatcompany_uuidRelated Work
This PR works in conjunction with:
Security Considerations
Performance