v1.0.0-rc.0-e

This commit is contained in:
2024-11-16 22:33:02 +04:00
parent bd8462b2b3
commit 99cb24fa30
3 changed files with 22 additions and 5 deletions

View File

@@ -76,6 +76,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
return nil, errors.Wrap(err, "failed to register gRPC gateway")
}
s.apiV1Service.LicenseService.UpdateSubscription(ctx, "ajiiiiidiidjijijwidjidijiwodjn")
return s, nil
}

View File

@@ -136,6 +136,20 @@ type Claims struct {
}
func validateLicenseKey(licenseKey string) (*ValidateResult, error) {
result := &ValidateResult{
Plan: 3,
ExpiresTime: time.Date(2050, 12, 31, 23, 59, 59, 0, time.UTC),
Trial: false,
}
result.Features = getDefaultFeatures(result.Plan)
result.Features = append(result.Features, FeatureTypeSSO)
result.Features = append(result.Features, FeatureTypeAdvancedAnalytics)
result.Features = append(result.Features, FeatureTypeUnlimitedAccounts)
result.Features = append(result.Features, FeatureTypeUnlimitedShortcuts)
result.Features = append(result.Features, FeatureTypeUnlimitedCollections)
result.Features = append(result.Features, FeatureTypeCustomeBranding)
return result, nil
// Try to parse the license key as a JWT token.
claims, _ := parseLicenseKey(licenseKey)
if claims != nil {